diff --git a/src/base/blas.rs b/src/base/blas.rs index 4c72b74d..9654df08 100644 --- a/src/base/blas.rs +++ b/src/base/blas.rs @@ -757,7 +757,6 @@ where SB: Storage, SC: Storage, ShapeConstraint: DimEq + AreMultipliable, - // DefaultAllocator: Allocator, { let dim1 = self.nrows(); let (nrows2, ncols2) = a.shape(); @@ -920,7 +919,7 @@ where // matrixmultiply can be used only if the std feature is available. let nrows1 = self.nrows(); let (nrows2, ncols2) = a.shape(); - let (_, ncols3) = b.shape(); + let (nrows3, ncols3) = b.shape(); // Threshold determined empirically. const SMALL_DIM: usize = 5; @@ -931,7 +930,7 @@ where && ncols2 > SMALL_DIM { assert_eq!( - ncols1, nrows2, + ncols2, nrows3, "gemm: dimensions mismatch for multiplication." ); assert_eq!( @@ -1553,12 +1552,10 @@ where /// let mid = DMatrix::from_row_slice(3, 3, &[0.1, 0.2, 0.3, /// 0.5, 0.6, 0.7, /// 0.9, 1.0, 1.1]); - /// // The random shows that values on the workspace do not - /// // matter as they will be overwritten. - /// let mut workspace = DVector::new_random(2); + /// /// let expected = &lhs * &mid * lhs.transpose() * 10.0 + &mat * 5.0; /// - /// mat.quadform_tr_with_workspace(&mut workspace, 10.0, &lhs, &mid, 5.0); + /// mat.quadform_tr(10.0, &lhs, &mid, 5.0); /// assert_relative_eq!(mat, expected); pub fn quadform_tr( &mut self, @@ -1603,12 +1600,10 @@ where /// let mid = DMatrix::from_row_slice(3, 3, &[0.1, 0.2, 0.3, /// 0.5, 0.6, 0.7, /// 0.9, 1.0, 1.1]); - /// // The random shows that values on the workspace do not - /// // matter as they will be overwritten. - /// let mut workspace = DVector::new_random(3); + /// /// let expected = rhs.transpose() * &mid * &rhs * 10.0 + &mat * 5.0; /// - /// mat.quadform(&mut workspace, 10.0, &mid, &rhs, 5.0); + /// mat.quadform(10.0, &mid, &rhs, 5.0); /// assert_relative_eq!(mat, expected); pub fn quadform( &mut self, @@ -1622,9 +1617,9 @@ where ShapeConstraint: DimEq + DimEq + DimEq, DefaultAllocator: Allocator, { - // TODO: figure out why type inference wasn't doing its job. + // TODO: figure out why type inference isn't doing its job. let mut work = - Matrix::new_uninitialized_generic(D3::from_usize(self.shape().0), Const::<1>); + Matrix::new_uninitialized_generic(D3::from_usize(mid.shape().0), Const::<1>); work.gemv_z::(T::one(), mid, &rhs.column(0)); let mut work = unsafe { work.assume_init() }; diff --git a/src/base/matrix.rs b/src/base/matrix.rs index 38e9e7c3..62f0e771 100644 --- a/src/base/matrix.rs +++ b/src/base/matrix.rs @@ -152,7 +152,7 @@ pub type MatrixCross = /// dynamically-sized column vector should be represented as a `Matrix` (given /// some concrete types for `T` and a compatible data storage type `S`). #[repr(C)] -#[derive(Clone, Copy, Debug)] +#[derive(Clone, Copy)] pub struct Matrix { /// The data storage that contains all the matrix components. Disappointed? /// @@ -192,6 +192,12 @@ pub struct Matrix { _phantoms: PhantomData<(T, R, C)>, } +impl fmt::Debug for Matrix { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("Matrix").field("data", &self.data).finish() + } +} + impl Default for Matrix { fn default() -> Self { unsafe { Matrix::from_data_statically_unchecked(Default::default()) } diff --git a/src/geometry/reflection.rs b/src/geometry/reflection.rs index 06d07276..79b15a30 100644 --- a/src/geometry/reflection.rs +++ b/src/geometry/reflection.rs @@ -9,7 +9,7 @@ use simba::scalar::ComplexField; use crate::geometry::Point; /// A reflection wrt. a plane. -pub struct Reflection { +pub struct Reflection { axis: Vector, bias: T, }