Solve the linear system A*x = b
.
With no options, this function is equivalent to the left division operator
(x = A \ b
) or the matrix-left-divide function
(x = mldivide (A, b)
).
Octave ordinarily examines the properties of the matrix A and chooses
a solver that best matches the matrix. By passing a structure opts
to linsolve
you can inform Octave directly about the matrix A.
In this case Octave will skip the matrix examination and proceed directly
to solving the linear system.
Warning: If the matrix A does not have the properties listed in the opts structure then the result will not be accurate AND no warning will be given. When in doubt, let Octave examine the matrix and choose the appropriate solver as this step takes little time and the result is cached so that it is only done once per linear system.
Possible opts fields (set value to true/false):
A is lower triangular
A is upper triangular
A is upper Hessenberg (currently makes no difference)
A is symmetric or complex Hermitian (currently makes no difference)
A is positive definite
A is general rectangular (currently makes no difference)
Solve A'*x = b
by transpose (A) \ b
The optional second output R is the inverse condition number of A (zero if matrix is singular).
See also: mldivide, matrix_type, rcond.
Package: octave