Example #1
0
File: ldfp.py Project: joeywen/nlpy
 def store(self, new_s, new_y):
     """
     Store a new (s,y) pair. This method takes "small" vectors as
     input, i.e., corresponding to the variables participating in
     the quasi-Newton update.
     """
     InverseLBFGS.store(self, new_y, new_s)
Example #2
0
 def store(self, new_s, new_y):
     """
     Store a new (s,y) pair. This method takes "small" vectors as
     input, i.e., corresponding to the variables participating in
     the quasi-Newton update.
     """
     InverseLBFGS.store(self, new_y, new_s)
Example #3
0
 def matvec(self, v):
     """
     Take a small vector and return a small vector giving the
     contribution of the Hessian approximation to the
     matrix-vector product.
     """
     return InverseLBFGS.matvec(self, v)
Example #4
0
File: ldfp.py Project: joeywen/nlpy
 def matvec(self, v):
     """
     Take a small vector and return a small vector giving the
     contribution of the Hessian approximation to the
     matrix-vector product.
     """
     return InverseLBFGS.matvec(self, v)
Example #5
0
    def __init__(self, n, npairs=5, **kwargs):
        """
        See the documentation of `InverseLBFGS` for complete information.

        :keywords:
            :vars: List of variables participating in the quasi-Newton
                   update. If `None`, all variables participate.
        """
        self.on = n  # Original value of n.
        self.vars = kwargs.get('vars', None)  # None means all variables.
        if self.vars is None:
            nvars = n
        else:
            nvars = len(self.vars)

        # This next initialization will set self.n to nvars.
        # The original value of n was saved in self.on.
        InverseLBFGS.__init__(self, nvars, npairs, **kwargs)
Example #6
0
File: ldfp.py Project: joeywen/nlpy
    def __init__(self, n, npairs=5, **kwargs):
        """
        See the documentation of `InverseLBFGS` for complete information.

        :keywords:
            :vars: List of variables participating in the quasi-Newton
                   update. If `None`, all variables participate.
        """
        self.on = n   # Original value of n.
        self.vars = kwargs.get('vars', None)  # None means all variables.
        if self.vars is None:
            nvars = n
        else:
            nvars = len(self.vars)

        # This next initialization will set self.n to nvars.
        # The original value of n was saved in self.on.
        InverseLBFGS.__init__(self, nvars, npairs, **kwargs)
Example #7
0
 def store(self, new_s, new_y):
     # Simply swap s and y.
     InverseLBFGS.store(self, new_y, new_s)
Example #8
0
 def __init__(self, n, npairs=5, **kwargs):
     InverseLBFGS.__init__(self, n, npairs, **kwargs)
Example #9
0
File: ldfp.py Project: b45ch1/nlpy
 def store(self, new_s, new_y):
     # Simply swap s and y.
     InverseLBFGS.store(self, new_y, new_s)
Example #10
0
File: ldfp.py Project: b45ch1/nlpy
 def __init__(self, n, npairs=5, **kwargs):
     InverseLBFGS.__init__(self, n, npairs, **kwargs)