libNumerics/computeH.cpp
// Idem, with arguments in a vector
Idem, with arguments in a vector
Idem with arguments in a vector
float ComputeH::q_error(const vector<double>& v) const
{
    double e = b;
    const double* A = Ann + n*n-1;
    for(int i = n-1; i >= 0; i--, A -= n+1)
        e += *A * v(i) * v(i);
    A = Ann + (n-1)*n; 
    for(int i = n-1; i >= 0; i--, A -= n) {
        double vi = v(i);
        e -= 2.0 * Bn[i] * vi;
        for(int j = n-1; j > i; j--)
            e += 2.0 * A[j] * vi * v(j);
    }
    return static_cast<float>(e);
}
float ComputeH :: q_error ( const vector < double > & v ) const { double e = b ; const double * A = Ann + n * n - 1 ; for ( int i = n - 1 ; i >= 0 ; i -- , A -= n + 1 ) e += * A * v ( i ) * v ( i ) ; A = Ann + ( n - 1 ) * n ; for ( int i = n - 1 ; i >= 0 ; i -- , A -= n ) { double vi = v ( i ) ; e -= 2.0 * Bn [ i ] * vi ; for ( int j = n - 1 ; j > i ; j -- ) e += 2.0 * A [ j ] * vi * v ( j ) ; } return static_cast < float > ( e ) ; }
Idem, with arguments in a vector
Idem with arguments in a vector
// Diagonal terms // Cross terms // Last row