Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/unixmatrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- { os: windows-11-vs2026-arm, shell: cmd , arch: arm64 , bitness: 64, runtime: vc18 , cmake_params: '-G "Visual Studio 18" -T v145 -A arm64', cmake_flags: ' /MP4 /wd4267 /wd4244 /wd4305 /wd4996', test_config: 'Release/', desc: 'Windows Visual Studio 2026 arm64' }
- { os: windows-2025-vs2026 , shell: cmd , arch: x64 , bitness: 64, runtime: vc18 , cmake_params: '-G "Visual Studio 18" -T v145 -A x64' , cmake_flags: ' /MP4 /wd4267 /wd4244 /wd4305 /wd4996', test_config: 'Release/', desc: 'Windows Visual Studio 2026 x64' }
- { os: windows-2025-vs2026 , shell: cmd , arch: x86 , bitness: 32, runtime: vc18 , cmake_params: '-G "Visual Studio 18" -T v145 -A Win32', cmake_flags: ' /MP4 /wd4267 /wd4244 /wd4305 /wd4996', test_config: 'Release/', choco_flags: '--x86', desc: 'Windows Visual Studio 2026 x86' }
- { os: windows-11-arm , shell: cmd , arch: arm64 , bitness: 64, runtime: vc17 , cmake_params: '-G "Visual Studio 17" -T v143 -A arm64', cmake_flags: ' /MP4 /wd4267 /wd4244 /wd4305 /wd4996', test_config: 'Release/', desc: 'Windows Visual Studio 2022 arm64' }
- { os: windows-11-arm , shell: cmd , arch: arm64 , bitness: 64, runtime: vc17 , cmake_params: '-G "Visual Studio 18 2026" -T v143 -A arm64', cmake_flags: ' /MP4 /wd4267 /wd4244 /wd4305 /wd4996', test_config: 'Release/', desc: 'Windows Visual Studio 2026 arm64 (v143)' }
- { os: windows-2022 , shell: cmd , arch: x64 , bitness: 64, runtime: vc17 , cmake_params: '-G "Visual Studio 17" -T v143 -A x64' , cmake_flags: ' /MP4 /wd4267 /wd4244 /wd4305 /wd4996', test_config: 'Release/', desc: 'Windows Visual Studio 2022 x64' }
- { os: windows-2022 , shell: cmd , arch: x86 , bitness: 32, runtime: vc17 , cmake_params: '-G "Visual Studio 17" -T v143 -A Win32', cmake_flags: ' /MP4 /wd4267 /wd4244 /wd4305 /wd4996', test_config: 'Release/', choco_flags: '--x86', desc: 'Windows Visual Studio 2022 x86' }
# Problems related to C++20 for Visual Studio 2019 and earlier?
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/vcmatrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ jobs:
- { os: windows-2022 , shell: cmd , arch: x86 , runtime: vc17 , cmake_params: '-G "Visual Studio 17" -T v143 -A Win32', choco_flags: '--x86', cpcfg: '-win32', py_v_maj: 3, py_v_min: 10, desc: 'Windows Visual Studio 2022 x86 Python 3.10' }
- { os: windows-2022 , shell: cmd , arch: x86 , runtime: vc17 , cmake_params: '-G "Visual Studio 17" -T v143 -A Win32', choco_flags: '--x86', cpcfg: '-win32', py_v_maj: 3, py_v_min: 9 , desc: 'Windows Visual Studio 2022 x86 Python 3.9' }
- { os: windows-2022 , shell: cmd , arch: x86 , runtime: vc17 , cmake_params: '-G "Visual Studio 17" -T v143 -A Win32', choco_flags: '--x86', cpcfg: '-win32', py_v_maj: 3, py_v_min: 8 , desc: 'Windows Visual Studio 2022 x86 Python 3.8' }
- { os: windows-11-arm , shell: cmd , arch: arm64 , runtime: vc17 , cmake_params: '-G "Visual Studio 17" -T v143 -A arm64', cpcfg: '-win_arm64', py_v_maj: 3, py_v_min: 14, desc: 'Windows Visual Studio 2022 arm64 Python 3.14' }
- { os: windows-11-arm , shell: cmd , arch: arm64 , runtime: vc17 , cmake_params: '-G "Visual Studio 17" -T v143 -A arm64', cpcfg: '-win_arm64', py_v_maj: 3, py_v_min: 13, desc: 'Windows Visual Studio 2022 arm64 Python 3.13' }
- { os: windows-11-arm , shell: cmd , arch: arm64 , runtime: vc17 , cmake_params: '-G "Visual Studio 17" -T v143 -A arm64', cpcfg: '-win_arm64', py_v_maj: 3, py_v_min: 12, desc: 'Windows Visual Studio 2022 arm64 Python 3.12' }
- { os: windows-11-arm , shell: cmd , arch: arm64 , runtime: vc17 , cmake_params: '-G "Visual Studio 17" -T v143 -A arm64', cpcfg: '-win_arm64', py_v_maj: 3, py_v_min: 11, desc: 'Windows Visual Studio 2022 arm64 Python 3.11' }
- { os: windows-11-arm , shell: cmd , arch: arm64 , runtime: vc17 , cmake_params: '-G "Visual Studio 18 2026" -T v143 -A arm64', cpcfg: '-win_arm64', py_v_maj: 3, py_v_min: 14, desc: 'Windows Visual Studio 2026 arm64 Python 3.14' }
- { os: windows-11-arm , shell: cmd , arch: arm64 , runtime: vc17 , cmake_params: '-G "Visual Studio 18 2026" -T v143 -A arm64', cpcfg: '-win_arm64', py_v_maj: 3, py_v_min: 13, desc: 'Windows Visual Studio 2026 arm64 Python 3.13' }
- { os: windows-11-arm , shell: cmd , arch: arm64 , runtime: vc17 , cmake_params: '-G "Visual Studio 18 2026" -T v143 -A arm64', cpcfg: '-win_arm64', py_v_maj: 3, py_v_min: 12, desc: 'Windows Visual Studio 2026 arm64 Python 3.12' }
- { os: windows-11-arm , shell: cmd , arch: arm64 , runtime: vc17 , cmake_params: '-G "Visual Studio 18 2026" -T v143 -A arm64', cpcfg: '-win_arm64', py_v_maj: 3, py_v_min: 11, desc: 'Windows Visual Studio 2026 arm64 Python 3.11' }
- { os: windows-2022 , shell: cmd , arch: x64 , runtime: vc17 , cmake_params: '-G "Visual Studio 17" -T v143 -A x64' , cpcfg: '-win_amd64', py_v_maj: 3, py_v_min: 14, desc: 'Windows Visual Studio 2022 x64 Python 3.14' }
- { os: windows-2022 , shell: cmd , arch: x64 , runtime: vc17 , cmake_params: '-G "Visual Studio 17" -T v143 -A x64' , cpcfg: '-win_amd64', py_v_maj: 3, py_v_min: 13, desc: 'Windows Visual Studio 2022 x64 Python 3.13' }
- { os: windows-2022 , shell: cmd , arch: x64 , runtime: vc17 , cmake_params: '-G "Visual Studio 17" -T v143 -A x64' , cpcfg: '-win_amd64', py_v_maj: 3, py_v_min: 12, desc: 'Windows Visual Studio 2022 x64 Python 3.12' }
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
.cproject
.settings
.project
.pydevproject

