Programmer Guide/Command Reference/EVAL/rleqs: Difference between revisions
From STX Wiki
< Programmer Guide | Command Reference | EVAL
Jump to navigationJump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:rleqs, cleqs}} | {{DISPLAYTITLE:rleqs, cleqs}} | ||
These functions implements an interface for the | These functions implements an interface for the [http://www.netlib.org/lapack LAPACK] functions DGESV, ZGESV, DGELS and ZGELS. | ||
;Usage: <code>rleqs(<var>A</var>, <var>B</var> {, <var>alg</var>})</code>: | ;Usage: <code>rleqs(<var>A</var>, <var>B</var> {, <var>alg</var>})</code>: | ||
:;<var>A</var>: left side MxN matrix ''x'' | :;<var>A</var>: left side MxN matrix ''x'' | ||
Line 18: | Line 18: | ||
::*<code>'''M>=N:''' minimize || ''B[M x NRHS] - ''A''[M x N] * ''X''[M x NRHS] ||</code> | ::*<code>'''M>=N:''' minimize || ''B[M x NRHS] - ''A''[M x N] * ''X''[M x NRHS] ||</code> | ||
::*<code>'''M<N:''' ''A''[M x M] * ''X''[M x NRHS] = ''B''[M x NRHS]</code> | ::*<code>'''M<N:''' ''A''[M x M] * ''X''[M x NRHS] = ''B''[M x NRHS]</code> | ||
:A detailed description of the functions can be found here: | :A detailed description of the functions can be found here: [http://www.netlib.org/lapack] | ||
;Result: The result ''X'' has the same type as the argument ''B'' and contains one solution per column. | ;Result: The result ''X'' has the same type as the argument ''B'' and contains one solution per column. | ||
Revision as of 07:12, 13 April 2011
These functions implements an interface for the LAPACK functions DGESV, ZGESV, DGELS and ZGELS.
- Usage
rleqs(A, B {, alg})
:- A
- left side MxN matrix x
- B
- right side vector with M elements (one solution) or MxNHRS matrix (multiple solutions)
- alg
- select a LAPACK algorithm to be used
alg=0 ... use DGESV if M=N and DGELS otherwise alg=1 ... use always DGESV, M must be equal to N alg=2 ... use always DGELS
- Description
- The function DGESV (ZGESV) solves a linear equation system.
A[M x M] * X[M x NRHS] = B[M x NRHS]
- The function DGELS (ZGELS) can be used to find the least solution of an overdetermined system (M>=N) or the minimum norm solution of an underdetermined system (M<N).
M>=N: minimize || B[M x NRHS] - A[M x N] * X[M x NRHS] ||
M<N: A[M x M] * X[M x NRHS] = B[M x NRHS]
- A detailed description of the functions can be found here: [1]
- Result
- The result X has the same type as the argument B and contains one solution per column.
- Notes
-
- The function
cleqs(A, B {, alg})
has the same arguments and result asrleqs
, but the vectors/matrices A, B and X are complex. rleqs
calls the LAPACK functions DGESV and DGELS, whilecleqs
calls ZGESV and ZGELS
- The function
- See also
- rpolyreg