Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix evaluation of vectorized functions in LogL fitting
  • Loading branch information
xvallspl committed Jun 14, 2017
commit 59abd4af0be735f7870ef30746b50c927332edd3
18 changes: 10 additions & 8 deletions math/mathcore/inc/Fit/FitUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -493,19 +493,20 @@ namespace FitUtil {
if(data.NDim() > 1) {
std::vector<T> x(data.NDim());
for (unsigned int j = 0; j < data.NDim(); ++j)
x[j] = *data.GetCoordComponent(i, j);
vecCore::Load<T>(x[j], data.GetCoordComponent(i, j));
#ifdef USE_PARAMCACHE
fval = func ( x.data() );
#else
fval = func ( x.data(), p );
#endif
// one -dim case
} else {
const auto x = data.GetCoordComponent(i, 0);
T x;
vecCore::Load<T>(x, data.GetCoordComponent(i, 0));
#ifdef USE_PARAMCACHE
fval = func ( x );
fval = func ( &x );
#else
fval = func ( x, p );
fval = func ( &x, p );
#endif
}

Expand Down Expand Up @@ -675,19 +676,20 @@ namespace FitUtil {
if(data.NDim() > 1) {
std::vector<T> x(data.NDim());
for (unsigned int j = 0; j < data.NDim(); ++j)
x[j] = *data.GetCoordComponent(i, j);
vecCore::Load<T>(x[j], data.GetCoordComponent(i, j));
#ifdef USE_PARAMCACHE
fval = func ( x.data() );
#else
fval = func ( x.data(), p );
#endif
// one -dim case
} else {
const auto x = data.GetCoordComponent(i, 0);
T x;
vecCore::Load<T>(x, data.GetCoordComponent(i, 0));
#ifdef USE_PARAMCACHE
fval = func ( x );
fval = func ( &x );
#else
fval = func ( x, p );
fval = func ( &x, p );
#endif
}

Expand Down