add python API for NotMember
This commit is contained in:
@@ -491,6 +491,10 @@ PY_STRINGIFY_DEBUGSTRING(Decision);
|
||||
Constraint* Member(const std::vector<int64>& values) {
|
||||
return $self->solver()->MakeMemberCt($self->Var(), values);
|
||||
}
|
||||
Constraint* NotMember(const std::vector<int64>& starts,
|
||||
const std::vector<int64>& ends) {
|
||||
return $self->solver()->MakeNotMemberCt($self, starts, ends);
|
||||
}
|
||||
}
|
||||
|
||||
// Add arithmetic operators to integer expressions.
|
||||
@@ -2240,3 +2244,4 @@ class PyConstraint(Constraint):
|
||||
|
||||
|
||||
} // %pythoncode
|
||||
|
||||
|
||||
@@ -31,7 +31,9 @@ namespace operations_research {
|
||||
// defined in base/swig/python-swig.cc seems to cause issues, so we can't
|
||||
// use a generic, templated type checker.
|
||||
%define PY_LIST_OUTPUT_TYPEMAP(type, checker, py_converter)
|
||||
%typecheck(SWIG_TYPECHECK_POINTER) const std::vector<type>& {
|
||||
%typecheck(SWIG_TYPECHECK_POINTER) const std::vector<type>&,
|
||||
std::vector<type>,
|
||||
const std::vector<type>* {
|
||||
if (!PyTuple_Check($input) && !PyList_Check($input)) {
|
||||
$1 = 0;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user