12 #include <Eigen/CXX11/Tensor> 22 vec1(0) = 4.0; vec2(0) = 0.0;
23 vec1(1) = 8.0; vec2(1) = 1.0;
24 vec1(2) = 15.0; vec2(2) = 2.0;
25 vec1(3) = 16.0; vec2(3) = 3.0;
26 vec1(4) = 23.0; vec2(4) = 4.0;
27 vec1(5) = 42.0; vec2(5) = 5.0;
116 for (
int i = 0;
i < 2; ++
i) {
117 for (
int j = 0;
j < 3; ++
j) {
118 for (
int k = 0; k < 7; ++k) {
131 mat5 = mat1.inverse().log();
133 mat6 = mat2.pow(0.5
f) * 3.14f;
135 mat7 = mat1.cwiseMax(mat5 * 2.0
f).exp();
137 mat8 = (-mat2).
exp() * 3.14f;
141 mat10 = mat2 - 3.14f;
143 mat11 = mat2 / 3.14f;
146 for (
int i = 0;
i < 2; ++
i) {
147 for (
int j = 0;
j < 3; ++
j) {
148 for (
int k = 0; k < 7; ++k) {
171 for (
int i = 0;
i < 2; ++
i) {
172 for (
int j = 0;
j < 3; ++
j) {
173 for (
int k = 0; k < 7; ++k) {
179 mat2 = mat1.constant(3.14
f);
180 mat3 = mat1.cwiseMax(7.3
f).exp();
183 for (
int i = 0;
i < 2; ++
i) {
184 for (
int j = 0;
j < 3; ++
j) {
185 for (
int k = 0; k < 7; ++k) {
197 std::copy_n(std::begin({0, 1, 2, 3, 4, 5}), 6, vec.
data());
200 Tensor<bool, 1> bool1 = vec < vec.constant(1) || vec > vec.constant(4);
222 bool3 = vec < vec.constant(4) && bool2;
232 for (
int i = 0;
i < 2; ++
i) {
233 for (
int j = 0;
j < 3; ++
j) {
234 for (
int k = 0; k < 7; ++k) {
240 mat2 = mat1.inverse().unaryExpr(&asinf);
241 mat3 = mat1.unaryExpr(&tanhf);
244 for (
int i = 0;
i < 2; ++
i) {
245 for (
int j = 0;
j < 3; ++
j) {
246 for (
int k = 0; k < 7; ++k) {
263 mat3 = mat1.cast<
double>();
264 for (
int i = 0;
i < 2; ++
i) {
265 for (
int j = 0;
j < 3; ++
j) {
266 for (
int k = 0; k < 7; ++k) {
272 mat3 = mat2.cast<
double>();
273 for (
int i = 0;
i < 2; ++
i) {
274 for (
int j = 0;
j < 3; ++
j) {
275 for (
int k = 0; k < 7; ++k) {
292 result = (selector > selector.constant(0.5
f)).select(mat1, mat2);
294 for (
int i = 0;
i < 2; ++
i) {
295 for (
int j = 0;
j < 3; ++
j) {
296 for (
int k = 0; k < 7; ++k) {
static void test_type_casting()
static void test_functors()
EIGEN_DEVICE_FUNC const ExpReturnType exp() const
static void test_select()
void test_cxx11_tensor_expr()
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Tensor< Scalar_, NumIndices_, Options_, IndexType_ > & setRandom()
MatrixXd mat1(size, size)
#define VERIFY_IS_APPROX(a, b)
static void test_constants()
#define VERIFY_IS_EQUAL(a, b)
A tensor expression mapping an existing array of data.
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
static SO4::VectorN2 vec4(const Matrix4 &Q)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar * data()
#define CALL_SUBTEST(FUNC)
static Vector9 vec3(const Matrix3 &R)
static void test_boolean()