Home | History | Annotate | Download | only in eigen2

Lines Matching full:scalar

17 template<typename Scalar> struct AddIfNull {
18 const Scalar operator() (const Scalar a, const Scalar b) const {return a<=1e-3 ? b : a;}
19 enum { Cost = NumTraits<Scalar>::AddCost };
24 typedef typename MatrixType::Scalar Scalar;
25 typedef typename NumTraits<Scalar>::Real RealScalar;
26 typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> VectorType;
37 identity = Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime>
39 square = Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime>::Random(rows, rows);
49 Scalar s1 = ei_random<Scalar>();
56 VERIFY_IS_APPROX(mzero(i,j), Scalar(0));
57 VERIFY_IS_APPROX(mones(i,j), Scalar(1));
77 m2 = m2.template binaryExpr<AddIfNull<Scalar> >(mones);
83 VERIFY_IS_APPROX(m1 + mones, m1.cwise()+Scalar(1));
84 VERIFY_IS_APPROX(m1 - mones, m1.cwise()-Scalar(1));
97 if(NumTraits<Scalar>::HasFloatingPoint)
143 VERIFY( (m1.cwise()<m1.unaryExpr(bind2nd(plus<Scalar>(), Scalar(1)))).all() );
144 VERIFY( !(m1.cwise()<m1.unaryExpr(bind2nd(minus<Scalar>(), Scalar(1)))).all() );
145 VERIFY( !(m1.cwise()>m1.unaryExpr(bind2nd(plus<Scalar>(), Scalar(1)))).any() );