Skip to content

Commit

Permalink
Merge pull request #463 from potassco/feature/overflow
Browse files Browse the repository at this point in the history
Feature/overflow
  • Loading branch information
rkaminsk committed Nov 23, 2023
2 parents 19feff0 + 9f22ab3 commit fe1bf75
Show file tree
Hide file tree
Showing 7 changed files with 168 additions and 255 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@
[submodule "third_party/variant"]
path = third_party/variant
url = ../../mpark/variant.git
[submodule "third_party/wide-integer"]
path = third_party/wide-integer
url = ../../ckormanyos/wide-integer.git
2 changes: 1 addition & 1 deletion libgringo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ set(source
# ]]]

add_library(libgringo STATIC ${header} ${source})
target_link_libraries(libgringo PUBLIC libpotassco libreify tsl::ordered_map tsl::hopscotch_map tsl::sparse_map tl::optional mpark::variant)
target_link_libraries(libgringo PUBLIC libpotassco libreify tsl::ordered_map tsl::hopscotch_map tsl::sparse_map tl::optional mpark::variant math::wide_integer)
target_include_directories(libgringo
PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>"
Expand Down
7 changes: 2 additions & 5 deletions libgringo/gringo/term.hh
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ private:
};

struct IETerm {
int coefficient{0};
int64_t coefficient{0};
VarTerm const *variable{nullptr};
};
using IETermVec = std::vector<IETerm>;
Expand All @@ -203,7 +203,7 @@ void subIETerm(IETermVec &terms, IETerm const &term);

struct IE {
IETermVec terms;
int bound;
int64_t bound;
};
using IEVec = std::vector<IE>;

Expand Down Expand Up @@ -259,10 +259,7 @@ public:
void compute();

private:
enum class UpdateResult { changed, unchanged, overflow };
using SubSolvers = std::forward_list<IESolver>;
UpdateResult update_bound_(IETerm const &term, int64_t slack, int num_unbounded);
bool update_slack_(IETerm const &term, int64_t &slack, int &num_unbounded);

IESolver *parent_;
IEContext &ctx_;
Expand Down
Loading

0 comments on commit fe1bf75

Please sign in to comment.