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.
37 lines
734 B
C++
37 lines
734 B
C++
#include <iostream>
|
|
#include <iomanip>
|
|
#include <algorithm>
|
|
|
|
#include <cstdlib>
|
|
|
|
#include <tvmet/Matrix.h>
|
|
#include <tvmet/Vector.h>
|
|
|
|
using namespace std;
|
|
using namespace tvmet;
|
|
|
|
typedef Vector<double,3> vector3d;
|
|
typedef Matrix<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;
|
|
|
|
std::generate(v1.begin(), v1.end(), std::rand);
|
|
std::generate(m1.begin(), m1.end(), std::rand);
|
|
|
|
testMV(vr, m1, v1);
|
|
|
|
cout << std::setw(12) << m1 << " * " << std::setw(12) << v1 << " =\n";
|
|
cout << std::setw(12) << vr << endl;
|
|
}
|