| 214 | |
| 215 | template<typename MatrixType> |
| 216 | void testMatrixType(const MatrixType& m) |
| 217 | { |
| 218 | using std::abs; |
| 219 | const Index rows = m.rows(); |
| 220 | const Index cols = m.cols(); |
| 221 | typedef typename MatrixType::Scalar Scalar; |
| 222 | typedef typename MatrixType::RealScalar RealScalar; |
| 223 | |
| 224 | Scalar s1; |
| 225 | do { |
| 226 | s1 = internal::random<Scalar>(); |
| 227 | } while(abs(s1)<RealScalar(1e-5) && (!NumTraits<Scalar>::IsInteger)); |
| 228 | |
| 229 | MatrixType A; |
| 230 | A.setIdentity(rows, cols); |
| 231 | VERIFY(equalsIdentity(A)); |
| 232 | VERIFY(equalsIdentity(MatrixType::Identity(rows, cols))); |
| 233 | |
| 234 | |
| 235 | A = MatrixType::Constant(rows,cols,s1); |
| 236 | Index i = internal::random<Index>(0,rows-1); |
| 237 | Index j = internal::random<Index>(0,cols-1); |
| 238 | VERIFY_IS_APPROX( MatrixType::Constant(rows,cols,s1)(i,j), s1 ); |
| 239 | VERIFY_IS_APPROX( MatrixType::Constant(rows,cols,s1).coeff(i,j), s1 ); |
| 240 | VERIFY_IS_APPROX( A(i,j), s1 ); |
| 241 | } |
| 242 | |
| 243 | template<int> |
| 244 | void bug79() |
no test coverage detected