diff --git a/include/photospline/detail/convolve.h b/include/photospline/detail/convolve.h index 33ffcba..6a5b597 100644 --- a/include/photospline/detail/convolve.h +++ b/include/photospline/detail/convolve.h @@ -144,6 +144,9 @@ void splinetable::convolve(const uint32_t dim, const double* conv_knots, double* src = (i!=dim ? knots_store[i].get() : rho); std::copy(src,src+nknots[i],&knots[i][0]); } + + // Update knot separations + dknot_bounds(); /* * NB: A monotonic function remains monotonic after convolution diff --git a/include/photospline/detail/permute.h b/include/photospline/detail/permute.h index ffac2aa..b1cf166 100644 --- a/include/photospline/detail/permute.h +++ b/include/photospline/detail/permute.h @@ -82,8 +82,11 @@ void splinetable::permuteDimensions(const std::vector& permutatio extents[i][1]=t_extents[i][1]; } std::copy(t_coefficients.get(),t_coefficients.get()+ncoeffs,coefficients); + + // Update knot separations + dknot_bounds(); } } //namespace photospline -#endif \ No newline at end of file +#endif diff --git a/include/photospline/splinetable.h b/include/photospline/splinetable.h index 9538397..44c8e9e 100644 --- a/include/photospline/splinetable.h +++ b/include/photospline/splinetable.h @@ -187,6 +187,12 @@ class splinetable{ snew->nknots = snew->allocate(s2->ndim); std::copy_n(s2->nknots,s2->ndim,snew->nknots); + snew->rmin_sep = snew->allocate(s2->ndim); + std::copy_n(s2->rmin_sep,s2->ndim,snew->rmin_sep); + + snew->rmax_sep = snew->allocate(s2->ndim); + std::copy_n(s2->rmax_sep,s2->ndim,snew->rmax_sep); + snew->knots = snew->allocate(s2->ndim); for(unsigned int i=0; indim; i++){ snew->knots[i] = snew->allocate(s2->nknots[i]+2*s2->order[i]) + s2->order[i]; @@ -211,8 +217,6 @@ class splinetable{ } snew->periods = NULL; - snew->rmin_sep = NULL; - snew->rmax_sep = NULL; snew->naux = 0; snew->aux = NULL; @@ -273,6 +277,8 @@ class splinetable{ lastKnots[nknots[inputDim]-1]=2*lastKnots[nknots[inputDim]-2]-lastKnots[nknots[inputDim]-3]; } + rmin_sep=allocate(ndim); + rmax_sep=allocate(ndim); dknot_bounds(); //set naxes