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
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
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