diff --git a/src/linalg/decompositions.rs b/src/linalg/decompositions.rs index 16a3ecec..ccd5d168 100644 --- a/src/linalg/decompositions.rs +++ b/src/linalg/decompositions.rs @@ -11,10 +11,10 @@ use std::cmp::min; /// * `dim` - the dimension of the space the resulting matrix operates in /// * `start` - the starting dimension of the subspace of the reflexion /// * `vec` - the vector defining the reflection. -pub fn householder_matrix, - V: Indexable> - (dim: uint, start: uint, vec: V) -> M { +pub fn householder_matrix(dim: uint, start: uint, vec: V) -> M + where N: Float, + M: Eye + Indexable<(uint, uint), N>, + V: Indexable { let mut qk : M = Eye::new_identity(dim); let subdim = vec.shape(); @@ -38,12 +38,10 @@ pub fn householder_matrix(m: &M) -> (M, M) + where N: Float, V: Indexable + Norm, - M: Clone + Eye + ColSlice + Transpose - + Indexable<(uint, uint), N> + Mul> - (m: &M) - -> (M, M) { + M: Clone + Eye + ColSlice + Transpose + Indexable<(uint, uint), N> + Mul { let (rows, cols) = m.shape(); assert!(rows >= cols); let mut q : M = Eye::new_identity(rows); @@ -75,14 +73,12 @@ pub fn qr + Norm, - V2: Zero, - M: Clone + Eye + ColSlice + Transpose - + Indexable<(uint, uint), N> + Mul - + Diag + ApproxEq + Add - + Sub> - (m: &M, eps: &N, niter: uint) -> (M, V2) { +pub fn eigen_qr(m: &M, eps: &N, niter: uint) -> (M, V2) + where N: Float, + V: Indexable + Norm, + V2: Zero, + M: Clone + Eye + ColSlice + Transpose + Indexable<(uint, uint), N> + Mul + + Diag + ApproxEq + Add + Sub { let (rows, cols) = m.shape(); assert!(rows == cols, "The matrix being decomposed must be square.");