24 template <
typename Real>
27 public ApprQuery<Real, ApprOrthogonalLine2<Real>, Vector2<Real>>
42 std::vector<int>
const&
indices);
49 template <
typename Real>
56 template <
typename Real>
64 for (
int i = 0; i < numPoints; ++i)
68 mean /= (Real)numPoints;
71 Real covar00 = (Real)0, covar01 = (Real)0, covar11 = (Real)0;
72 for (
int i = 0; i < numPoints; ++i)
75 covar00 += diff[0] * diff[0];
76 covar01 += diff[0] * diff[1];
77 covar11 += diff[1] * diff[1];
82 std::array<Real, 2> eval;
83 std::array<std::array<Real, 2>, 2> evec;
84 es(covar00, covar01, covar11, +1, eval, evec);
93 return eval[0] < eval[1];
100 template <
typename Real>
106 template <
typename Real>
112 template <
typename Real>
116 Real sqrlen =
Dot(diff, diff);
118 Real error =
std::abs(sqrlen - dot*dot);
122 template <
typename Real>
125 std::vector<int>
const&
indices)
131 for (
auto index : indices)
133 mean += observations[
index];
135 mean /= (Real)indices.size();
138 Real covar00 = (Real)0, covar01 = (Real)0, covar11 = (Real)0;
139 for (
auto index : indices)
142 covar00 += diff[0] * diff[0];
143 covar01 += diff[0] * diff[1];
144 covar11 += diff[1] * diff[1];
150 std::array<Real, 2> eval;
151 std::array<std::array<Real, 2>, 2> evec;
152 es(covar00, covar01, covar11, +1, eval, evec);
161 return eval[0] < eval[1];
gte::BSNumber< UIntegerType > abs(gte::BSNumber< UIntegerType > const &number)
Line2< Real > mParameters
Line2< Real > const & GetParameters() const
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(Vector2< Real > const &observation) const
bool Fit(int numPoints, Vector2< Real > const *points)