Subversion Repositories gelsvn

Rev

Rev 220 | Rev 230 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
39 bj 1
#include <iostream>
2
 
3
#include "QEM.h"
4
#include "LinAlg/LapackFunc.h"
220 jab 5
#include <gsl/gsl_matrix.h>
6
#include <gsl/gsl_linalg.h>
39 bj 7
 
8
using namespace LinAlg;
9
using namespace CGLA;
10
using namespace std;
11
 
12
namespace Geometry
13
{
214 jab 14
	Vec3d QEM::opt_pos(double sv_thresh) const
39 bj 15
	{
220 jab 16
			CMatrix A_num(A);
17
			CVector b_num(b);
18
			CVector x(3);
19
			x = LinearLSSolve(A,b);
222 jab 20
			/* Actually LSSolve uses SVD, but we cannot set a cut off value for
21
				 the singular values. Might be worth fixing */
220 jab 22
			Vec3d p(-x[0], -x[1], -x[2]);
23
			return p;
24
	}
39 bj 25
 
26
}