Lines Matching full: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()
112 VERIFY(!(m1 > m2 && m1 < m2).any()); in comparisons()
113 VERIFY((m1 <= m2 || m1 >= m2).all()); in comparisons()
116 VERIFY( (m1 != (m1(r,c)+1) ).any() ); in comparisons()
117 VERIFY( (m1 > (m1(r,c)-1) ).any() ); in comparisons()
118 VERIFY( (m1 < (m1(r,c)+1) ).any() ); in comparisons()
119 VERIFY( (m1 == m1(r,c) ).any() ); in comparisons()
122 VERIFY_IS_APPROX( (m1<m2).select(m1,m2), m1.cwiseMin(m2) ); in comparisons()
123 VERIFY_IS_APPROX( (m1>m2).select(m1,m2), m1.cwiseMax(m2) ); in comparisons()
124 Scalar mid = (m1.cwiseAbs().minCoeff() + m1.cwiseAbs().maxCoeff())/Scalar(2); in comparisons()
127 m3(i,j) = abs(m1(i,j))<mid ? 0 : m1(i,j); in comparisons()
128 VERIFY_IS_APPROX( (m1.abs()<ArrayType::Constant(rows,cols,mid)) in comparisons()
129 .select(ArrayType::Zero(rows,cols),m1), m3); in comparisons()
131 VERIFY_IS_APPROX( (m1.abs()<ArrayType::Constant(rows,cols,mid)) in comparisons()
132 .select(0,m1), m3); in comparisons()
133 VERIFY_IS_APPROX( (m1.abs()>=ArrayType::Constant(rows,cols,mid)) in comparisons()
134 .select(m1,0), m3); in comparisons()
136 VERIFY_IS_APPROX( (m1.abs()<mid).select(0,m1), m3); in comparisons()
139 VERIFY(((m1.abs()+1)>RealScalar(0.1)).count() == rows*cols); in comparisons()
142 VERIFY( (m1<RealScalar(0) && m1>RealScalar(0)).count() == 0); in comparisons()
143 VERIFY( (m1<RealScalar(0) || m1>=RealScalar(0)).count() == rows*cols); in comparisons()
144 RealScalar a = m1.abs().mean(); in comparisons()
145 VERIFY( (m1<-a || m1>a).count() == (m1.abs()>a).count()); in comparisons()
150 …VERIFY_IS_APPROX(((m1.abs()+1)>RealScalar(0.1)).colwise().count(), ArrayOfIndices::Constant(cols,r… in comparisons()
151 …VERIFY_IS_APPROX(((m1.abs()+1)>RealScalar(0.1)).rowwise().count(), ArrayOfIndices::Constant(rows, … in comparisons()
165 ArrayType m1 = ArrayType::Random(rows, cols), in array_real() local
172 VERIFY_IS_APPROX(m1.sin(), sin(m1)); in array_real()
173 VERIFY_IS_APPROX(m1.cos(), cos(m1)); in array_real()
174 VERIFY_IS_APPROX(m1.asin(), asin(m1)); in array_real()
175 VERIFY_IS_APPROX(m1.acos(), acos(m1)); in array_real()
176 VERIFY_IS_APPROX(m1.tan(), tan(m1)); in array_real()
178 VERIFY_IS_APPROX(cos(m1+RealScalar(3)*m2), cos((m1+RealScalar(3)*m2).eval())); in array_real()
180 VERIFY_IS_APPROX(m1.abs().sqrt(), sqrt(abs(m1))); in array_real()
181 VERIFY_IS_APPROX(m1.abs(), sqrt(numext::abs2(m1))); in array_real()
183 …VERIFY_IS_APPROX(numext::abs2(numext::real(m1)) + numext::abs2(numext::imag(m1)), numext::abs2(m1)… in array_real()
184 VERIFY_IS_APPROX(numext::abs2(real(m1)) + numext::abs2(imag(m1)), numext::abs2(m1)); in array_real()
186 VERIFY_IS_APPROX(numext::real(m1), m1); in array_real()
190 VERIFY_IS_APPROX((m1.abs() + smallNumber).log() , log(abs(m1) + smallNumber)); in array_real()
192 VERIFY_IS_APPROX(m1.exp() * m2.exp(), exp(m1+m2)); in array_real()
193 VERIFY_IS_APPROX(m1.exp(), exp(m1)); in array_real()
194 VERIFY_IS_APPROX(m1.exp() / m2.exp(),(m1-m2).exp()); in array_real()
196 VERIFY_IS_APPROX(m1.pow(2), m1.square()); in array_real()
197 VERIFY_IS_APPROX(pow(m1,2), m1.square()); in array_real()
200 VERIFY_IS_APPROX(Eigen::pow(m1,exponents), m1.square()); in array_real()
202 m3 = m1.abs(); in array_real()
209 m1 += ArrayType::Constant(rows,cols,Scalar(tiny)); in array_real()
210 VERIFY_IS_APPROX(s1/m1, s1 * m1.inverse()); in array_real()
213 m3 = m1; in array_real()
215 VERIFY_IS_APPROX(m3,m1.transpose()); in array_real()
217 VERIFY_IS_APPROX(m3,m1); in array_real()
227 ArrayType m1 = ArrayType::Random(rows, cols), in array_complex() local
232 m2(i,j) = sqrt(m1(i,j)); in array_complex()
234 VERIFY_IS_APPROX(m1.sqrt(), m2); in array_complex()
235 VERIFY_IS_APPROX(m1.sqrt(), Eigen::sqrt(m1)); in array_complex()
246 ArrayType m1 = ArrayType::Random(rows, cols); in min_max() local
249 Scalar maxM1 = m1.maxCoeff(); in min_max()
250 Scalar minM1 = m1.minCoeff(); in min_max()
252 …VERIFY_IS_APPROX(ArrayType::Constant(rows,cols, minM1), (m1.min)(ArrayType::Constant(rows,cols, mi… in min_max()
253 VERIFY_IS_APPROX(m1, (m1.min)(ArrayType::Constant(rows,cols, maxM1))); in min_max()
255 …VERIFY_IS_APPROX(ArrayType::Constant(rows,cols, maxM1), (m1.max)(ArrayType::Constant(rows,cols, ma… in min_max()
256 VERIFY_IS_APPROX(m1, (m1.max)(ArrayType::Constant(rows,cols, minM1))); in min_max()
259 VERIFY_IS_APPROX(ArrayType::Constant(rows,cols, minM1), (m1.min)( minM1)); in min_max()
260 VERIFY_IS_APPROX(m1, (m1.min)( maxM1)); in min_max()
262 VERIFY_IS_APPROX(ArrayType::Constant(rows,cols, maxM1), (m1.max)( maxM1)); in min_max()
263 VERIFY_IS_APPROX(m1, (m1.max)( minM1)); in min_max()