23 template <
typename Real>
26 public ApprQuery<Real, ApprOrthogonalPlane3<Real>, Vector3<Real>>
41 std::vector<int>
const&
indices);
48 template <
typename Real>
55 template <
typename Real>
63 for (
int i = 0; i < numPoints; ++i)
67 mean /= (Real)numPoints;
70 Real covar00 = (Real)0, covar01 = (Real)0, covar02 = (Real)0;
71 Real covar11 = (Real)0, covar12 = (Real)0, covar22 = (Real)0;
72 for (
int i = 0; i < numPoints; ++i)
75 covar00 += diff[0] * diff[0];
76 covar01 += diff[0] * diff[1];
77 covar02 += diff[0] * diff[2];
78 covar11 += diff[1] * diff[1];
79 covar12 += diff[1] * diff[2];
80 covar22 += diff[2] * diff[2];
85 std::array<Real, 3> eval;
86 std::array<std::array<Real, 3>, 3> evec;
87 es(covar00, covar01, covar02, covar11, covar12, covar22,
false, +1,
97 return eval[0] < eval[1];
105 template <
typename Real>
112 template <
typename Real>
118 template <
typename Real>
123 Real sqrlen =
Dot(diff, diff);
125 Real error =
std::abs(sqrlen - dot*dot);
129 template <
typename Real>
132 std::vector<int>
const&
indices)
138 for (
auto index : indices)
140 mean += observations[
index];
142 mean /= (Real)indices.size();
145 Real covar00 = (Real)0, covar01 = (Real)0, covar02 = (Real)0;
146 Real covar11 = (Real)0, covar12 = (Real)0, covar22 = (Real)0;
147 for (
auto index : indices)
150 covar00 += diff[0] * diff[0];
151 covar01 += diff[0] * diff[1];
152 covar02 += diff[0] * diff[2];
153 covar11 += diff[1] * diff[1];
154 covar12 += diff[1] * diff[2];
155 covar22 += diff[2] * diff[2];
160 std::array<Real, 3> eval;
161 std::array<std::array<Real, 3>, 3> evec;
162 es(covar00, covar01, covar02, covar11, covar12, covar22,
false, +1,
172 return eval[0] < eval[1];
std::pair< Vector3< Real >, Vector3< Real > > mParameters
gte::BSNumber< UIntegerType > abs(gte::BSNumber< UIntegerType > const &number)
int GetMinimumRequired() const
GLfixed GLfixed GLint GLint GLfixed points
GLsizei GLenum const void * indices
DualQuaternion< Real > Dot(DualQuaternion< Real > const &d0, DualQuaternion< Real > const &d1)
Real Error(Vector3< Real > const &observation) const
bool Fit(int numPoints, Vector3< Real > const *points)
std::pair< Vector3< Real >, Vector3< Real > > const & GetParameters() const