Mercurial > octave
comparison libinterp/corefcn/det.cc @ 31319:6cf02f842e74
Backed out changeset 24e45a79bf3c
author | Arun Giridhar <arungiridhar@gmail.com> |
---|---|
date | Wed, 19 Oct 2022 12:14:09 -0400 |
parents | 24e45a79bf3c |
children | e88a07dec498 |
comparison
equal
deleted
inserted
replaced
31318:eba9d6d4cc41 | 31319:6cf02f842e74 |
---|---|
94 if (isfloat) | 94 if (isfloat) |
95 { | 95 { |
96 retval(0) = arg.float_complex_diag_matrix_value () | 96 retval(0) = arg.float_complex_diag_matrix_value () |
97 .determinant ().value (); | 97 .determinant ().value (); |
98 if (nargout > 1) | 98 if (nargout > 1) |
99 { | 99 retval(1) = arg.float_complex_diag_matrix_value ().rcond (); |
100 const auto& tmp = arg.float_complex_diag_matrix_value (); | 100 } |
101 retval(1) = tmp.rcond (); | 101 else |
102 } | 102 { |
103 } | 103 retval(0) = arg.complex_diag_matrix_value () |
104 else | 104 .determinant ().value (); |
105 { | 105 if (nargout > 1) |
106 const auto& tmp1 = arg.complex_diag_matrix_value (); | 106 retval(1) = arg.complex_diag_matrix_value ().rcond (); |
107 const auto& tmp2 = tmp1.determinant (); | |
108 retval(0) = tmp2.value (); | |
109 if (nargout > 1) | |
110 retval(1) = tmp1.rcond (); | |
111 } | 107 } |
112 } | 108 } |
113 else | 109 else |
114 { | 110 { |
115 if (isfloat) | 111 if (isfloat) |
116 { | 112 { |
117 const auto& tmp1 = arg.float_diag_matrix_value (); | 113 retval(0) = arg.float_diag_matrix_value () |
118 const auto& tmp2 = tmp1.determinant (); | 114 .determinant ().value (); |
119 retval(0) = tmp2.value (); | 115 if (nargout > 1) |
120 if (nargout > 1) | 116 retval(1) = arg.float_diag_matrix_value ().rcond (); |
121 retval(1) = tmp1.rcond (); | 117 } |
122 } | 118 else |
123 else | 119 { |
124 { | 120 retval(0) = arg.diag_matrix_value ().determinant ().value (); |
125 const auto& tmp1 = arg.diag_matrix_value (); | 121 if (nargout > 1) |
126 const auto& tmp2 = tmp1.determinant (); | 122 retval(1) = arg.diag_matrix_value ().rcond (); |
127 retval(0) = tmp2.value (); | |
128 if (nargout > 1) | |
129 retval(1) = tmp1.rcond (); | |
130 } | 123 } |
131 } | 124 } |
132 } | 125 } |
133 else if (arg.is_perm_matrix ()) | 126 else if (arg.is_perm_matrix ()) |
134 { | 127 { |
135 if (nargout <= 1) | 128 if (nargout <= 1) |
136 retval.resize (1); | 129 retval.resize (1); |
137 | 130 |
138 const auto& tmp = arg.perm_matrix_value (); | 131 retval(0) = static_cast<double> (arg.perm_matrix_value ().determinant ()); |
139 retval(0) = static_cast<double> (tmp.determinant ()); | |
140 if (nargout > 1) | 132 if (nargout > 1) |
141 retval(1) = 1.0; | 133 retval(1) = 1.0; |
142 } | 134 } |
143 else if (arg.is_single_type ()) | 135 else if (arg.is_single_type ()) |
144 { | 136 { |