fix domains and swig
This commit is contained in:
@@ -1,29 +1,29 @@
|
||||
cc_library(
|
||||
name = "glpk",
|
||||
srcs = glob([
|
||||
"glpk-4.52/src/*.c",
|
||||
"glpk-4.52/src/*/*.c",
|
||||
"glpk-4.52/src/*.h",
|
||||
"glpk-4.52/src/*/*.h",
|
||||
], exclude = ["glpk-4.52/src/proxy/main.c"]),
|
||||
"glpk-4.65/src/*.c",
|
||||
"glpk-4.65/src/*/*.c",
|
||||
"glpk-4.65/src/*.h",
|
||||
"glpk-4.65/src/*/*.h",
|
||||
], exclude = ["glpk-4.65/src/proxy/main.c"]),
|
||||
hdrs = [
|
||||
"glpk-4.52/src/glpk.h",
|
||||
"glpk-4.65/src/glpk.h",
|
||||
],
|
||||
copts = [
|
||||
"-Wno-error",
|
||||
"-w",
|
||||
"-Iexternal/glpk/glpk-4.52/src",
|
||||
"-Iexternal/glpk/glpk-4.52/src/amd",
|
||||
"-Iexternal/glpk/glpk-4.52/src/bflib",
|
||||
"-Iexternal/glpk/glpk-4.52/src/cglib",
|
||||
"-Iexternal/glpk/glpk-4.52/src/colamd",
|
||||
"-Iexternal/glpk/glpk-4.52/src/env",
|
||||
"-Iexternal/glpk/glpk-4.52/src/minisat",
|
||||
"-Iexternal/glpk/glpk-4.52/src/misc",
|
||||
"-Iexternal/glpk/glpk-4.52/src/proxy",
|
||||
"-Iexternal/glpk/glpk-4.52/src/zlib",
|
||||
"-Iexternal/glpk/glpk-4.65/src",
|
||||
"-Iexternal/glpk/glpk-4.65/src/amd",
|
||||
"-Iexternal/glpk/glpk-4.65/src/bflib",
|
||||
"-Iexternal/glpk/glpk-4.65/src/cglib",
|
||||
"-Iexternal/glpk/glpk-4.65/src/colamd",
|
||||
"-Iexternal/glpk/glpk-4.65/src/env",
|
||||
"-Iexternal/glpk/glpk-4.65/src/minisat",
|
||||
"-Iexternal/glpk/glpk-4.65/src/misc",
|
||||
"-Iexternal/glpk/glpk-4.65/src/proxy",
|
||||
"-Iexternal/glpk/glpk-4.65/src/zlib",
|
||||
"-DHAVE_ZLIB",
|
||||
],
|
||||
includes=["glpk-4.52/src"],
|
||||
includes=["glpk-4.65/src"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
@@ -113,8 +113,7 @@ MATRIX_AS_CSHARP_ARRAY(int64, int64, long, SatInt64VectorVector);
|
||||
%unignore operations_research::Domain::Complement;
|
||||
%unignore operations_research::Domain::FlattenedIntervals;
|
||||
%unignore operations_research::Domain::FromFlatIntervals;
|
||||
%unignore operations_research::Domain::FromIntervals(
|
||||
const std::vector<std::vector<int64>>& intervals);
|
||||
%rename (FromIntervals) operations_research::Domain::FromVectorIntervals;
|
||||
%unignore operations_research::Domain::FromValues;
|
||||
%unignore operations_research::Domain::IsEmpty;
|
||||
%unignore operations_research::Domain::Max;
|
||||
|
||||
@@ -84,7 +84,7 @@ PROTO2_RETURN(operations_research::sat::CpSolverResponse,
|
||||
%rename (complement) operations_research::Domain::Complement;
|
||||
%rename (flattenedIntervals) operations_research::Domain::FlattenedIntervals;
|
||||
%rename (fromFlatIntervals) operations_research::Domain::FromFlatIntervals;
|
||||
%rename (fromIntervals) operations_research::Domain::FromIntervals;
|
||||
%rename (fromIntervals) operations_research::Domain::FromVectorIntervals;
|
||||
%rename (fromValues) operations_research::Domain::FromValues;
|
||||
%rename (isEmpty) operations_research::Domain::IsEmpty;
|
||||
%rename (size) operations_research::Domain::Size;
|
||||
|
||||
@@ -104,8 +104,7 @@ PY_PROTO_TYPEMAP(ortools.sat.sat_parameters_pb2,
|
||||
%unignore operations_research::Domain::Max;
|
||||
%unignore operations_research::Domain::FlattenedIntervals;
|
||||
%unignore operations_research::Domain::FromFlatIntervals;
|
||||
%unignore operations_research::Domain::FromIntervals(
|
||||
const std::vector<std::vector<int64>>& intervals);
|
||||
%rename (FromIntervals) operations_research::Domain::FromVectorIntervals;
|
||||
%unignore operations_research::Domain::Complement;
|
||||
%unignore operations_research::Domain::Negation;
|
||||
|
||||
|
||||
@@ -134,7 +134,8 @@ Domain Domain::FromIntervals(absl::Span<const ClosedInterval> intervals) {
|
||||
return result;
|
||||
}
|
||||
|
||||
Domain Domain::FromIntervals(const std::vector<std::vector<int64>>& intervals) {
|
||||
Domain Domain::FromVectorIntervals(
|
||||
const std::vector<std::vector<int64>>& intervals) {
|
||||
Domain result;
|
||||
for (const std::vector<int64>& interval : intervals) {
|
||||
if (interval.size() == 1) {
|
||||
|
||||
@@ -85,7 +85,7 @@ class Domain {
|
||||
static Domain FromIntervals(absl::Span<const ClosedInterval> intervals);
|
||||
|
||||
// Used in non-C++ languages. Do not use directly.
|
||||
static Domain FromIntervals(const std::vector<std::vector<int64>>& intervals);
|
||||
static Domain FromVectorIntervals(const std::vector<std::vector<int64>>& intervals);
|
||||
static Domain FromFlatIntervals(const std::vector<int64>& flat_intervals);
|
||||
std::vector<int64> FlattenedIntervals() const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user