summaryrefslogtreecommitdiff
path: root/lib/Numeric/LinearAlgebra/LAPACK
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Numeric/LinearAlgebra/LAPACK')
-rw-r--r--lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.c b/lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.c
index 06c2479..fd840e3 100644
--- a/lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.c
+++ b/lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.c
@@ -492,6 +492,42 @@ int linearSolveC_l(KCMAT(a),KCMAT(b),CMAT(x)) {
492 OK 492 OK
493} 493}
494 494
495//////// symmetric positive definite real linear system using Cholesky ////////////
496
497int cholSolveR_l(KDMAT(a),KDMAT(b),DMAT(x)) {
498 integer n = ar;
499 integer nhrs = bc;
500 REQUIRES(n>=1 && ar==ac && ar==br,BAD_SIZE);
501 DEBUGMSG("cholSolveR_l");
502 memcpy(xp,bp,n*nhrs*sizeof(double));
503 integer res;
504 dpotrs_ ("U",
505 &n,&nhrs,
506 (double*)ap, &n,
507 xp, &n,
508 &res);
509 CHECK(res,res);
510 OK
511}
512
513//////// Hermitian positive definite real linear system using Cholesky ////////////
514
515int cholSolveC_l(KCMAT(a),KCMAT(b),CMAT(x)) {
516 integer n = ar;
517 integer nhrs = bc;
518 REQUIRES(n>=1 && ar==ac && ar==br,BAD_SIZE);
519 DEBUGMSG("cholSolveC_l");
520 memcpy(xp,bp,2*n*nhrs*sizeof(double));
521 integer res;
522 zpotrs_ ("U",
523 &n,&nhrs,
524 (doublecomplex*)ap, &n,
525 (doublecomplex*)xp, &n,
526 &res);
527 CHECK(res,res);
528 OK
529}
530
495//////////////////// least squares real linear system //////////// 531//////////////////// least squares real linear system ////////////
496 532
497int linearSolveLSR_l(KDMAT(a),KDMAT(b),DMAT(x)) { 533int linearSolveLSR_l(KDMAT(a),KDMAT(b),DMAT(x)) {