Lines Matching refs:m1
22 ArrayType m1 = ArrayType::Random(rows, cols), in array() local
33 VERIFY_IS_APPROX(m1 + s1, s1 + m1); in array()
34 VERIFY_IS_APPROX(m1 + s1, ArrayType::Constant(rows,cols,s1) + m1); in array()
35 VERIFY_IS_APPROX(s1 - m1, (-m1)+s1 ); in array()
36 VERIFY_IS_APPROX(m1 - s1, m1 - ArrayType::Constant(rows,cols,s1)); in array()
37 VERIFY_IS_APPROX(s1 - m1, ArrayType::Constant(rows,cols,s1) - m1); in array()
38 VERIFY_IS_APPROX((m1*Scalar(2)) - s2, (m1+m1) - ArrayType::Constant(rows,cols,s2) ); in array()
39 m3 = m1; in array()
41 VERIFY_IS_APPROX(m3, m1 + s2); in array()
42 m3 = m1; in array()
44 VERIFY_IS_APPROX(m3, m1 - s1); in array()
47 m3 = m1; in array()
48 …ArrayType::Map(m1.data(), m1.rows(), m1.cols()) -= ArrayType::Map(m2.data(), m2.rows(), m2.cols()); in array()
49 VERIFY_IS_APPROX(m1, m3 - m2); in array()
51 m3 = m1; in array()
52 …ArrayType::Map(m1.data(), m1.rows(), m1.cols()) += ArrayType::Map(m2.data(), m2.rows(), m2.cols()); in array()
53 VERIFY_IS_APPROX(m1, m3 + m2); in array()
55 m3 = m1; in array()
56 …ArrayType::Map(m1.data(), m1.rows(), m1.cols()) *= ArrayType::Map(m2.data(), m2.rows(), m2.cols()); in array()
57 VERIFY_IS_APPROX(m1, m3 * m2); in array()
59 m3 = m1; in array()
62 …ArrayType::Map(m1.data(), m1.rows(), m1.cols()) /= ArrayType::Map(m2.data(), m2.rows(), m2.cols())… in array()
63 VERIFY_IS_APPROX(m1, m3 / m2); in array()
66 VERIFY_IS_APPROX(m1.abs().colwise().sum().sum(), m1.abs().sum()); in array()
67 VERIFY_IS_APPROX(m1.abs().rowwise().sum().sum(), m1.abs().sum()); in array()
69 VERIFY_IS_MUCH_SMALLER_THAN(abs(m1.colwise().sum().sum() - m1.sum()), m1.abs().sum()); in array()
70 VERIFY_IS_MUCH_SMALLER_THAN(abs(m1.rowwise().sum().sum() - m1.sum()), m1.abs().sum()); in array()
71 …if (!internal::isMuchSmallerThan(abs(m1.sum() - (m1+m2).sum()), m1.abs().sum(), test_precision<Sca… in array()
72 VERIFY_IS_NOT_APPROX(((m1+m2).rowwise().sum()).sum(), m1.sum()); in array()
73 VERIFY_IS_APPROX(m1.colwise().sum(), m1.colwise().redux(internal::scalar_sum_op<Scalar>())); in array()
76 m3 = m1; in array()
77 VERIFY_IS_APPROX(m3.colwise() += cv1, m1.colwise() + cv1); in array()
78 m3 = m1; in array()
79 VERIFY_IS_APPROX(m3.colwise() -= cv1, m1.colwise() - cv1); in array()
80 m3 = m1; in array()
81 VERIFY_IS_APPROX(m3.rowwise() += rv1, m1.rowwise() + rv1); in array()
82 m3 = m1; in array()
83 VERIFY_IS_APPROX(m3.rowwise() -= rv1, m1.rowwise() - rv1); in array()
99 ArrayType m1 = ArrayType::Random(rows, cols), in comparisons() local
103 VERIFY(((m1 + Scalar(1)) > m1).all()); in comparisons()
104 VERIFY(((m1 - Scalar(1)) < m1).all()); in comparisons()
107 m3 = m1; in comparisons()
109 VERIFY(! (m1 < m3).all() ); in comparisons()
110 VERIFY(! (m1 > m3).all() ); in comparisons()
114 VERIFY( (m1 != (m1(r,c)+1) ).any() ); in comparisons()
115 VERIFY( (m1 > (m1(r,c)-1) ).any() ); in comparisons()
116 VERIFY( (m1 < (m1(r,c)+1) ).any() ); in comparisons()
117 VERIFY( (m1 == m1(r,c) ).any() ); in comparisons()
120 VERIFY_IS_APPROX( (m1<m2).select(m1,m2), m1.cwiseMin(m2) ); in comparisons()
121 VERIFY_IS_APPROX( (m1>m2).select(m1,m2), m1.cwiseMax(m2) ); in comparisons()
122 Scalar mid = (m1.cwiseAbs().minCoeff() + m1.cwiseAbs().maxCoeff())/Scalar(2); in comparisons()
125 m3(i,j) = abs(m1(i,j))<mid ? 0 : m1(i,j); in comparisons()
126 VERIFY_IS_APPROX( (m1.abs()<ArrayType::Constant(rows,cols,mid)) in comparisons()
127 .select(ArrayType::Zero(rows,cols),m1), m3); in comparisons()
129 VERIFY_IS_APPROX( (m1.abs()<ArrayType::Constant(rows,cols,mid)) in comparisons()
130 .select(0,m1), m3); in comparisons()
131 VERIFY_IS_APPROX( (m1.abs()>=ArrayType::Constant(rows,cols,mid)) in comparisons()
132 .select(m1,0), m3); in comparisons()
134 VERIFY_IS_APPROX( (m1.abs()<mid).select(0,m1), m3); in comparisons()
137 VERIFY(((m1.abs()+1)>RealScalar(0.1)).count() == rows*cols); in comparisons()
140 VERIFY( (m1<RealScalar(0) && m1>RealScalar(0)).count() == 0); in comparisons()
141 VERIFY( (m1<RealScalar(0) || m1>=RealScalar(0)).count() == rows*cols); in comparisons()
142 RealScalar a = m1.abs().mean(); in comparisons()
143 VERIFY( (m1<-a || m1>a).count() == (m1.abs()>a).count()); in comparisons()
148 …VERIFY_IS_APPROX(((m1.abs()+1)>RealScalar(0.1)).colwise().count(), ArrayOfIndices::Constant(cols,r… in comparisons()
149 …VERIFY_IS_APPROX(((m1.abs()+1)>RealScalar(0.1)).rowwise().count(), ArrayOfIndices::Constant(rows, … in comparisons()
163 ArrayType m1 = ArrayType::Random(rows, cols), in array_real() local
170 VERIFY_IS_APPROX(m1.sin(), sin(m1)); in array_real()
171 VERIFY_IS_APPROX(m1.cos(), cos(m1)); in array_real()
172 VERIFY_IS_APPROX(m1.asin(), asin(m1)); in array_real()
173 VERIFY_IS_APPROX(m1.acos(), acos(m1)); in array_real()
174 VERIFY_IS_APPROX(m1.tan(), tan(m1)); in array_real()
176 VERIFY_IS_APPROX(cos(m1+RealScalar(3)*m2), cos((m1+RealScalar(3)*m2).eval())); in array_real()
178 VERIFY_IS_APPROX(m1.abs().sqrt(), sqrt(abs(m1))); in array_real()
179 VERIFY_IS_APPROX(m1.abs(), sqrt(numext::abs2(m1))); in array_real()
181 …VERIFY_IS_APPROX(numext::abs2(numext::real(m1)) + numext::abs2(numext::imag(m1)), numext::abs2(m1)… in array_real()
182 VERIFY_IS_APPROX(numext::abs2(real(m1)) + numext::abs2(imag(m1)), numext::abs2(m1)); in array_real()
184 VERIFY_IS_APPROX(numext::real(m1), m1); in array_real()
188 VERIFY_IS_APPROX((m1.abs() + smallNumber).log() , log(abs(m1) + smallNumber)); in array_real()
190 VERIFY_IS_APPROX(m1.exp() * m2.exp(), exp(m1+m2)); in array_real()
191 VERIFY_IS_APPROX(m1.exp(), exp(m1)); in array_real()
192 VERIFY_IS_APPROX(m1.exp() / m2.exp(),(m1-m2).exp()); in array_real()
194 VERIFY_IS_APPROX(m1.pow(2), m1.square()); in array_real()
195 VERIFY_IS_APPROX(pow(m1,2), m1.square()); in array_real()
198 VERIFY_IS_APPROX(Eigen::pow(m1,exponents), m1.square()); in array_real()
200 m3 = m1.abs(); in array_real()
207 m1 += ArrayType::Constant(rows,cols,Scalar(tiny)); in array_real()
208 VERIFY_IS_APPROX(s1/m1, s1 * m1.inverse()); in array_real()
211 m3 = m1; in array_real()
213 VERIFY_IS_APPROX(m3,m1.transpose()); in array_real()
215 VERIFY_IS_APPROX(m3,m1); in array_real()
225 ArrayType m1 = ArrayType::Random(rows, cols), in array_complex() local
230 m2(i,j) = sqrt(m1(i,j)); in array_complex()
232 VERIFY_IS_APPROX(m1.sqrt(), m2); in array_complex()
233 VERIFY_IS_APPROX(m1.sqrt(), Eigen::sqrt(m1)); in array_complex()
244 ArrayType m1 = ArrayType::Random(rows, cols); in min_max() local
247 Scalar maxM1 = m1.maxCoeff(); in min_max()
248 Scalar minM1 = m1.minCoeff(); in min_max()
250 …VERIFY_IS_APPROX(ArrayType::Constant(rows,cols, minM1), (m1.min)(ArrayType::Constant(rows,cols, mi… in min_max()
251 VERIFY_IS_APPROX(m1, (m1.min)(ArrayType::Constant(rows,cols, maxM1))); in min_max()
253 …VERIFY_IS_APPROX(ArrayType::Constant(rows,cols, maxM1), (m1.max)(ArrayType::Constant(rows,cols, ma… in min_max()
254 VERIFY_IS_APPROX(m1, (m1.max)(ArrayType::Constant(rows,cols, minM1))); in min_max()
257 VERIFY_IS_APPROX(ArrayType::Constant(rows,cols, minM1), (m1.min)( minM1)); in min_max()
258 VERIFY_IS_APPROX(m1, (m1.min)( maxM1)); in min_max()
260 VERIFY_IS_APPROX(ArrayType::Constant(rows,cols, maxM1), (m1.max)( maxM1)); in min_max()
261 VERIFY_IS_APPROX(m1, (m1.max)( minM1)); in min_max()