Home | History | Annotate | Download | only in test

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;
16 typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> ColVectorType;
17 typedef Matrix<Scalar, 1, MatrixType::ColsAtCompileTime> RowVectorType;
22 MatrixType m1 = MatrixType::Random(rows, cols),
23 m2 = MatrixType::Random(rows, cols),
34 VERIFY_IS_APPROX((m1.array() + s1).matrix(), MatrixType::Constant(rows,cols,s1) + m1);
35 VERIFY_IS_APPROX(((m1*Scalar(2)).array() - s2).matrix(), (m1+m1) - MatrixType::Constant(rows,cols,s2) );
73 template<typename MatrixType> void comparisons(const MatrixType& m)
76 typedef typename MatrixType::Index Index;
77 typedef typename MatrixType::Scalar Scalar;
86 MatrixType m1 = MatrixType::Random(rows, cols),
87 m2 = MatrixType::Random(rows, cols),
113 VERIFY_IS_APPROX( (m1.array().abs()<MatrixType::Constant(rows,cols,mid).array())
114 .select(MatrixType::Zero(rows,cols),m1), m3);
116 VERIFY_IS_APPROX( (m1.array().abs()<MatrixType::Constant(rows,cols,mid).array())
118 VERIFY_IS_APPROX( (m1.array().abs()>=MatrixType::Constant(rows,cols,mid).array())
126 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));
170 VERIFY_IS_APPROX(MatrixType::Constant(rows,cols, maxM1), m1.cwiseMax( maxM1));
175 VERIFY_IS_APPROX(MatrixType::Constant(rows,cols, minM1).array(), (m1.array().min)( minM1));
178 VERIFY_IS_APPROX(MatrixType::Constant(rows,cols, maxM1).array(), (m1.array().max)( maxM1));
187 typedef Matrix<Scalar,Dynamic,Dynamic> MatrixType;
194 MatrixType m(rows,cols);