# waf generated stuff
.waf*
Expand Down Expand Up @@ -56,6 +57,7 @@ doc/doxygen/xml/*
build/
build_*/
build-*/
CMakePresets.json

# Latex files
*.aux
Expand Down
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,11 @@
message(STATUS "Found Eigen3 version ${Eigen3_VERSION} in ${Eigen3_DIR}")
else()
message(STATUS "Attempt to install custom Eigen3 automatically...")
FetchContent_Declare(Eigen3 URL http://github.com/codac-team/eigen/archive/refs/heads/eigen-5.0.zip)
# Over HTTPS, not plain HTTP: the connections to port 80 of github.com timed
# out now and then on the GitHub Actions runners, failing the whole job at
# configuration time ("Failed to connect to github.com port 80"), and HTTPS
# also guarantees that the archive comes from GitHub unaltered.
FetchContent_Declare(Eigen3 URL https://github.com/codac-team/eigen/archive/refs/heads/eigen-5.0.zip)
#FetchContent_Declare(Eigen3 URL ${CMAKE_CURRENT_SOURCE_DIR}/3rd/eigen-a0dc3994bd5d4e804dab58decb78c56a5af516ba.zip) # If needed to be self-contained...
FetchContent_MakeAvailable(Eigen3)
endif()
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ This list is in alphabetical order by surname.
- [Morgan Louédec](https://morgan-louedec.fr)
- [Damien Massé](https://lab-sticc.univ-brest.fr/~dmasse)
- [Bertrand Neveu](http://imagine.enpc.fr/~neveub)
- [Jordan Ninin](https://sites.google.com/site/jordanninin)
- Verlein Radwan
- [Andreas Rauh](https://www.interval-methods.de)
- [Simon Rohou](http://simon-rohou.fr/research)
Expand Down
1 change: 1 addition & 0 deletions doc/manual/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ This list is in alphabetical order by surname.
* `Morgan Louédec <https://morgan-louedec.fr>`_
* `Damien Massé <https://lab-sticc.univ-brest.fr/~dmasse>`_
* `Bertrand Neveu <http://imagine.enpc.fr/~neveub>`_
* `Jordan Ninin <https://sites.google.com/site/jordanninin>`_
* Verlein Radwan
* `Andreas Rauh <https://www.interval-methods.de>`_
* `Simon Rohou <http://simon-rohou.fr/research>`_
Expand Down
4 changes: 2 additions & 2 deletions doc/manual/manual/references/logos.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ Available Files
- :download:`logo_codac_transparent.png </_static/logos/logo_codac_transparent.png>`

* - .. image:: /_static/logos/logo_codac_transparent.svg
:alt: Codac Logo Transparent PDF
:alt: Codac Logo Transparent SVG
:class: reveal-bg
:width: 120px
- Logo with transparent background (SVG).
- :download:`logo_codac_transparent.pdf </_static/logos/logo_codac_transparent.svg>`
- :download:`logo_codac_transparent.svg </_static/logos/logo_codac_transparent.svg>`

* - .. image:: /_static/logos/qr_code_codac.png
:alt: Codac QR Code
Expand Down
4 changes: 2 additions & 2 deletions python/src/core/contractors/codac2_py_CtcInverse.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void export_CtcInverse(py::module& m,
};

if(xs.size() == 0)
assert_release(false && "contract() expects at least one argument");
assert_release_unreachable("contract() expects at least one argument");

// Fast paths already consistent with the typed overloads

Expand Down Expand Up @@ -114,7 +114,7 @@ void export_CtcInverse(py::module& m,
has_tube_args = true;
else
{
assert_release(false && "contract(): variadic mode only supports "
assert_release_unreachable("contract(): variadic mode only supports "
"Interval / IntervalVector / SlicedTube<Interval> / SlicedTube<IntervalVector>");
}
}
Expand Down
2 changes: 1 addition & 1 deletion python/src/core/trajectory/codac2_py_SampledTraj.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ py::class_<SampledTraj<T>> _export_SampledTraj(py::module& m, const string& clas
exported_class

.def(py::init(
[](const py::array_t<double>& l_t, const py::array_t<double>& l_x)
[](const py::array_t<double>& l_t, const py::array_t<double, py::array::c_style | py::array::forcecast>& l_x)
{
if constexpr(std::is_same_v<T,Vector>)
{
Expand Down
4 changes: 2 additions & 2 deletions src/core/domains/interval/codac2_Interval_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ namespace codac2

else
{
assert_release("'Interval' can only be defined by one or two 'double' values.");
assert_release_unreachable("'Interval' can only be defined by one or two 'double' values.");
}

return *this;
Expand Down Expand Up @@ -152,7 +152,7 @@ namespace codac2

inline double Interval::smag() const
{
return (abs(lb()) > abs(ub())) ? lb() : ub();
return (std::abs(lb()) > std::abs(ub())) ? lb() : ub();
}

inline double Interval::smig() const
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ namespace codac2
}

else
assert_release(false && "FlatInputLayout: unsupported variable type in function argument list");
assert_release_unreachable("FlatInputLayout: unsupported variable type in function argument list");
}

_size = flat;
Expand Down
3 changes: 1 addition & 2 deletions src/core/geometry/codac2_Polygon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,7 @@ namespace codac2
return { {p[0],prev_float(oo)}, p };
default:
{
assert_release(false &&
"failed to test if the point is contained in polygon");
assert_release_unreachable("failed to test if the point is contained in polygon");
return Segment(IntervalVector(2),IntervalVector(2));
}
}
Expand Down
13 changes: 13 additions & 0 deletions src/core/tools/codac2_assert.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ namespace codac2

#define assert_release(ignore_test) ((void)0)
#define assert_release_constexpr(ignore_test) ((void)0)
#define assert_release_unreachable(ignore_msg) ((void)0)

#else

Expand Down Expand Up @@ -52,6 +53,13 @@ namespace codac2
} \
} while (0)

// For a branch that must never be reached.
// To be used instead of assert_release(false && "...")
#define assert_release_unreachable(msg) \
do { \
CODAC_ASSERT_MESSAGE(msg, __FILE__, __LINE__, __PRETTY_FUNCTION__); \
} while (0)

#else

#define assert_release(test) \
Expand All @@ -68,6 +76,11 @@ namespace codac2
} \
} while (0)

#define assert_release_unreachable(msg) \
do { \
CODAC_ASSERT_MESSAGE(msg, __FILE__, __LINE__, __func__); \
} while (0)

#endif

#endif
Expand Down
12 changes: 5 additions & 7 deletions src/extensions/sympy/codac2_sympy_bridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ namespace codac2
continue;
}

assert_release(false && "Unsupported variable type in FlatSymbolTable");
assert_release_unreachable("Unsupported variable type in FlatSymbolTable");
}
}

Expand Down Expand Up @@ -492,7 +492,7 @@ namespace codac2
return export_matrix_component(child_at(ch,0), op->i(), op->j());
}

assert_release(false && "Unsupported Codac scalar node in SympyExporter");
assert_release_unreachable("Unsupported Codac scalar node in SympyExporter");
return pybind11::none();
}

Expand All @@ -509,8 +509,7 @@ namespace codac2
return export_node(child_at(children,i));
}

assert_release(false
&& "Unsupported vector-component expression. Supported cases: direct VectorVar components, or vector expressions exposing scalar children via children_expr_base().");
assert_release_unreachable("Unsupported vector-component expression. Supported cases: direct VectorVar components, or vector expressions exposing scalar children via children_expr_base().");
return pybind11::none();
}

