23 template <
typename Real>
26 public ApprQuery<Real, ApprHeightLine2<Real>, Vector2<Real>>
41 std::vector<int>
const&
indices);
48 template <
typename Real>
55 template <
typename Real>
62 for (
int i = 0; i < numPoints; ++i)
66 mean /= (Real)numPoints;
69 Real covar00 = (Real)0, covar01 = (Real)0;
70 for (
int i = 0; i < numPoints; ++i)
73 covar00 += diff[0] * diff[0];
74 covar01 += diff[0] * diff[1];
92 template <
typename Real>
99 template <
typename Real>
105 template <
typename Real>
113 template <
typename Real>
116 std::vector<int>
const&
indices)
122 for (
auto index : indices)
124 mean += observations[
index];
126 mean /= (Real)indices.size();
129 Real covar00 = (Real)0, covar01 = (Real)0;
130 for (
auto index : indices)
133 covar00 += diff[0] * diff[0];
134 covar01 += diff[0] * diff[1];
138 if (covar00 > (Real)0)
int GetMinimumRequired() const
bool Fit(int numPoints, Vector2< Real > const *points)
std::pair< Vector2< Real >, Vector2< Real > > mParameters
GLfixed GLfixed GLint GLint GLfixed points
GLsizei GLenum const void * indices
Real Error(Vector2< Real > const &observation) const
DualQuaternion< Real > Dot(DualQuaternion< Real > const &d0, DualQuaternion< Real > const &d1)
std::pair< Vector2< Real >, Vector2< Real > > const & GetParameters() const