aboutsummaryrefslogtreecommitdiffhomepage
path: root/tvmet-1.7.1/examples/hspiess.cc
blob: 129c4f0c0e6b697b8942e5025afb65970556bf3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include <iostream>

#include <tvmet/Matrix.h>

using namespace std;

int main()
{
  tvmet::Matrix<double,3,2>	B;
  tvmet::Matrix<double,3,3>	D;

  B =
   -0.05,  0,
    0,     0.05,
    0.05, -0.05;
  D =
    2000, 1000, 0,
    1000, 2000, 0,
    0,    0,    500;

  cout << "B = " << B << endl;
  cout << "D = " << D << endl;

  {
    tvmet::Matrix<double,2,2>	K;

    K = trans(B) * D * B;
    cout << "K = " << K << endl;
  }

  {
    tvmet::Matrix<double,2,2>	K;

    K = tvmet::Matrix<double,2,3>(trans(B) * D) * B;
    cout << "K = " << K << endl;
  }
}