def add_variable(self, name):
        """Add a variable to the problem"""
        if name in self._variables:
            raise ValueError(
                "A variable named " + name + " already exists."
            )
        self._variables[name] = len(self._variables)
        self.bounds[name] = (0, None)

        new_col = np.zeros(shape=[len(self._constraints), 1])
        self._add_col_to_A(new_col)
        self._reset_solution()
def add_variable ( self , name ) : if name in self . _variables : raise ValueError ( "A variable named " + name + " already exists." ) self . _variables [ name ] = len ( self . _variables ) self . bounds [ name ] = ( 0 , None ) new_col = np . zeros ( shape = [ len ( self . _constraints ) , 1 ] ) self . _add_col_to_A ( new_col ) self . _reset_solution ( )
Add a variable to the problem