romspline/greedy.py
def test(self, x, y, abs=True, dx=0, verbose=False):
    """Test (or verify) the reduced-order spline on some given data.
    If the data is the training set then this function verifies that
    the spline meets the requested tolerance.
    
    Input
    -----
      x       -- samples
      y       -- data values at samples
      abs     -- output absolute values of error?
                 (default True)
      dx      -- number of derivatives of the spline evaluation
                 to compute
                 (default 0)
      verbose -- print to screen the results of the test?
                 (default False)
    
    Output
    ------
    Absolute errors between the data values (y) and the reduced-
    order spline interpolant's prediction.
    
    Comments
    --------
    The max number of derivatives that can be computed equals the
    degree of the spline.
    """
    
    if self._made:
      errors = y - self._spline(x, dx)
      if abs:
        errors = np.abs(errors)
    else:
      raise Exception("No spline interpolant to compare against. Run the greedy method.")
    
    if verbose:
      print("Requested tolerance of {} met: ".format(self._tol), np.all(np.abs(errors) <= self.tol))
    
    return errors
Test (or verify) the reduced-order spline on some given data.
    If the data is the training set then this function verifies that
    the spline meets the requested tolerance.
    
    Input
    -----
      x       -- samples
      y       -- data values at samples
      abs     -- output absolute values of error?
                 (default True)
      dx      -- number of derivatives of the spline evaluation
                 to compute
                 (default 0)
      verbose -- print to screen the results of the test?
                 (default False)
    
    Output
    ------
    Absolute errors between the data values (y) and the reduced-
    order spline interpolant's prediction.
    
    Comments
    --------
    The max number of derivatives that can be computed equals the
    degree of the spline.
    
Test (or verify) the reduced-order spline on some given data.
If the data is the training set then this function verifies that
the spline meets the requested tolerance.

Input



Output

Absolute errors between the data values (y) and the reduced
order spline interpolant's prediction.

Comments

The max number of derivatives that can be computed equals the
degree of the spline.
Test ( or verify ) the reduced - order spline on some given data . If the data is the training set then this function verifies that the spline meets the requested tolerance . Input Output Absolute errors between the data values ( y ) and the reduced order spline interpolant ' s prediction . Comments The max number of derivatives that can be computed equals the degree of the spline .
def test(self, x, y, abs=True, dx=0, verbose=False):
    if self._made:
      errors = y - self._spline(x, dx)
      if abs:
        errors = np.abs(errors)
    else:
      raise Exception("No spline interpolant to compare against. Run the greedy method.")
    if verbose:
      print("Requested tolerance of {} met: ".format(self._tol), np.all(np.abs(errors) <= self.tol))
    return errors
def test ( self , x , y , abs = True , dx = 0 , verbose = False ) : if self . _made : errors = y - self . _spline ( x , dx ) if abs : errors = np . abs ( errors ) else : raise Exception ( "No spline interpolant to compare against. Run the greedy method." ) if verbose : print ( "Requested tolerance of {} met: " . format ( self . _tol ) , np . all ( np . abs ( errors ) <= self . tol ) ) return errors
Test (or verify) the reduced-order spline on some given data.
Test ( or verify ) the reduced - order spline on some given data .
"""Test (or verify) the reduced-order spline on some given data.
    If the data is the training set then this function verifies that
    the spline meets the requested tolerance.
    
    Input
    -----
      x       -- samples
      y       -- data values at samples
      abs     -- output absolute values of error?
                 (default True)
      dx      -- number of derivatives of the spline evaluation
                 to compute
                 (default 0)
      verbose -- print to screen the results of the test?
                 (default False)
    
    Output
    ------
    Absolute errors between the data values (y) and the reduced-
    order spline interpolant's prediction.
    
    Comments
    --------
    The max number of derivatives that can be computed equals the
    degree of the spline.
    """
self
x
y
abs
dx
verbose