Mercurial > octave-nkf
comparison src/DLD-FUNCTIONS/chol.cc @ 3244:7f8827f4040a
[project @ 1999-05-29 14:01:55 by jwe]
author | jwe |
---|---|
date | Sat, 29 May 1999 14:02:16 +0000 |
parents | dd00769643ae |
children | f16c2ce14886 |
comparison
equal
deleted
inserted
replaced
3243:dd00769643ae | 3244:7f8827f4040a |
---|---|
64 | 64 |
65 if (! error_state) | 65 if (! error_state) |
66 { | 66 { |
67 int info; | 67 int info; |
68 CHOL fact (m, info); | 68 CHOL fact (m, info); |
69 if (info != 0) | 69 if (nargout == 2 || info == 0) |
70 error ("chol: matrix not positive definite"); | |
71 else | |
72 { | 70 { |
73 retval(1) = static_cast<double> (info); | 71 retval(1) = static_cast<double> (info); |
74 retval(0) = fact.chol_matrix (); | 72 retval(0) = fact.chol_matrix (); |
75 } | 73 } |
74 else | |
75 error ("chol: matrix not positive definite"); | |
76 } | 76 } |
77 } | 77 } |
78 else if (arg.is_complex_type ()) | 78 else if (arg.is_complex_type ()) |
79 { | 79 { |
80 ComplexMatrix m = arg.complex_matrix_value (); | 80 ComplexMatrix m = arg.complex_matrix_value (); |
81 | 81 |
82 if (! error_state) | 82 if (! error_state) |
83 { | 83 { |
84 int info; | 84 int info; |
85 ComplexCHOL fact (m, info); | 85 ComplexCHOL fact (m, info); |
86 if (info != 0) | 86 if (nargout == 2 || info == 0) |
87 error ("chol: matrix not positive definite"); | |
88 else | |
89 { | 87 { |
90 retval(1) = static_cast<double> (info); | 88 retval(1) = static_cast<double> (info); |
91 retval(0) = fact.chol_matrix (); | 89 retval(0) = fact.chol_matrix (); |
92 } | 90 } |
91 else | |
92 error ("chol: matrix not positive definite"); | |
93 } | 93 } |
94 } | 94 } |
95 else | 95 else |
96 { | 96 { |
97 gripe_wrong_type_arg ("chol", arg); | 97 gripe_wrong_type_arg ("chol", arg); |