-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge 'develop' in 'topics/in-house-linear-program-solver'
- Loading branch information
Showing
12 changed files
with
279 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
FROM python:3.10-slim AS dist | ||
FROM python:3.13-slim AS dist | ||
RUN mkdir /dist | ||
ARG lincs_version | ||
COPY lincs-$lincs_version-cp310-cp310-manylinux_2_31_x86_64.whl /dist | ||
|
||
FROM python:3.10-slim | ||
FROM python:3.13-slim | ||
ARG lincs_version | ||
RUN --mount=type=bind,from=dist,source=/dist,target=/dist pip install --find-links /dist --only-binary lincs lincs==$lincs_version | ||
CMD ["bash"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
lincs/liblincs/linear-programming/test-bug-0005-gpu-behaves-differently-from-cpu.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright 2023-2024 Vincent Jacques | ||
|
||
#include "testing.hpp" | ||
|
||
|
||
TEST_CASE("Bug") { | ||
test([](auto& linear_program) -> std::optional<float> { | ||
{ | ||
std::vector<typename std::remove_reference_t<decltype(linear_program)>::variable_type> v; | ||
v.push_back(linear_program.create_variable()); | ||
v.push_back(linear_program.create_variable()); | ||
v.push_back(linear_program.create_variable()); | ||
linear_program.mark_all_variables_created(); | ||
linear_program.set_objective_coefficient(v[0], -2.6169455); | ||
linear_program.set_objective_coefficient(v[1], -0.56562924); | ||
linear_program.set_objective_coefficient(v[2], -2.6307747); | ||
linear_program.create_constraint().set_bounds(-1, 1).set_coefficient(v[0], 1); | ||
linear_program.create_constraint().set_bounds(-1, 1).set_coefficient(v[1], 1); | ||
linear_program.create_constraint().set_bounds(-1, 1).set_coefficient(v[2], 1); | ||
linear_program.create_constraint().set_bounds(-1, 1).set_coefficient(v[0], 0.3803965).set_coefficient(v[1], -0.9824758).set_coefficient(v[2], 0.4877367); | ||
linear_program.create_constraint().set_bounds(-1, 1).set_coefficient(v[0], 0.57658184).set_coefficient(v[1], -0.8118078).set_coefficient(v[2], 0.014208794); | ||
linear_program.create_constraint().set_bounds(-1, 1).set_coefficient(v[0], 0.85147953).set_coefficient(v[1], -0.5650891).set_coefficient(v[2], 0.15271592); | ||
} | ||
const auto solution = linear_program.solve(); | ||
if (solution) { | ||
return solution->cost; | ||
} else { | ||
return std::nullopt; | ||
} | ||
}); | ||
} |
Oops, something went wrong.