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,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()
73 m1.array().coeffRef(0,0) = 1; in array_for_matrix()
74 VERIFY_IS_APPROX(m1(0,0),Scalar(1)); in array_for_matrix()
75 m1.array()(0,0) = 2; in array_for_matrix()
76 VERIFY_IS_APPROX(m1(0,0),Scalar(2)); in array_for_matrix()
77 m1.array().matrix().coeffRef(0,0) = 3; in array_for_matrix()
78 VERIFY_IS_APPROX(m1(0,0),Scalar(3)); in array_for_matrix()
79 m1.array().matrix()(0,0) = 4; in array_for_matrix()
80 VERIFY_IS_APPROX(m1(0,0),Scalar(4)); in array_for_matrix()
96 MatrixType m1 = MatrixType::Random(rows, cols), in comparisons() local
100 VERIFY(((m1.array() + Scalar(1)) > m1.array()).all()); in comparisons()
101 VERIFY(((m1.array() - Scalar(1)) < m1.array()).all()); in comparisons()
104 m3 = m1; in comparisons()
106 VERIFY(! (m1.array() < m3.array()).all() ); in comparisons()
107 VERIFY(! (m1.array() > m3.array()).all() ); in comparisons()
111 VERIFY( (m1.array() != (m1(r,c)+1) ).any() ); in comparisons()
112 VERIFY( (m1.array() > (m1(r,c)-1) ).any() ); in comparisons()
113 VERIFY( (m1.array() < (m1(r,c)+1) ).any() ); in comparisons()
114 VERIFY( (m1.array() == m1(r,c) ).any() ); in comparisons()
115 VERIFY( m1.cwiseEqual(m1(r,c)).any() ); in comparisons()
118 VERIFY_IS_APPROX( (m1.array()<m2.array()).select(m1,m2), m1.cwiseMin(m2) ); in comparisons()
119 VERIFY_IS_APPROX( (m1.array()>m2.array()).select(m1,m2), m1.cwiseMax(m2) ); in comparisons()
120 Scalar mid = (m1.cwiseAbs().minCoeff() + m1.cwiseAbs().maxCoeff())/Scalar(2); in comparisons()
123 m3(i,j) = abs(m1(i,j))<mid ? 0 : m1(i,j); in comparisons()
124 VERIFY_IS_APPROX( (m1.array().abs()<MatrixType::Constant(rows,cols,mid).array()) in comparisons()
125 .select(MatrixType::Zero(rows,cols),m1), m3); in comparisons()
127 VERIFY_IS_APPROX( (m1.array().abs()<MatrixType::Constant(rows,cols,mid).array()) in comparisons()
128 .select(0,m1), m3); in comparisons()
129 VERIFY_IS_APPROX( (m1.array().abs()>=MatrixType::Constant(rows,cols,mid).array()) in comparisons()
130 .select(m1,0), m3); in comparisons()
132 VERIFY_IS_APPROX( (m1.array().abs()<mid).select(0,m1), m3); in comparisons()
135 VERIFY(((m1.array().abs()+1)>RealScalar(0.1)).count() == rows*cols); in comparisons()
138 …VERIFY( ((m1.array()<RealScalar(0)).matrix() && (m1.array()>RealScalar(0)).matrix()).count() == 0); in comparisons()
139 …VERIFY( ((m1.array()<RealScalar(0)).matrix() || (m1.array()>=RealScalar(0)).matrix()).count() == r… in comparisons()
140 RealScalar a = m1.cwiseAbs().mean(); in comparisons()
141 …VERIFY( ((m1.array()<-a).matrix() || (m1.array()>a).matrix()).count() == (m1.cwiseAbs().array()>a)… in comparisons()
146 …VERIFY_IS_APPROX(((m1.array().abs()+1)>RealScalar(0.1)).matrix().colwise().count(), VectorOfIndice… in comparisons()
147 …VERIFY_IS_APPROX(((m1.array().abs()+1)>RealScalar(0.1)).matrix().rowwise().count(), VectorOfIndice… in comparisons()
181 MatrixType m1 = MatrixType::Random(rows, cols); in cwise_min_max() local
184 Scalar maxM1 = m1.maxCoeff(); in cwise_min_max()
185 Scalar minM1 = m1.minCoeff(); in cwise_min_max()
187 …VERIFY_IS_APPROX(MatrixType::Constant(rows,cols, minM1), m1.cwiseMin(MatrixType::Constant(rows,col… in cwise_min_max()
188 VERIFY_IS_APPROX(m1, m1.cwiseMin(MatrixType::Constant(rows,cols, maxM1))); in cwise_min_max()
190 …VERIFY_IS_APPROX(MatrixType::Constant(rows,cols, maxM1), m1.cwiseMax(MatrixType::Constant(rows,col… in cwise_min_max()
191 VERIFY_IS_APPROX(m1, m1.cwiseMax(MatrixType::Constant(rows,cols, minM1))); in cwise_min_max()
194 VERIFY_IS_APPROX(MatrixType::Constant(rows,cols, minM1), m1.cwiseMin( minM1)); in cwise_min_max()
195 VERIFY_IS_APPROX(m1, m1.cwiseMin(maxM1)); in cwise_min_max()
196 VERIFY_IS_APPROX(-m1, (-m1).cwiseMin(-minM1)); in cwise_min_max()
197 VERIFY_IS_APPROX(-m1.array(), ((-m1).array().min)( -minM1)); in cwise_min_max()
199 VERIFY_IS_APPROX(MatrixType::Constant(rows,cols, maxM1), m1.cwiseMax( maxM1)); in cwise_min_max()
200 VERIFY_IS_APPROX(m1, m1.cwiseMax(minM1)); in cwise_min_max()
201 VERIFY_IS_APPROX(-m1, (-m1).cwiseMax(-maxM1)); in cwise_min_max()
202 VERIFY_IS_APPROX(-m1.array(), ((-m1).array().max)(-maxM1)); in cwise_min_max()
204 VERIFY_IS_APPROX(MatrixType::Constant(rows,cols, minM1).array(), (m1.array().min)( minM1)); in cwise_min_max()
205 VERIFY_IS_APPROX(m1.array(), (m1.array().min)( maxM1)); in cwise_min_max()
207 VERIFY_IS_APPROX(MatrixType::Constant(rows,cols, maxM1).array(), (m1.array().max)( maxM1)); in cwise_min_max()
208 VERIFY_IS_APPROX(m1.array(), (m1.array().max)( minM1)); in cwise_min_max()