示例#1
0
文件: sign.py 项目: chrisdembia/cvxpy
    def promote(self, rows, cols):
        """Promotes the Sign's internal matrices to the desired size.

        Args:
            rows: The number of rows in the promoted internal matrices.
            cols: The number of columns in the promoted internal matrices.
        """
        neg_mat = bu.promote(self.neg_mat, rows, cols)
        pos_mat = bu.promote(self.pos_mat, rows, cols)
        return Sign(neg_mat, pos_mat)
示例#2
0
文件: curvature.py 项目: BvanP/cvxpy
    def promote(self, rows, cols):
        """Promotes the Curvature's internal matrices to the desired size.

        Args:
            rows: The number of rows in the promoted internal matrices.
            cols: The number of columns in the promoted internal matrices.
        """
        cvx_mat = bu.promote(self.cvx_mat, rows, cols)
        conc_mat = bu.promote(self.conc_mat, rows, cols)
        nonconst_mat = bu.promote(self.nonconst_mat, rows, cols)
        return Curvature(cvx_mat, conc_mat, nonconst_mat)
示例#3
0
    def promote(self, rows, cols, keep_scalars=True):
        """Promotes the Sign's internal matrices to the desired size.

        Args:
            rows: The number of rows in the promoted internal matrices.
            cols: The number of columns in the promoted internal matrices.
            keep_scalars: Don't convert scalars to matrices.
        """
        neg_mat = bu.promote(self.neg_mat, rows, cols, keep_scalars)
        pos_mat = bu.promote(self.pos_mat, rows, cols, keep_scalars)
        return Sign(neg_mat, pos_mat)
示例#4
0
    def promote(self, rows, cols, keep_scalars=True):
        """Promotes the Sign's internal matrices to the desired size.

        Args:
            rows: The number of rows in the promoted internal matrices.
            cols: The number of columns in the promoted internal matrices.
            keep_scalars: Don't convert scalars to matrices.
        """
        neg_mat = bu.promote(self.neg_mat, rows, cols, keep_scalars)
        pos_mat = bu.promote(self.pos_mat, rows, cols, keep_scalars)
        return Sign(neg_mat, pos_mat)
示例#5
0
文件: curvature.py 项目: r0k3/cvxpy
    def promote(self, rows, cols, keep_scalars=True):
        """Promotes the Curvature's internal matrices to the desired size.

        Args:
            rows: The number of rows in the promoted internal matrices.
            cols: The number of columns in the promoted internal matrices.
            keep_scalars: Don't convert scalars to matrices.
        """
        cvx_mat = bu.promote(self.cvx_mat, rows, cols, keep_scalars)
        conc_mat = bu.promote(self.conc_mat, rows, cols, keep_scalars)
        nonconst_mat = bu.promote(self.nonconst_mat, rows, cols, keep_scalars)
        return Curvature(cvx_mat, conc_mat, nonconst_mat)
示例#6
0
    def promote(self, rows, cols, keep_scalars=True):
        """Promotes the Curvature's internal matrices to the desired size.

        Args:
            rows: The number of rows in the promoted internal matrices.
            cols: The number of columns in the promoted internal matrices.
            keep_scalars: Don't convert scalars to matrices.
        """
        cvx_mat = bu.promote(self.cvx_mat, rows, cols, keep_scalars)
        conc_mat = bu.promote(self.conc_mat, rows, cols, keep_scalars)
        nonconst_mat = bu.promote(self.nonconst_mat, rows, cols, keep_scalars)
        return Curvature(cvx_mat, conc_mat, nonconst_mat)