Skip to content

Commit

Permalink
Merge 23e258c into 0ce7e6b
Browse files Browse the repository at this point in the history
  • Loading branch information
espdev committed Mar 19, 2020
2 parents 0ce7e6b + 23e258c commit ec071bc
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions csaps/_sspumv.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"""

import typing as ty
import functools
import warnings

import numpy as np
Expand Down Expand Up @@ -278,12 +279,13 @@ def _make_spline(self, smooth: ty.Optional[float]) -> ty.Tuple[SplinePPForm, flo

dx = dx[:, np.newaxis]

pad_width = [(1, 1), (0, 0)]
d1 = np.diff(np.pad(u, pad_width), axis=0) / dx
d2 = np.diff(np.pad(d1, pad_width), axis=0)
pad = functools.partial(np.pad, pad_width=[(1, 1), (0, 0)], mode='constant')

d1 = np.diff(pad(u), axis=0) / dx
d2 = np.diff(pad(d1), axis=0)

yi = self._ydata.T - ((6. * (1. - p)) * w) @ d2
c3 = np.pad(p * u, pad_width)
c3 = pad(p * u)
c2 = np.diff(yi, axis=0) / dx - dx * (2. * c3[:-1, :] + c3[1:, :])

coeffs = np.vstack((
Expand Down

0 comments on commit ec071bc

Please sign in to comment.