eigen/tvmet-1.7.1/examples/cmv.cc
Benoit Jacob 3036eeca0a Starting Eigen 2 development. The current plan is to use the last
release of tvmet (inactive for 2 years and developer unreachable) as the
basis for eigen2, because it provides seemingly good expression template
mechanisms, we want that, and it would take years to reinvent that
wheel. We'll see. So this commit imports the last tvmet release.
2007-05-30 06:24:51 +00:00

37 lines
640 B
C++

#include <iostream>
#include <complex>
#include <tvmet/Matrix.h>
#include <tvmet/Vector.h>
using namespace tvmet;
using std::cout;
using std::endl;
typedef Vector<std::complex<double>,3> vector3d;
typedef Matrix<std::complex<double>,3,3> matrix33d;
#if (defined __ICC )
#pragma warning(disable:1418) // external definition with no prior declaration
#endif
void testMV(vector3d& res, const matrix33d& m, const vector3d& v) {
res = m * v;
}
int main()
{
vector3d v1, vr;
matrix33d m1;
v1 = 1,2,3;
m1 = 1,4,7,
2,5,8,
3,6,9;
testMV(vr, m1, v1);
cout << m1 << " * " << v1 << " =\n";
cout << vr << endl;
}