-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtester.cpp
More file actions
43 lines (34 loc) · 762 Bytes
/
tester.cpp
File metadata and controls
43 lines (34 loc) · 762 Bytes
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
38
39
40
41
42
43
#include "ode45.h"
using namespace Eigen;
//struct parameters {
// double m;
// double len;
//} params;
VectorXF f1(double t, VectorXF y, PARAMS_PTR p)
{
VectorXF v(4);
v(0) = t;
v(1) = y(0);
v(2) = y(1);
v(3) = p->m;
return v;
}
int main()
{
ode45 integrator;
VectorXF v = VectorXF::Zero(4);
v(0)=7.0;
v(1)=8.5;
PARAMS params;
PARAMS * p = ¶ms;
p->m=1.05;
integrator.init(0.2, 2.0, v, f1, p);
Vector3d v3(1, -2, -3);
Vector3d vv(-1, 4, 1);
cout<<v3.array().abs()<<endl<<endl;
cout<<v3.array().abs().max(vv.array())<<endl<<endl;
cout<<(v3.array()/vv.array()).maxCoeff()<<endl<<endl;
cout<<max(1,2)<<endl;
while(1){}
//integrator.estimateInitStep(f1, params);
}