Subversion Repositories gelsvn

Rev

Rev 207 | 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"
5
 
6
using namespace LinAlg;
7
using namespace CGLA;
8
using namespace std;
9
 
10
namespace Geometry
11
{
296 jrf 12
	Vec3d QEM::opt_pos(double sv_thresh) const
39 bj 13
	{
296 jrf 14
			CMatrix A_num(A);
15
			CVector b_num(b);
16
			CVector x(3);
17
			x = LinearLSSolve(A,b);
18
			/* Actually LSSolve uses SVD, but we cannot set a cut off value for
19
				 the singular values. Might be worth fixing */
20
			Vec3d p(-x[0], -x[1], -x[2]);
21
			return p;
22
	}
39 bj 23
 
24
}