Skip to content

Commit 9d25e9e

Browse files
committed
q_transposed stored in decomposition result
1 parent 772dafa commit 9d25e9e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/matrix.rs

+5
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,11 @@ impl<T: FloatLike> SquareMatrix<T> {
200200
}
201201

202202
let mut q_transposed_inverse = SquareMatrix::new_zeros(self.dim);
203+
let mut q_transposed = SquareMatrix::new_zeros(self.dim);
203204
for row in 0..self.dim {
204205
for col in 0..self.dim {
205206
q_transposed_inverse[(row, col)] = inverse_q[(col, row)];
207+
q_transposed[(row, col)] = q[(col, row)];
206208
}
207209
}
208210

@@ -235,6 +237,7 @@ impl<T: FloatLike> SquareMatrix<T> {
235237
determinant,
236238
inverse,
237239
q_transposed_inverse,
240+
q_transposed,
238241
})
239242
}
240243

@@ -284,13 +287,15 @@ impl SquareMatrix<f128> {
284287
pub struct DecompositionResult<T> {
285288
pub determinant: T,
286289
pub inverse: SquareMatrix<T>,
290+
pub q_transposed: SquareMatrix<T>,
287291
pub q_transposed_inverse: SquareMatrix<T>,
288292
}
289293

290294
impl DecompositionResult<f128> {
291295
pub fn downcast(&self) -> DecompositionResult<f64> {
292296
DecompositionResult {
293297
determinant: self.determinant.into(),
298+
q_transposed: self.q_transposed.downcast(),
294299
inverse: self.inverse.downcast(),
295300
q_transposed_inverse: self.q_transposed_inverse.downcast(),
296301
}

0 commit comments

Comments
 (0)