Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Punt to LS solve on degenerate symmetric solve
  • Loading branch information
pkhuong committed Dec 19, 2013
1 parent c7214f8 commit f0668c9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions affine-scaling.lisp
Expand Up @@ -94,7 +94,9 @@
(lapack:dpotrf "L" n (lapack:dpotrf "L" n
(matlisp::store A) (max 1 n) (matlisp::store A) (max 1 n)
0) 0)
(assert (zerop info)) (unless (zerop info)
(format t " (DPOTRF: ~A) " info)
(return-from solve-symmetric!))
(multiple-value-bind (solution info) (multiple-value-bind (solution info)
(lapack:dpotrs "L" n 1 (lapack:dpotrs "L" n 1
factor (max 1 n) factor (max 1 n)
Expand All @@ -120,7 +122,11 @@
(B (scale-constraints constraints scale)) (B (scale-constraints constraints scale))
(N (matlisp:gemm! 1 B B 0 (proj-BBt proj) :nt)) (N (matlisp:gemm! 1 B B 0 (proj-BBt proj) :nt))
(Bc (matlisp:m* B c)) (Bc (matlisp:m* B c))
(N^-1Bc (solve-symmetric! N bc))) (N^-1Bc (or (solve-symmetric! N bc)
(matlisp:gelsy! (matlisp:gemm! 1 B B 0 (proj-BBt proj)
:nt)
(matlisp:m* B c)
1d-10))))
;; c - Bt N^-1 B c ;; c - Bt N^-1 B c
(matlisp:gemm! -1 B N^-1Bc 1 c :tn))) (matlisp:gemm! -1 B N^-1Bc 1 c :tn)))


Expand Down

0 comments on commit f0668c9

Please sign in to comment.