Skip to content

Commit

Permalink
also for fit
Browse files Browse the repository at this point in the history
  • Loading branch information
tianluyuan committed Dec 22, 2023
1 parent 2b03fde commit 9f0cf9d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions include/photospline/detail/fit.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ void splinetable<Alloc>::fit(const ::ndsparse& data,
nknots = allocate<uint64_t>(ndim);
for(uint32_t i=0; i<ndim; i++)
nknots[i]=knots[i].size();
rmin_sep = allocate<double>(ndim);
rmax_sep = allocate<double>(ndim);
extents = allocate<double_ptr>(ndim);
extents[0] = allocate<double>(2*ndim);
naxes = allocate<uint64_t>(ndim);
Expand All @@ -102,6 +104,7 @@ void splinetable<Alloc>::fit(const ::ndsparse& data,
std::copy(knots[i].begin(),knots[i].end(),this->knots[i]);
dummy_knots[i]=&this->knots[i][0];
}
dknot_bounds();
//same deal for the coordinates
std::unique_ptr<const double*[]> dummy_coords(new const double*[ndim]);
for(uint32_t i=0; i<ndim; i++)
Expand All @@ -113,7 +116,7 @@ void splinetable<Alloc>::fit(const ::ndsparse& data,
extents[i][0] = this->knots[i][order[i]];
extents[i][1] = this->knots[i][nknots[i] - order[i] - 1];
}

cholmod_common cholmod_state;
cholmod_l_start(&cholmod_state);
//build penalty matrix
Expand Down Expand Up @@ -152,4 +155,4 @@ void splinetable<Alloc>::fit(const ::ndsparse& data,

} //namespace photospline

#endif
#endif

0 comments on commit 9f0cf9d

Please sign in to comment.