Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemath
GitHub Repository: sagemath/sagelib
Path: blob/master/sage/numerical/backends/generic_backend.pxd
4057 views
##############################################################################
#       Copyright (C) 2010 Nathann Cohen <[email protected]>
#  Distributed under the terms of the GNU General Public License (GPL)
#  The full text of the GPL is available at:
#                  http://www.gnu.org/licenses/
##############################################################################

cdef class GenericBackend:
    cpdef int add_variable(self, lower_bound=*, upper_bound=*, binary=*, continuous=*, integer=*, obj=*, name=*) except -1
    cpdef int add_variables(self, int, lower_bound=*, upper_bound=*, binary=*, continuous=*, integer=*, obj=*, names=*) except -1
    cpdef set_variable_type(self, int variable, int vtype)
    cpdef set_sense(self, int sense)
    cpdef objective_coefficient(self, int variable, coeff=*)
    cpdef set_objective(self, list coeff, double d=*)
    cpdef set_verbosity(self, int level)
    cpdef add_linear_constraint(self, constraints, lower_bound, upper_bound, name=*)
    cpdef remove_constraint(self, int)
    cpdef remove_constraints(self, constraints)
    cpdef add_col(self, list indices, list coeffs)
    cpdef add_linear_constraints(self, int number, lower_bound, upper_bound, names=*)
    cpdef int solve(self) except -1
    cpdef double get_objective_value(self) except? -1.0
    cpdef double get_variable_value(self, int variable) except? -1.0
    cpdef bint is_maximization(self)
    cpdef write_lp(self, char * name)
    cpdef write_mps(self, char * name, int modern)
    cpdef row(self, int i)
    cpdef int ncols(self)
    cpdef int nrows(self)
    cpdef bint is_variable_binary(self, int)
    cpdef bint is_variable_integer(self, int)
    cpdef bint is_variable_continuous(self, int)
    cpdef problem_name(self, char * name = *)
    cpdef row_bounds(self, int index)
    cpdef col_bounds(self, int index)
    cpdef row_name(self, int index)
    cpdef col_name(self, int index)
    cpdef variable_upper_bound(self, int index, value = *)
    cpdef variable_lower_bound(self, int index, value = *)
    cpdef solver_parameter(self, name, value=*)

    cdef double obj_constant_term

cpdef GenericBackend get_solver(constraint_generation = ?, solver = ?)