10 #define EIGEN_NO_STATIC_ASSERT 27 m2 = MatrixType::Random(rows, cols),
29 mzero = MatrixType::Zero(rows, cols),
31 VectorType
v1 = VectorType::Random(rows),
32 vzero = VectorType::Zero(rows);
33 SquareMatrixType sm1 = SquareMatrixType::Random(rows,rows), sm2(rows,rows);
36 while(x ==
Scalar(0)) x = internal::random<Scalar>();
38 Index r = internal::random<Index>(0, rows-1),
39 c = internal::random<Index>(0, cols-1);
54 x =
v1(static_cast<char>(r1));
55 x =
v1(static_cast<signed char>(r1));
56 x =
v1(static_cast<unsigned char>(r1));
57 x =
v1(static_cast<signed short>(r1));
58 x =
v1(static_cast<unsigned short>(r1));
59 x =
v1(static_cast<signed int>(r1));
60 x =
v1(static_cast<unsigned int>(r1));
61 x =
v1(static_cast<signed long>(r1));
62 x =
v1(static_cast<unsigned long>(r1));
64 x =
v1(static_cast<long long int>(r1));
65 x =
v1(static_cast<unsigned long long int>(r1));
97 if(cols!=1 && rows!=1 && MatrixType::SizeAtCompileTime!=
Dynamic)
102 if(cols!=1 && rows!=1)
112 m3.real() = m1.real();
128 sm2.col(
i) = sm1.row(
i);
133 sm2.col(
i).noalias() = sm1.row(
i);
138 sm2.col(
i).noalias() += sm1.row(
i);
143 sm2.col(
i).noalias() -= sm1.row(
i);
148 bool b = internal::random<int>(0,10)>5;
170 Scalar s1 = internal::random<Scalar>(),
171 s2 = internal::random<Scalar>();
180 RealMatrixType rm1 = RealMatrixType::Random(rows,cols),
181 rm2 = RealMatrixType::Random(rows,cols);
194 VERIFY(static_cast<const MatrixType&>(cm).
real().isZero());
195 VERIFY(!static_cast<const MatrixType&>(cm).
imag().isZero());
198 template<
typename SrcScalar,
typename TgtScalar>
202 for (
int i=0;
i<m.
rows(); ++
i) {
203 for (
int j=0;
j<m.
cols(); ++
j) {
208 for (
int i=0;
i<m.
rows(); ++
i) {
209 for (
int j=0;
j<m.
cols(); ++
j) {
216 template<
typename SrcScalar,
typename EnableIf =
void>
239 template<
typename SrcScalar>
271 template <
typename Scalar>
275 for(
int k=0; k<4; ++k)
276 raw[k] = internal::random<Scalar>();
281 for(
int k=0; k<4; ++k)
VERIFY(
m(k) == raw[k]);
282 for(
int k=0; k<4; ++k)
VERIFY(
a(k) == raw[k]);
289 for(
int k=0; k<3; ++k)
VERIFY(
m(k) == raw[k]);
290 for(
int k=0; k<3; ++k)
VERIFY(
a(k) == raw[k]);
297 for(
int k=0; k<2; ++k)
VERIFY(
m(k) == raw[k]);
298 for(
int k=0; k<2; ++k)
VERIFY(
a(k) == raw[k]);
307 m3( (
int(raw[0])), (
int(raw[1])) ),
308 m4( (
float(raw[0])), (
float(raw[1])) );
310 for(
int k=0; k<2; ++k)
VERIFY(
m(k) == raw[k]);
311 for(
int k=0; k<2; ++k)
VERIFY(
a(k) == raw[k]);
316 for(
int k=0; k<2; ++k)
VERIFY(m3(k) ==
int(raw[k]));
317 for(
int k=0; k<2; ++k)
VERIFY((m4(k)) ==
Scalar(
float(raw[k])));
328 VERIFY(m3(0) ==
int(raw[0]));
#define VERIFY_RAISES_ASSERT(a)
#define CALL_SUBTEST_6(FUNC)
#define CALL_SUBTEST_4(FUNC)
EIGEN_DEVICE_FUNC internal::add_const_on_value_type< EIGEN_MATHFUNC_RETVAL(real_ref, Scalar) >::type real_ref(const Scalar &x)
static const Eigen::internal::all_t all
void fixedSizeMatrixConstruction()
#define CALL_SUBTEST_3(FUNC)
#define CALL_SUBTEST_7(FUNC)
Holds information about the various numeric (i.e. scalar) types allowed by Eigen. ...
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
#define VERIFY_IS_NOT_MUCH_SMALLER_THAN(a, b)
#define VERIFY_IS_APPROX(a, b)
EIGEN_DEVICE_FUNC const SquareReturnType square() const
#define VERIFY_IS_EQUAL(a, b)
#define CALL_SUBTEST_1(FUNC)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
#define CALL_SUBTEST_8(FUNC)
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
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T mini(const T &x, const T &y)
#define VERIFY_IS_MUCH_SMALLER_THAN(a, b)
EIGEN_DEFAULT_DENSE_INDEX_TYPE DenseIndex
#define CALL_SUBTEST_5(FUNC)
#define EIGEN_TEST_MAX_SIZE
EIGEN_DECLARE_TEST(basicstuff)
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)
#define CALL_SUBTEST_2(FUNC)
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 EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT