vecmat3 added explicit linear solver
This commit is contained in:
19
t.cc
19
t.cc
@@ -2792,6 +2792,25 @@ if(sizeof(int)!=read(f,&seed,sizeof(int))) laerror("cannot read /dev/random");
|
||||
close(f);
|
||||
srand(seed);
|
||||
|
||||
Mat3<double> a;
|
||||
a.randomize(10.);
|
||||
cout<<a<<endl;
|
||||
Vec3<double> b;
|
||||
b.randomize(10.);
|
||||
cout <<b<<endl;
|
||||
Vec3<double> x = a.linear_solve(b);
|
||||
cout <<x<<endl;
|
||||
cout <<"linear solve error = "<<(b-a*x).norm()<<endl;
|
||||
}
|
||||
|
||||
if(0)
|
||||
{
|
||||
int seed;
|
||||
int f=open("/dev/random",O_RDONLY);
|
||||
if(sizeof(int)!=read(f,&seed,sizeof(int))) laerror("cannot read /dev/random");
|
||||
close(f);
|
||||
srand(seed);
|
||||
|
||||
Mat3<double> a;
|
||||
a.randomize(10.);
|
||||
cout<<a<<endl;
|
||||
|
||||
Reference in New Issue
Block a user