romspline/greedy.py
def seed(self, x, seeds=None):
    """Seed the greedy algorithm with (deg+1) evenly spaced indices"""
    if seeds is None:
      f = lambda m, n: [ii*n//m + n//(2*m) for ii in range(m)]
      self.indices = np.sort(np.hstack([[0, len(x)-1], f(self._deg-1, len(x))]))
    else:
      self.indices = seeds
    self.errors = []
    
    # Keep track of unsorted indices selected by greedy algorithm
    self.args = self.indices[:]
Seed the greedy algorithm with (deg+1) evenly spaced indices
Seed the greedy algorithm with (deg+1) evenly spaced indices
Seed the greedy algorithm with ( deg + 1 ) evenly spaced indices
def seed(self, x, seeds=None):
    if seeds is None:
      f = lambda m, n: [ii*n//m + n//(2*m) for ii in range(m)]
      self.indices = np.sort(np.hstack([[0, len(x)-1], f(self._deg-1, len(x))]))
    else:
      self.indices = seeds
    self.errors = []
    self.args = self.indices[:]
def seed ( self , x , seeds = None ) : if seeds is None : f = lambda m , n : [ ii * n // m + n // ( 2 * m ) for ii in range ( m ) ] self . indices = np . sort ( np . hstack ( [ [ 0 , len ( x ) - 1 ] , f ( self . _deg - 1 , len ( x ) ) ] ) ) else : self . indices = seeds self . errors = [ ] self . args = self . indices [ : ]
Seed the greedy algorithm with (deg+1) evenly spaced indices
Seed the greedy algorithm with ( deg + 1 ) evenly spaced indices
"""Seed the greedy algorithm with (deg+1) evenly spaced indices""" # Keep track of unsorted indices selected by greedy algorithm
self
x
seeds