Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

## maxima-commits

 [Maxima-commits] CVS: maxima/doc/info lapack.texi,1.5,1.6 From: Robert Dodier - 2010-07-18 17:06:00 ```Update of /cvsroot/maxima/maxima/doc/info In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv23985 Modified Files: lapack.texi Log Message: Description of new function dgesv. Index: lapack.texi =================================================================== RCS file: /cvsroot/maxima/maxima/doc/info/lapack.texi,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- lapack.texi 4 Jan 2008 20:36:34 -0000 1.5 +++ lapack.texi 18 Jul 2010 17:05:51 -0000 1.6 @@ -99,6 +99,107 @@ @end deffn +@deffn {Function} dgesv (@var{A}, @var{b}) + +Computes the solution @var{x} of the linear equation @math{@var{A} @var{x} = @var{b}}, +where @var{A} is a square matrix, and @var{b} is a matrix of the same number of rows +as @var{A} and any number of columns. +The return value @var{x} is the same size as @var{b}. + +The elements of @var{A} and @var{b} must evaluate to real floating point numbers via @code{float}; +thus elements may be any numeric type, symbolic numerical constants, or expressions which evaluate to floats. +The elements of @var{x} are always floating point numbers. +All arithmetic is carried out as floating point operations. + +@code{dgesv} computes the solution via the LU decomposition of @var{A}. + +Examples: + +@code{dgesv} computes the solution of the linear equation @math{@var{A} @var{x} = @var{b}}. + +@c ===beg=== +@c A : matrix ([1, -2.5], [0.375, 5]); +@c b : matrix ([1.75], [-0.625]); +@c x : dgesv (A, b); +@c dlange (inf_norm, b - A . x); +@c ===end=== +@example +(%i1) A : matrix ([1, -2.5], [0.375, 5]); + [ 1 - 2.5 ] +(%o1) [ ] + [ 0.375 5 ] +(%i2) b : matrix ([1.75], [-0.625]); + [ 1.75 ] +(%o2) [ ] + [ - 0.625 ] +(%i3) x : dgesv (A, b); + [ 1.210526315789474 ] +(%o3) [ ] + [ - 0.215789473684211 ] +(%i4) dlange (inf_norm, b - A.x); +(%o4) 0.0 +@end example + +@var{b} is a matrix with the same number of rows as @var{A} and any number of columns. +@var{x} is the same size as @var{b}. + +@c ===beg=== +@c A : matrix ([1, -0.15], [1.82, 2]); +@c b : matrix ([3.7, 1, 8], [-2.3, 5, -3.9]); +@c x : dgesv (A, b); +@c dlange (inf_norm, b - A . x); +@c ===end=== +@example +(%o0) done +(%i1) A : matrix ([1, -0.15], [1.82, 2]); + [ 1 - 0.15 ] +(%o1) [ ] + [ 1.82 2 ] +(%i2) b : matrix ([3.7, 1, 8], [-2.3, 5, -3.9]); + [ 3.7 1 8 ] +(%o2) [ ] + [ - 2.3 5 - 3.9 ] +(%i3) x : dgesv (A, b); + [ 3.103827540695117 1.20985481742191 6.781786185657722 ] +(%o3) [ ] + [ - 3.974483062032557 1.399032116146062 - 8.121425428948527 ] +(%i4) dlange (inf_norm, b - A . x); +(%o4) 1.1102230246251565E-15 +@end example + +The elements of @var{A} and @var{b} must evaluate to real floating point numbers. + +@c ===beg=== +@c A : matrix ([5, -%pi], [1b0, 11/17]); +@c b : matrix ([%e], [sin(1)]); +@c x : dgesv (A, b); +@c dlange (inf_norm, b - A . x); +@c ===end=== +@example +(%i1) A : matrix ([5, -%pi], [1b0, 11/17]); + [ 5 - %pi ] + [ ] +(%o1) [ 11 ] + [ 1.0b0 -- ] + [ 17 ] +(%i2) b : matrix ([%e], [sin(1)]); + [ %e ] +(%o2) [ ] + [ sin(1) ] +(%i3) x : dgesv (A, b); + [ 0.690375643155986 ] +(%o3) [ ] + [ 0.233510982552952 ] +(%i4) dlange (inf_norm, b - A . x); +(%o4) 2.220446049250313E-16 +@end example + +@end deffn + +@opencatbox +@category{Package lapack} @category{Linear equations} +@closecatbox + @deffn {Function} dgesvd (@var{A}) @deffnx {Function} dgesvd (@var{A}, @var{left_p}, @var{right_p}) ```