Lines Matching refs:m1

22   MatrixType m1 = MatrixType::Random(rows, cols),  in array_for_matrix()  local
33 VERIFY_IS_APPROX(m1.array() + s1, s1 + m1.array()); in array_for_matrix()
34 VERIFY_IS_APPROX((m1.array() + s1).matrix(), MatrixType::Constant(rows,cols,s1) + m1); in array_for_matrix()
35 …VERIFY_IS_APPROX(((m1*Scalar(2)).array() - s2).matrix(), (m1+m1) - MatrixType::Constant(rows,cols,… in array_for_matrix()
36 m3 = m1; in array_for_matrix()
38 VERIFY_IS_APPROX(m3, (m1.array() + s2).matrix()); in array_for_matrix()
39 m3 = m1; in array_for_matrix()
41 VERIFY_IS_APPROX(m3, (m1.array() - s1).matrix()); in array_for_matrix()
44 VERIFY_IS_MUCH_SMALLER_THAN(m1.colwise().sum().sum() - m1.sum(), m1.squaredNorm()); in array_for_matrix()
45 VERIFY_IS_MUCH_SMALLER_THAN(m1.rowwise().sum().sum() - m1.sum(), m1.squaredNorm()); in array_for_matrix()
46 …VERIFY_IS_MUCH_SMALLER_THAN(m1.colwise().sum() + m2.colwise().sum() - (m1+m2).colwise().sum(), (m1 in array_for_matrix()
47 …VERIFY_IS_MUCH_SMALLER_THAN(m1.rowwise().sum() - m2.rowwise().sum() - (m1-m2).rowwise().sum(), (m1 in array_for_matrix()
48 VERIFY_IS_APPROX(m1.colwise().sum(), m1.colwise().redux(internal::scalar_sum_op<Scalar>())); in array_for_matrix()
51 m3 = m1; in array_for_matrix()
52 VERIFY_IS_APPROX(m3.colwise() += cv1, m1.colwise() + cv1); in array_for_matrix()
53 m3 = m1; in array_for_matrix()
54 VERIFY_IS_APPROX(m3.colwise() -= cv1, m1.colwise() - cv1); in array_for_matrix()
55 m3 = m1; in array_for_matrix()
56 VERIFY_IS_APPROX(m3.rowwise() += rv1, m1.rowwise() + rv1); in array_for_matrix()
57 m3 = m1; in array_for_matrix()
58 VERIFY_IS_APPROX(m3.rowwise() -= rv1, m1.rowwise() - rv1); in array_for_matrix()
61 VERIFY_IS_APPROX(m1.block(0,0,0,cols).colwise().sum(), RowVectorType::Zero(cols)); in array_for_matrix()
62 VERIFY_IS_APPROX(m1.block(0,0,rows,0).rowwise().prod(), ColVectorType::Ones(rows)); in array_for_matrix()
86 MatrixType m1 = MatrixType::Random(rows, cols), in comparisons() local
90 VERIFY(((m1.array() + Scalar(1)) > m1.array()).all()); in comparisons()
91 VERIFY(((m1.array() - Scalar(1)) < m1.array()).all()); in comparisons()
94 m3 = m1; in comparisons()
96 VERIFY(! (m1.array() < m3.array()).all() ); in comparisons()
97 VERIFY(! (m1.array() > m3.array()).all() ); in comparisons()
101 VERIFY( (m1.array() != (m1(r,c)+1) ).any() ); in comparisons()
102 VERIFY( (m1.array() > (m1(r,c)-1) ).any() ); in comparisons()
103 VERIFY( (m1.array() < (m1(r,c)+1) ).any() ); in comparisons()
104 VERIFY( (m1.array() == m1(r,c) ).any() ); in comparisons()
105 VERIFY( m1.cwiseEqual(m1(r,c)).any() ); in comparisons()
108 VERIFY_IS_APPROX( (m1.array()<m2.array()).select(m1,m2), m1.cwiseMin(m2) ); in comparisons()
109 VERIFY_IS_APPROX( (m1.array()>m2.array()).select(m1,m2), m1.cwiseMax(m2) ); in comparisons()
110 Scalar mid = (m1.cwiseAbs().minCoeff() + m1.cwiseAbs().maxCoeff())/Scalar(2); in comparisons()
113 m3(i,j) = abs(m1(i,j))<mid ? 0 : m1(i,j); in comparisons()
114 VERIFY_IS_APPROX( (m1.array().abs()<MatrixType::Constant(rows,cols,mid).array()) in comparisons()
115 .select(MatrixType::Zero(rows,cols),m1), m3); in comparisons()
117 VERIFY_IS_APPROX( (m1.array().abs()<MatrixType::Constant(rows,cols,mid).array()) in comparisons()
118 .select(0,m1), m3); in comparisons()
119 VERIFY_IS_APPROX( (m1.array().abs()>=MatrixType::Constant(rows,cols,mid).array()) in comparisons()
120 .select(m1,0), m3); in comparisons()
122 VERIFY_IS_APPROX( (m1.array().abs()<mid).select(0,m1), m3); in comparisons()
125 VERIFY(((m1.array().abs()+1)>RealScalar(0.1)).count() == rows*cols); in comparisons()
130 …VERIFY_IS_APPROX(((m1.array().abs()+1)>RealScalar(0.1)).matrix().colwise().count(), VectorOfIndice… in comparisons()
131 …VERIFY_IS_APPROX(((m1.array().abs()+1)>RealScalar(0.1)).matrix().rowwise().count(), VectorOfIndice… in comparisons()
153 MatrixType m1 = MatrixType::Random(rows, cols); in cwise_min_max() local
156 Scalar maxM1 = m1.maxCoeff(); in cwise_min_max()
157 Scalar minM1 = m1.minCoeff(); in cwise_min_max()
159 …VERIFY_IS_APPROX(MatrixType::Constant(rows,cols, minM1), m1.cwiseMin(MatrixType::Constant(rows,col… in cwise_min_max()
160 VERIFY_IS_APPROX(m1, m1.cwiseMin(MatrixType::Constant(rows,cols, maxM1))); in cwise_min_max()
162 …VERIFY_IS_APPROX(MatrixType::Constant(rows,cols, maxM1), m1.cwiseMax(MatrixType::Constant(rows,col… in cwise_min_max()
163 VERIFY_IS_APPROX(m1, m1.cwiseMax(MatrixType::Constant(rows,cols, minM1))); in cwise_min_max()
166 VERIFY_IS_APPROX(MatrixType::Constant(rows,cols, minM1), m1.cwiseMin( minM1)); in cwise_min_max()
167 VERIFY_IS_APPROX(m1, m1.cwiseMin(maxM1)); in cwise_min_max()
168 VERIFY_IS_APPROX(-m1, (-m1).cwiseMin(-minM1)); in cwise_min_max()
169 VERIFY_IS_APPROX(-m1.array(), ((-m1).array().min)( -minM1)); in cwise_min_max()
171 VERIFY_IS_APPROX(MatrixType::Constant(rows,cols, maxM1), m1.cwiseMax( maxM1)); in cwise_min_max()
172 VERIFY_IS_APPROX(m1, m1.cwiseMax(minM1)); in cwise_min_max()
173 VERIFY_IS_APPROX(-m1, (-m1).cwiseMax(-maxM1)); in cwise_min_max()
174 VERIFY_IS_APPROX(-m1.array(), ((-m1).array().max)(-maxM1)); in cwise_min_max()
176 VERIFY_IS_APPROX(MatrixType::Constant(rows,cols, minM1).array(), (m1.array().min)( minM1)); in cwise_min_max()
177 VERIFY_IS_APPROX(m1.array(), (m1.array().min)( maxM1)); in cwise_min_max()
179 VERIFY_IS_APPROX(MatrixType::Constant(rows,cols, maxM1).array(), (m1.array().max)( maxM1)); in cwise_min_max()
180 VERIFY_IS_APPROX(m1.array(), (m1.array().max)( minM1)); in cwise_min_max()