# module `mlmodel.direct_blas_lapack`¶

## Short summary¶

module `mlinsights.mlmodel.direct_blas_lapack`

Direct calls to libraries BLAS and LAPACK.

source on GitHub

## Functions¶

function

truncated documentation

`dgelss`

dgelss(double[:,

## Documentation¶

@file @brief Direct calls to libraries BLAS and LAPACK.

`mlinsights.mlmodel.direct_blas_lapack.``dgelss`(double[:, ::1] A, double[:, ::1] B, double prec=-1.)

Finds X in the problem by minimizing . Uses function dgels.

Parameters
• A – matrix with 2 dimensions

• B – matrix with 2 dimensions

• prec – precision

Returns

integer (INFO)

INFO is:

• `= 0`: successful exit

• `< 0`: if INFO = -i, the i-th argument had an illegal value

• `> 0`: if INFO = i, the i-th diagonal element of the triangular factor of A is zero, so that A does not have full rank; the least squares solution could not be computed.

Note

`::1` indicates A, B, C must be contiguous arrays. Arrays A, B are modified by the function. B contains the solution.

Use lapack function dgelss

C minimizes the problem .

<<<

```import numpy
from scipy.linalg.lapack import dgelss as scipy_dgelss
from mlinsights.mlmodel.direct_blas_lapack import dgelss

A = numpy.array([[10., 1.], [12., 1.], [13., 1]])
B = numpy.array([[20., 22., 23.]]).T
v, x, s, rank, work, info = scipy_dgelss(A, B)
print(x[:2])

A = A.T.copy()
info = dgelss(A, B)
assert info == 0
print(B[:2])
```

>>>

```    [[ 1.]
[10.]]
[[ 1.]
[10.]]
```