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.
27 lines
503 B
C++
27 lines
503 B
C++
#include <iostream>
|
|
#include <tvmet/Vector.h>
|
|
#include <tvmet/Matrix.h>
|
|
|
|
using namespace std;
|
|
using namespace tvmet;
|
|
|
|
int main() {
|
|
// Matrix Vector stuff I
|
|
Vector<double,3> v1(1,2,3), v2(v1);
|
|
Vector<double,3> v3(0);
|
|
|
|
Matrix<double,3,3> m1, m2, m3;
|
|
m1 = 1,2,3,
|
|
4,5,6,
|
|
7,8,9;
|
|
m2 = trans(m1);
|
|
|
|
cout << "Xpr Level printing of "
|
|
<< m1 << "\n* " << v1 <<"\nresults into:\n";
|
|
cout << m1*v1 << endl;
|
|
cout << "The result =\n";
|
|
v3 = m1*v1;
|
|
cout << v3 << endl << endl;
|
|
|
|
}
|