24 template <
typename Real>
27 public ApprQuery<Real, ApprGaussian3<Real>, Vector3<Real>>
42 std::vector<int>
const&
indices);
49 template <
typename Real>
59 template <
typename Real>
66 for (
int i = 0; i < numPoints; ++i)
70 Real invSize = ((Real)1) / (Real)numPoints;
74 Real covar00 = (Real)0, covar01 = (Real)0, covar02 = (Real)0;
75 Real covar11 = (Real)0, covar12 = (Real)0, covar22 = (Real)0;
76 for (
int i = 0; i < numPoints; ++i)
79 covar00 += diff[0] * diff[0];
80 covar01 += diff[0] * diff[1];
81 covar02 += diff[0] * diff[2];
82 covar11 += diff[1] * diff[1];
83 covar12 += diff[1] * diff[2];
84 covar22 += diff[2] * diff[2];
95 std::array<Real, 3> eval;
96 std::array<std::array<Real, 3>, 3> evec;
97 es(covar00, covar01, covar02, covar11, covar12, covar22,
false, +1,
115 template <
typename Real>
121 template <
typename Real>
127 template <
typename Real>
131 Real error = (Real)0;
132 for (
int i = 0; i < 3; ++i)
138 error += ratio * ratio;
144 template <
typename Real>
147 std::vector<int>
const&
indices)
153 for (
auto index : indices)
157 Real invSize = ((Real)1) / (Real)indices.size();
161 Real covar00 = (Real)0, covar01 = (Real)0, covar02 = (Real)0;
162 Real covar11 = (Real)0, covar12 = (Real)0, covar22 = (Real)0;
163 for (
auto index : indices)
166 covar00 += diff[0] * diff[0];
167 covar01 += diff[0] * diff[1];
168 covar02 += diff[0] * diff[2];
169 covar11 += diff[1] * diff[1];
170 covar12 += diff[1] * diff[2];
171 covar22 += diff[2] * diff[2];
182 std::array<Real, 3> eval;
183 std::array<std::array<Real, 3>, 3> evec;
184 es(covar00, covar01, covar02, covar11, covar12, covar22,
false, +1,
bool Fit(int numPoints, Vector3< Real > const *points)
OrientedBox3< Real > mParameters
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)
OrientedBox3< Real > const & GetParameters() const
Real Error(Vector3< Real > const &observation) const