コード例 #1
0
ファイル: psd_constraint.py プロジェクト: BranYang/cvxpy
    def residual(self):
       """The residual of the constraint.

       Returns
       -------
       Expression
       """
       min_eig = cvxtypes.lambda_min()(self._expr + self._expr.T)/2
       return cvxtypes.neg()(min_eig)
コード例 #2
0
ファイル: psd.py プロジェクト: WanliXue/BF_implemation
    def residual(self):
        """The residual of the constraint.

        Returns
        -------
        Expression
        """
        # TODO wrong. Also requires symmetry.
        min_eig = cvxtypes.lambda_min()(self.args[0] + self.args[0].T) / 2
        return cvxtypes.neg()(min_eig)
コード例 #3
0
    def residual(self):
        """The residual of the constraint.

        Returns
        -------
        NumPy.ndarray
        """
        if self.expr.value is None:
            return None
        min_eig = cvxtypes.lambda_min()(self.args[0] + self.args[0].T) / 2
        return cvxtypes.neg()(min_eig).value