Example #1
0
 def minimizeLsqEndTerm(self, obj):
     if isinstance(obj, list):
         obj = C.veccat(obj)
     C.makeDense(obj)
     shape = obj.shape
     assert shape[0] == 1 or shape[1] == 1, "objective cannot be matrix, got shape: " + str(shape)
     assert not hasattr(self, "_minLsqEndTerm"), "you can only call minimizeLsqEndTerm once"
     self._minLsqEndTerm = obj
Example #2
0
 def minimizeLsq(self, obj):
     if isinstance(obj, list):
         obj = C.veccat(obj)
     C.makeDense(obj)
     shape = obj.shape
     assert shape[0] == 1 or shape[
         1] == 1, 'objective cannot be matrix, got shape: ' + str(shape)
     assert not hasattr(self,
                        '_minLsq'), 'you can only call minimizeLsq once'
     self._minLsq = obj
Example #3
0
 def minimizeLsqEndTerm(self, obj):
     C.makeDense(obj)
     shape = obj.shape
     assert shape[0] == 1 or shape[1] == 1, 'objective cannot be matrix, got shape: '+str(shape)
     assert not hasattr(self, '_minLsqEndTerm'), 'you can only call minimizeLsqEndTerm once'
     self._minLsqEndTerm = obj