10 #define EIGEN_NO_STATIC_ASSERT 26 m2 = MatrixType::Random(rows, cols),
28 mzero = MatrixType::Zero(rows, cols),
30 VectorType
v1 = VectorType::Random(rows),
31 vzero = VectorType::Zero(rows);
32 SquareMatrixType sm1 = SquareMatrixType::Random(rows,rows), sm2(rows,rows);
35 while(x ==
Scalar(0)) x = internal::random<Scalar>();
37 Index r = internal::random<Index>(0, rows-1),
38 c = internal::random<Index>(0, cols-1);
80 if(cols!=1 && rows!=1 && MatrixType::SizeAtCompileTime!=
Dynamic)
85 if(cols!=1 && rows!=1)
95 m3.real() = m1.real();
111 sm2.col(
i) = sm1.row(
i);
116 sm2.col(
i).noalias() = sm1.row(
i);
121 sm2.col(
i).noalias() += sm1.row(
i);
126 sm2.col(
i).noalias() -= sm1.row(
i);
131 bool b = internal::random<int>(0,10)>5;
153 Scalar s1 = internal::random<Scalar>(),
154 s2 = internal::random<Scalar>();
163 RealMatrixType rm1 = RealMatrixType::Random(rows,cols),
164 rm2 = RealMatrixType::Random(rows,cols);
177 VERIFY(static_cast<const MatrixType&>(cm).
real().isZero());
178 VERIFY(!static_cast<const MatrixType&>(cm).
imag().isZero());
181 #ifdef EIGEN_TEST_PART_2 184 Matrix4f
m = Matrix4f::Random(),
m2;
185 Matrix4d
n = m.cast<
double>();
186 VERIFY(m.isApprox(n.cast<
float>()));
187 m2 = m.cast<
float>();
192 template <
typename Scalar>
196 for(
int k=0; k<4; ++k)
197 raw[k] = internal::random<Scalar>();
202 for(
int k=0; k<4; ++k)
VERIFY(
m(k) == raw[k]);
203 for(
int k=0; k<4; ++k)
VERIFY(
a(k) == raw[k]);
210 for(
int k=0; k<3; ++k)
VERIFY(
m(k) == raw[k]);
211 for(
int k=0; k<3; ++k)
VERIFY(
a(k) == raw[k]);
218 for(
int k=0; k<2; ++k)
VERIFY(
m(k) == raw[k]);
219 for(
int k=0; k<2; ++k)
VERIFY(
a(k) == raw[k]);
228 m3( (
int(raw[0])), (
int(raw[1])) ),
229 m4( (
float(raw[0])), (
float(raw[1])) );
231 for(
int k=0; k<2; ++k)
VERIFY(
m(k) == raw[k]);
232 for(
int k=0; k<2; ++k)
VERIFY(
a(k) == raw[k]);
237 for(
int k=0; k<2; ++k)
VERIFY(m3(k) ==
int(raw[k]));
238 for(
int k=0; k<2; ++k)
VERIFY((m4(k)) ==
Scalar(
float(raw[k])));
249 VERIFY(m3(0) ==
int(raw[0]));
270 CALL_SUBTEST_1(fixedSizeMatrixConstruction<unsigned char>());
271 CALL_SUBTEST_1(fixedSizeMatrixConstruction<float>());
272 CALL_SUBTEST_1(fixedSizeMatrixConstruction<double>());
273 CALL_SUBTEST_1(fixedSizeMatrixConstruction<int>());
274 CALL_SUBTEST_1(fixedSizeMatrixConstruction<long int>());
275 CALL_SUBTEST_1(fixedSizeMatrixConstruction<std::ptrdiff_t>());
277 CALL_SUBTEST_2(casting());
#define VERIFY_RAISES_ASSERT(a)
EIGEN_DEVICE_FUNC internal::add_const_on_value_type< EIGEN_MATHFUNC_RETVAL(real_ref, Scalar) >::type real_ref(const Scalar &x)
void fixedSizeMatrixConstruction()
Holds information about the various numeric (i.e. scalar) types allowed by Eigen. ...
#define VERIFY_IS_NOT_MUCH_SMALLER_THAN(a, b)
#define VERIFY_IS_APPROX(a, b)
#define VERIFY_IS_EQUAL(a, b)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
EIGEN_DEVICE_FUNC internal::add_const_on_value_type< EIGEN_MATHFUNC_RETVAL(imag_ref, Scalar) >::type imag_ref(const Scalar &x)
void basicStuff(const MatrixType &m)
NumTraits< Scalar >::Real RealScalar
#define VERIFY_IS_MUCH_SMALLER_THAN(a, b)
EIGEN_DEFAULT_DENSE_INDEX_TYPE DenseIndex
#define EIGEN_TEST_MAX_SIZE
General-purpose arrays with easy API for coefficient-wise operations.
void basicStuffComplex(const MatrixType &m)
EIGEN_DEVICE_FUNC const ImagReturnType imag() const
#define VERIFY_IS_NOT_APPROX(a, b)
The matrix class, also used for vectors and row-vectors.
EIGEN_DEVICE_FUNC bool isApprox(const Scalar &x, const Scalar &y, const typename NumTraits< Scalar >::Real &precision=NumTraits< Scalar >::dummy_precision())
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
EIGEN_DEVICE_FUNC const SquareReturnType square() const