Subversion Repositories gelsvn

Rev

Rev 230 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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