Expand All @@ -528,8 +527,7 @@ namespace codac2
return export_vector_component(child_at(children,j), i);
}

assert_release(false
&& "Unsupported matrix-component expression. Supported cases: direct MatrixVar components, or matrix expressions exposing column children via children_expr_base().");
assert_release_unreachable("Unsupported matrix-component expression. Supported cases: direct MatrixVar components, or matrix expressions exposing column children via children_expr_base().");
return pybind11::none();
}

Expand Down Expand Up @@ -681,7 +679,7 @@ namespace codac2
if(func.is(sympy.attr("atan2"))) return atan2(x1, x2);
}

assert_release(false && "Unsupported SymPy node in importer");
assert_release_unreachable("Unsupported SymPy node in importer");
return const_value(0.);
}
}
Expand Down
14 changes: 14 additions & 0 deletions tests/core/domains/interval/codac2_tests_Interval.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <codac2_Interval.h>
#include <codac2_Approx.h>
#include <limits>
#include <stdexcept>

using namespace std;
using namespace codac2;
Expand Down Expand Up @@ -53,6 +54,19 @@ TEST_CASE("Interval - tests from IBEX")

Interval x, y, z;

// An interval is a point or a pair of bounds; any other list length is a
// caller error and is reported through the assertion layer. A FAST_RELEASE
// build compiles that layer out, which is the one configuration where
// nothing is raised -- the guard mirrors the one in codac2_assert.h.
#if !(defined(FAST_RELEASE) && defined(NDEBUG))
{
Interval from_list(0.,1.);
CHECK_THROWS_AS(from_list.init_from_list({1.,2.,3.}), std::invalid_argument);
CHECK_THROWS_AS(from_list.init_from_list({}), std::invalid_argument);
CHECK_THROWS_AS(Interval({1.,2.,3.}), std::invalid_argument);
}
#endif

x = Interval(0,1); x.set_empty();
CHECK(x == Interval::empty());
CHECK(x.is_empty());
Expand Down
15 changes: 15 additions & 0 deletions tests/core/domains/interval/codac2_tests_Interval.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,21 @@ def test_interval(self):
self.assertTrue(Interval([-oo,oo]) == Interval(-oo,oo));
self.assertTrue(Interval([oo,-oo]) == Interval.empty());

# An interval is a point or a pair of bounds; any other list length is a
# caller error, reported by the C++ assertion layer as a
# std::invalid_argument, which pybind11 surfaces as a ValueError. A
# FAST_RELEASE build compiles that layer out and leaves the interval
# untouched instead; Python cannot see that switch, so both outcomes are
# accepted here and only the one that actually happened is checked.
for bad_list in ([1.,2.,3.], []):
x = Interval(0.,1.)
try:
x.init_from_list(bad_list)
except ValueError:
pass
else:
self.assertTrue(x == Interval(0.,1.))

x = Interval() ; y = Interval() ; z = Interval()

x = Interval(0,1); x.set_empty()
Expand Down
Loading