Example #1
0
File: bqp.py Project: joeywen/nlpy
 def __init__(self, g, H, **kwargs):
     TruncatedCG.__init__(self, g, H, **kwargs)
     self.name = 'Suff-CG'
     self.qval = 0.0   # Initial value of quadratic objective.
     self.best_decrease = 0
     self.cg_reltol = kwargs.get('cg_reltol', 0.1)
     self.detect_stalling = kwargs.get('detect_stalling', True)
Example #2
0
 def __init__(self, g, H, **kwargs):
     TruncatedCG.__init__(self, g, H, **kwargs)
     self.name = 'Suff-CG'
     self.qval = 0.0  # Initial value of quadratic objective.
     self.best_decrease = 0
     self.cg_reltol = kwargs.get('cg_reltol', 0.1)
     self.detect_stalling = kwargs.get('detect_stalling', True)
Example #3
0
File: lstr.py Project: joeywen/nlpy
    def __init__(self, J, c, radius=None, transposed=False, **kwargs):
        """
        :parameters:
            :J: coefficient matrix (may be rectangular)
            :c: constant vector (numpy array)
            :radius: positive real number or None (default: None)
            :transpose: if set to True, replace J with its transpose.

        `J` should be a linear operator.
        Additional keyword arguments are passed directly to `TruncatedCG`.

        Upon completion, the member `step` is set to the most recent solution
        estimate. See the documentation of `TruncatedCG` for more
        information.
        """
        self.op = SquaredLinearOperator(J, transposed=transposed)
        TruncatedCG.__init__(self, J.T * c, self.op, radius=radius, **kwargs)
        return
Example #4
0
    def __init__(self, J, c, radius=None, transposed=False, **kwargs):
        """
        :parameters:
            :J: coefficient matrix (may be rectangular)
            :c: constant vector (numpy array)
            :radius: positive real number or None (default: None)
            :transpose: if set to True, replace J with its transpose.

        `J` should be a linear operator.
        Additional keyword arguments are passed directly to `TruncatedCG`.

        Upon completion, the member `step` is set to the most recent solution
        estimate. See the documentation of `TruncatedCG` for more
        information.
        """
        self.op = SquaredLinearOperator(J, transposed=transposed)
        TruncatedCG.__init__(self, J.T * c, self.op, radius=radius, **kwargs)
        return