19 #include <tests/myratest.h> 23 #ifdef MYRAMATH_ENABLE_CPP11 25 ADD_TEST(
"expr_transpose",
"[expression]")
27 auto E1 = expr({1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0});
29 auto E3 = transpose( reshape(E2,3,3) );
30 std::complex<double> j(0,1);
31 REQUIRE( E3.evaluate({0,0}) == 1.0 + j*1.0);
32 REQUIRE( E3.evaluate({0,1}) == 2.0 + j*2.0 );
33 REQUIRE( E3.evaluate({0,2}) == 3.0 + j*3.0 );
34 REQUIRE( E3.evaluate({1,0}) == 4.0 + j*4.0 );
35 REQUIRE( E3.evaluate({1,1}) == 5.0 + j*5.0 );
36 REQUIRE( E3.evaluate({1,2}) == 6.0 + j*6.0 );
37 REQUIRE( E3.evaluate({2,0}) == 7.0 + j*7.0 );
38 REQUIRE( E3.evaluate({2,1}) == 8.0 + j*8.0 );
39 REQUIRE( E3.evaluate({2,2}) == 9.0 + j*9.0 );
Reshapes an Expression (for instance, reinterpret an arity-1 Expression of size 25 into an arity-2 Ex...
Overloads expr() for std::vector<Number> and (C++11 only) std::initializer_list<Number> ...
An interface used to fill containers from Expression's (see Matrix::evaluate(), for example)...
Returns the transpose of an arity-2 Expression.
Function overloads (sin, exp, etc) for Expression's.
Expression< 1, NumberC > make_complex(const Expression< 1, NumberS > &A)
Promotes a real Expression into a complex one.
Definition: functions_complex.cpp:122