From 9dc0eb1657444438e24bd46b62e4da4cd8aab612 Mon Sep 17 00:00:00 2001 From: SaptarishiD Date: Sat, 16 Nov 2024 23:28:55 +0530 Subject: [PATCH] feat: user can access PermutationSequence indices --- src/linalg/permutation_sequence.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/linalg/permutation_sequence.rs b/src/linalg/permutation_sequence.rs index df7ad7dd5..cb738aaad 100644 --- a/src/linalg/permutation_sequence.rs +++ b/src/linalg/permutation_sequence.rs @@ -161,4 +161,10 @@ where -T::one() } } + + /// Returns the permutation indices as a vector of tuples to the user. + #[inline] + pub fn permutation_indices(&self) -> Vec<(usize, usize)> { + self.ipiv.rows_range(..self.len).iter().cloned().collect() + } }