24 template <
typename Real>
27 public ApprQuery<Real, ApprGaussian2<Real>, Vector2<Real>>
42 std::vector<int>
const&
indices);
49 template <
typename Real>
58 template <
typename Real>
65 for (
int i = 0; i < numPoints; ++i)
69 Real invSize = ((Real)1) / (Real)numPoints;
73 Real covar00 = (Real)0, covar01 = (Real)0, covar11 = (Real)0;
74 for (
int i = 0; i < numPoints; ++i)
77 covar00 += diff[0] * diff[0];
78 covar01 += diff[0] * diff[1];
79 covar11 += diff[1] * diff[1];
87 std::array<Real, 2> eval;
88 std::array<std::array<Real, 2>, 2> evec;
89 es(covar00, covar01, covar11, +1, eval, evec);
104 template <
typename Real>
110 template <
typename Real>
116 template <
typename Real>
119 std::vector<int>
const&
indices)
125 for (
auto index : indices)
127 mean += observations[
index];
129 Real invSize = ((Real)1) / (Real)indices.size();
133 Real covar00 = (Real)0, covar01 = (Real)0, covar11 = (Real)0;
134 for (
auto index : indices)
137 covar00 += diff[0] * diff[0];
138 covar01 += diff[0] * diff[1];
139 covar11 += diff[1] * diff[1];
147 std::array<Real, 2> eval;
148 std::array<std::array<Real, 2>, 2> evec;
149 es(covar00, covar01, covar11, +1, eval, evec);
163 template <
typename Real>
167 Real error = (Real)0;
168 for (
int i = 0; i < 2; ++i)
174 error += ratio * ratio;
bool Fit(int numPoints, Vector2< Real > const *points)
OrientedBox2< Real > const & GetParameters() const
GLfixed GLfixed GLint GLint GLfixed points
GLsizei GLenum const void * indices
int GetMinimumRequired() const
DualQuaternion< Real > Dot(DualQuaternion< Real > const &d0, DualQuaternion< Real > const &d1)
OrientedBox2< Real > mParameters
Real Error(Vector2< Real > const &observation) const