Lines Matching refs:MatrixType
12 template<typename MatrixType> void array_for_matrix(const MatrixType& m)
14 typedef typename MatrixType::Index Index;
15 typedef typename MatrixType::Scalar Scalar;
17 typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> ColVectorType;
18 typedef Matrix<Scalar, 1, MatrixType::ColsAtCompileTime> RowVectorType;
23 MatrixType m1 = MatrixType::Random(rows, cols),
24 m2 = MatrixType::Random(rows, cols),
35 VERIFY_IS_APPROX((m1.array() + s1).matrix(), MatrixType::Constant(rows,cols,s1) + m1);
36 VERIFY_IS_APPROX(((m1*Scalar(2)).array() - s2).matrix(), (m1+m1) - MatrixType::Constant(rows,cols,s2) );
74 template<typename MatrixType> void comparisons(const MatrixType& m)
76 typedef typename MatrixType::Index Index;
77 typedef typename MatrixType::Scalar Scalar;
79 typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> VectorType;
87 MatrixType m1 = MatrixType::Random(rows, cols),
88 m2 = MatrixType::Random(rows, cols),
114 VERIFY_IS_APPROX( (m1.array().abs()<MatrixType::Constant(rows,cols,mid).array())
115 .select(MatrixType::Zero(rows,cols),m1), m3);
117 VERIFY_IS_APPROX( (m1.array().abs()<MatrixType::Constant(rows,cols,mid).array())
119 VERIFY_IS_APPROX( (m1.array().abs()>=MatrixType::Constant(rows,cols,mid).array())
127 typedef Matrix<typename MatrixType::Index, Dynamic, 1> VectorOfIndices;
144 template<typename MatrixType> void cwise_min_max(const MatrixType& m)
146 typedef typename MatrixType::Index Index;
147 typedef typename MatrixType::Scalar Scalar;
152 MatrixType m1 = MatrixType::Random(rows, cols);
158 VERIFY_IS_APPROX(MatrixType::Constant(rows,cols, minM1), m1.cwiseMin(MatrixType::Constant(rows,cols, minM1)));
159 VERIFY_IS_APPROX(m1, m1.cwiseMin(MatrixType::Constant(rows,cols, maxM1)));
161 VERIFY_IS_APPROX(MatrixType::Constant(rows,cols, maxM1), m1.cwiseMax(MatrixType::Constant(rows,cols, maxM1)));
162 VERIFY_IS_APPROX(m1, m1.cwiseMax(MatrixType::Constant(rows,cols, minM1)));
165 VERIFY_IS_APPROX(MatrixType::Constant(rows,cols, minM1), m1.cwiseMin( minM1));
168 VERIFY_IS_APPROX(MatrixType::Constant(rows,cols, maxM1), m1.cwiseMax( maxM1));