Skip to content

Commit

Permalink
[Fitting] Fix error in GLSDer::geomVar() function
Browse files Browse the repository at this point in the history
  • Loading branch information
julesvidal committed Nov 8, 2022
1 parent 1793b3b commit 6bf5470
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Ponca/src/Fitting/gls.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

#include "Ponca/src/Fitting/enums.h"
template < class DataPoint, class _WFunctor, typename T>
inline FIT_RESULT
GLSParam<DataPoint, _WFunctor, T>::finalize()
Expand Down Expand Up @@ -91,10 +92,10 @@ GLSDer <DataPoint, _WFunctor, DiffType, T>::geomVar( Scalar wtau,
Scalar weta,
Scalar wkappa ) const
{
static_assert( Base::isScaleDer, "Scale derivatives are required to compute Geometric Variation" );
Scalar dtau = Base::dtau_normalized().col(0)(0);
Scalar deta = Base::deta_normalized().col(0).norm();
Scalar dkappa = Base::dkappa_normalized().col(0)(0);
static_assert( bool(DiffType & FitScaleDer), "Scale derivatives are required to compute Geometric Variation" );
Scalar dtau = dtau_normalized().col(0)(0);
Scalar deta = deta_normalized().col(0).norm();
Scalar dkappa = dkappa_normalized().col(0)(0);

return wtau*dtau*dtau + weta*deta*deta + wkappa*dkappa*dkappa;
}

0 comments on commit 6bf5470

Please sign in to comment.