## [Maxima-commits] CVS: maxima/share/lapack dgesv.lisp, NONE, 1.1 lapack.system, 1.8, 1.9

 [Maxima-commits] CVS: maxima/share/lapack dgesv.lisp, NONE, 1.1 lapack.system, 1.8, 1.9 From: Robert Dodier - 2010-07-18 00:36:53 Update of /cvsroot/maxima/maxima/share/lapack In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv18676 Modified Files: lapack.system Added Files: dgesv.lisp Log Message: New Maxima function dgesv which calls DGESV in lapack for solution of linear equation A x = b via LU decomposition. --- NEW FILE: dgesv.lisp --- ;; dgesv.lisp -- Maxima interface to lapack::dgesv ;; copyright 2010 by Robert Dodier ;; I release this work under terms of the GNU General Public License. ;; dgesv(a, b) returns solution x of linear equations a . x = b ;; as computed by the LU decomposition. ;; a is a n-by-n Maxima matrix, b is a n-by-m Maxima matrix, ;; where m maybe be greater than or equal to 1. ;; a and b are not modified. (defun \$dgesv (a b) (multiple-value-bind (a-nrow a-ncol) (maxima-matrix-dims a) (multiple-value-bind (b-nrow b-ncol) (maxima-matrix-dims b) (let ((a-mat (lapack-lispify-matrix a a-nrow a-ncol)) (b-mat (lapack-lispify-matrix b b-nrow b-ncol)) (ipiv (make-array a-nrow :element-type 'f2cl-lib:integer4))) (multiple-value-bind (z-n z-nrhs z-a z-lda z-ipiv z-b z-ldb\$ z-info) (lapack::dgesv a-nrow b-ncol a-mat a-nrow ipiv b-mat b-nrow 0) (declare (ignore z-n z-nrhs z-a z-lda z-ipiv z-b z-ldb\$)) (cond ((< z-info 0) (merror "dgesv: ~M-th argument has an illegal value." (- z-info))) ((> z-info 0) (merror "dgesv: U(~M, ~M) is exactly zero; cannot compute a solution." z-info z-info)) (t (lapack-maxify-matrix b-nrow b-ncol b-mat)))))))) Index: lapack.system =================================================================== RCS file: /cvsroot/maxima/maxima/share/lapack/lapack.system,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- lapack.system 8 Apr 2009 12:13:20 -0000 1.8 +++ lapack.system 18 Jul 2010 00:36:44 -0000 1.9 @@ -339,4 +339,5 @@ :depends-on ("lapack") :components ( - (:file "eigensys"))) + (:file "eigensys") + (:file "dgesv")))