Lines Matching refs:m1
23 ArrayType m1 = ArrayType::Random(rows, cols), in array() local
34 VERIFY_IS_APPROX(m1 + s1, s1 + m1); in array()
35 VERIFY_IS_APPROX(m1 + s1, ArrayType::Constant(rows,cols,s1) + m1); in array()
36 VERIFY_IS_APPROX(s1 - m1, (-m1)+s1 ); in array()
37 VERIFY_IS_APPROX(m1 - s1, m1 - ArrayType::Constant(rows,cols,s1)); in array()
38 VERIFY_IS_APPROX(s1 - m1, ArrayType::Constant(rows,cols,s1) - m1); in array()
39 VERIFY_IS_APPROX((m1*Scalar(2)) - s2, (m1+m1) - ArrayType::Constant(rows,cols,s2) ); in array()
40 m3 = m1; in array()
42 VERIFY_IS_APPROX(m3, m1 + s2); in array()
43 m3 = m1; in array()
45 VERIFY_IS_APPROX(m3, m1 - s1); in array()
48 m3 = m1; in array()
49 …ArrayType::Map(m1.data(), m1.rows(), m1.cols()) -= ArrayType::Map(m2.data(), m2.rows(), m2.cols()); in array()
50 VERIFY_IS_APPROX(m1, m3 - m2); in array()
52 m3 = m1; in array()
53 …ArrayType::Map(m1.data(), m1.rows(), m1.cols()) += ArrayType::Map(m2.data(), m2.rows(), m2.cols()); in array()
54 VERIFY_IS_APPROX(m1, m3 + m2); in array()
56 m3 = m1; in array()
57 …ArrayType::Map(m1.data(), m1.rows(), m1.cols()) *= ArrayType::Map(m2.data(), m2.rows(), m2.cols()); in array()
58 VERIFY_IS_APPROX(m1, m3 * m2); in array()
60 m3 = m1; in array()
63 …ArrayType::Map(m1.data(), m1.rows(), m1.cols()) /= ArrayType::Map(m2.data(), m2.rows(), m2.cols())… in array()
64 VERIFY_IS_APPROX(m1, m3 / m2); in array()
67 VERIFY_IS_APPROX(m1.colwise().sum().sum(), m1.sum()); in array()
68 VERIFY_IS_APPROX(m1.rowwise().sum().sum(), m1.sum()); in array()
69 if (!internal::isApprox(m1.sum(), (m1+m2).sum(), test_precision<Scalar>())) in array()
70 VERIFY_IS_NOT_APPROX(((m1+m2).rowwise().sum()).sum(), m1.sum()); in array()
71 VERIFY_IS_APPROX(m1.colwise().sum(), m1.colwise().redux(internal::scalar_sum_op<Scalar>())); in array()
74 m3 = m1; in array()
75 VERIFY_IS_APPROX(m3.colwise() += cv1, m1.colwise() + cv1); 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.rowwise() += rv1, m1.rowwise() + rv1); in array()
80 m3 = m1; in array()
81 VERIFY_IS_APPROX(m3.rowwise() -= rv1, m1.rowwise() - rv1); in array()
97 ArrayType m1 = ArrayType::Random(rows, cols), in comparisons() local
101 VERIFY(((m1 + Scalar(1)) > m1).all()); in comparisons()
102 VERIFY(((m1 - Scalar(1)) < m1).all()); in comparisons()
105 m3 = m1; in comparisons()
107 VERIFY(! (m1 < m3).all() ); in comparisons()
108 VERIFY(! (m1 > m3).all() ); in comparisons()
112 VERIFY( (m1 != (m1(r,c)+1) ).any() ); in comparisons()
113 VERIFY( (m1 > (m1(r,c)-1) ).any() ); in comparisons()
114 VERIFY( (m1 < (m1(r,c)+1) ).any() ); in comparisons()
115 VERIFY( (m1 == m1(r,c) ).any() ); in comparisons()
118 VERIFY_IS_APPROX( (m1<m2).select(m1,m2), m1.cwiseMin(m2) ); in comparisons()
119 VERIFY_IS_APPROX( (m1>m2).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) = internal::abs(m1(i,j))<mid ? 0 : m1(i,j); in comparisons()
124 VERIFY_IS_APPROX( (m1.abs()<ArrayType::Constant(rows,cols,mid)) in comparisons()
125 .select(ArrayType::Zero(rows,cols),m1), m3); in comparisons()
127 VERIFY_IS_APPROX( (m1.abs()<ArrayType::Constant(rows,cols,mid)) in comparisons()
128 .select(0,m1), m3); in comparisons()
129 VERIFY_IS_APPROX( (m1.abs()>=ArrayType::Constant(rows,cols,mid)) in comparisons()
130 .select(m1,0), m3); in comparisons()
132 VERIFY_IS_APPROX( (m1.abs()<mid).select(0,m1), m3); in comparisons()
135 VERIFY(((m1.abs()+1)>RealScalar(0.1)).count() == rows*cols); in comparisons()
138 VERIFY( (m1<RealScalar(0) && m1>RealScalar(0)).count() == 0); in comparisons()
139 VERIFY( (m1<RealScalar(0) || m1>=RealScalar(0)).count() == rows*cols); in comparisons()
140 RealScalar a = m1.abs().mean(); in comparisons()
141 VERIFY( (m1<-a || m1>a).count() == (m1.abs()>a).count()); in comparisons()
146 …VERIFY_IS_APPROX(((m1.abs()+1)>RealScalar(0.1)).colwise().count(), ArrayOfIndices::Constant(cols,r… in comparisons()
147 …VERIFY_IS_APPROX(((m1.abs()+1)>RealScalar(0.1)).rowwise().count(), ArrayOfIndices::Constant(rows, … in comparisons()
159 ArrayType m1 = ArrayType::Random(rows, cols), in array_real() local
166 VERIFY_IS_APPROX(m1.sin(), std::sin(m1)); in array_real()
167 VERIFY_IS_APPROX(m1.sin(), internal::sin(m1)); in array_real()
168 VERIFY_IS_APPROX(m1.cos(), std::cos(m1)); in array_real()
169 VERIFY_IS_APPROX(m1.cos(), internal::cos(m1)); in array_real()
170 VERIFY_IS_APPROX(m1.asin(), std::asin(m1)); in array_real()
171 VERIFY_IS_APPROX(m1.asin(), internal::asin(m1)); in array_real()
172 VERIFY_IS_APPROX(m1.acos(), std::acos(m1)); in array_real()
173 VERIFY_IS_APPROX(m1.acos(), internal::acos(m1)); in array_real()
174 VERIFY_IS_APPROX(m1.tan(), std::tan(m1)); in array_real()
175 VERIFY_IS_APPROX(m1.tan(), internal::tan(m1)); in array_real()
177 VERIFY_IS_APPROX(internal::cos(m1+RealScalar(3)*m2), internal::cos((m1+RealScalar(3)*m2).eval())); in array_real()
178 VERIFY_IS_APPROX(std::cos(m1+RealScalar(3)*m2), std::cos((m1+RealScalar(3)*m2).eval())); in array_real()
180 VERIFY_IS_APPROX(m1.abs().sqrt(), std::sqrt(std::abs(m1))); in array_real()
181 VERIFY_IS_APPROX(m1.abs().sqrt(), internal::sqrt(internal::abs(m1))); in array_real()
182 VERIFY_IS_APPROX(m1.abs(), internal::sqrt(internal::abs2(m1))); in array_real()
184 …ERIFY_IS_APPROX(internal::abs2(internal::real(m1)) + internal::abs2(internal::imag(m1)), internal:… in array_real()
185 …VERIFY_IS_APPROX(internal::abs2(std::real(m1)) + internal::abs2(std::imag(m1)), internal::abs2(m1)… in array_real()
187 VERIFY_IS_APPROX(internal::real(m1), m1); in array_real()
189 VERIFY_IS_APPROX(m1.abs().log(), std::log(std::abs(m1))); in array_real()
190 VERIFY_IS_APPROX(m1.abs().log(), internal::log(internal::abs(m1))); in array_real()
192 VERIFY_IS_APPROX(m1.exp(), std::exp(m1)); in array_real()
193 VERIFY_IS_APPROX(m1.exp() * m2.exp(), std::exp(m1+m2)); in array_real()
194 VERIFY_IS_APPROX(m1.exp(), internal::exp(m1)); in array_real()
195 VERIFY_IS_APPROX(m1.exp() / m2.exp(), std::exp(m1-m2)); in array_real()
197 VERIFY_IS_APPROX(m1.pow(2), m1.square()); in array_real()
198 VERIFY_IS_APPROX(std::pow(m1,2), m1.square()); in array_real()
201 VERIFY_IS_APPROX(std::pow(m1,exponents), m1.square()); in array_real()
203 m3 = m1.abs(); in array_real()
210 m1 += ArrayType::Constant(rows,cols,Scalar(tiny)); in array_real()
211 VERIFY_IS_APPROX(s1/m1, s1 * m1.inverse()); in array_real()
221 ArrayType m1 = ArrayType::Random(rows, cols), in array_complex() local
226 m2(i,j) = std::sqrt(m1(i,j)); in array_complex()
228 VERIFY_IS_APPROX(m1.sqrt(), m2); in array_complex()
229 VERIFY_IS_APPROX(m1.sqrt(), std::sqrt(m1)); in array_complex()
230 VERIFY_IS_APPROX(m1.sqrt(), internal::sqrt(m1)); in array_complex()
241 ArrayType m1 = ArrayType::Random(rows, cols); in min_max() local
244 Scalar maxM1 = m1.maxCoeff(); in min_max()
245 Scalar minM1 = m1.minCoeff(); in min_max()
247 …VERIFY_IS_APPROX(ArrayType::Constant(rows,cols, minM1), (m1.min)(ArrayType::Constant(rows,cols, mi… in min_max()
248 VERIFY_IS_APPROX(m1, (m1.min)(ArrayType::Constant(rows,cols, maxM1))); in min_max()
250 …VERIFY_IS_APPROX(ArrayType::Constant(rows,cols, maxM1), (m1.max)(ArrayType::Constant(rows,cols, ma… in min_max()
251 VERIFY_IS_APPROX(m1, (m1.max)(ArrayType::Constant(rows,cols, minM1))); in min_max()
254 VERIFY_IS_APPROX(ArrayType::Constant(rows,cols, minM1), (m1.min)( minM1)); in min_max()
255 VERIFY_IS_APPROX(m1, (m1.min)( maxM1)); in min_max()
257 VERIFY_IS_APPROX(ArrayType::Constant(rows,cols, maxM1), (m1.max)( maxM1)); in min_max()
258 VERIFY_IS_APPROX(m1, (m1.max)( minM1)); in min_max()