diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index a305e8552..ee4626e48 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -52,4 +52,53 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/mathjax_stmaryrd.js endif() + endif() + +# User manual (Sphinx) + + find_package(Sphinx) + + if(NOT SPHINX_FOUND) + + message(STATUS "Sphinx not found, will not be able to generate the manual.") + + else() + + # Includes CMake commands in config file: + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/manual/conf.py.in ${CMAKE_CURRENT_BINARY_DIR}/manual/conf.py) + + set(SPHINX_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/manual) + set(SPHINX_BUILD ${CMAKE_CURRENT_BINARY_DIR}/manual) + + # Copying _static files of Sphinx to build directories + foreach(static_file ${CMAKE_CURRENT_SOURCE_DIR}/manual/_static/) + file(COPY ${static_file} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/manual/_static/) + endforeach() + + # Copying tmp files + foreach(static_file ${CMAKE_CURRENT_SOURCE_DIR}/manual/tmp/) + file(COPY ${static_file} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/manual/tmp/) + endforeach() + + # todo: the SPHINX_EXECUTABLE is already set by FindSphinx.cmake: + # check that it works without the following overload for Win and Linux: + if(WIN32) + set(SPHINX_EXECUTABLE "sphinx-build") + else() + set(SPHINX_EXECUTABLE "python3" "-msphinx") + endif() + + add_custom_target(manual + COMMAND + ${SPHINX_EXECUTABLE} -b html + # Specifying path to conf.py generated by CMake: + -c ${CMAKE_CURRENT_BINARY_DIR}/manual/ + ${SPHINX_SOURCE} ${SPHINX_BUILD} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMENT "Generating the manual website using Sphinx") + + install(DIRECTORY ${SPHINX_BUILD}/ + DESTINATION share/manual/${CMAKE_PROJECT_NAME} + OPTIONAL) + endif() \ No newline at end of file diff --git a/doc/manual/_static/css/custom.css b/doc/manual/_static/css/custom.css new file mode 100644 index 000000000..bf36547f9 --- /dev/null +++ b/doc/manual/_static/css/custom.css @@ -0,0 +1,10 @@ +div.rst-content a:visited +{ + color: #2980b9; + text-decoration: none; +} + +div.rst-content li.toctree-l1 > a +{ + font-weight: bold; +} \ No newline at end of file diff --git a/doc/manual/_static/empty.txt b/doc/manual/_static/empty.txt new file mode 100644 index 000000000..e69de29bb diff --git a/doc/manual/_templates/empty.txt b/doc/manual/_templates/empty.txt new file mode 100644 index 000000000..e69de29bb diff --git a/doc/manual/conf.py.in b/doc/manual/conf.py.in new file mode 100644 index 000000000..e7d94daba --- /dev/null +++ b/doc/manual/conf.py.in @@ -0,0 +1,40 @@ +# Configuration file for the Sphinx documentation builder. +# +# For the full list of built-in configuration values, see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Project information ----------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information + +project = 'Codac' +copyright = 'Codac Team' +author = 'Codac Team' + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +extensions = [ + 'sphinx_rtd_theme', +] + +templates_path = ['_templates'] +exclude_patterns = [] + + +# -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output + +html_static_path = ['_static'] +html_theme = "sphinx_rtd_theme" +html_logo = "_static/logos/logo_codac.svg" + +# These paths are either relative to html_static_path +# or fully qualified paths (eg. https://...) +html_css_files = [ + 'css/custom.css', +] + +html_theme_options = { + 'logo_only': True, + 'display_version': True, +} \ No newline at end of file diff --git a/doc/manual/index.rst b/doc/manual/index.rst new file mode 100644 index 000000000..460fb89b5 --- /dev/null +++ b/doc/manual/index.rst @@ -0,0 +1,51 @@ +Codac manual +============ + + +.. toctree:: + :caption: Overview of Codac + :maxdepth: 3 + + Constraint programming and IA + The Codac framework + Target audience + + +.. toctree:: + :caption: User manual + :maxdepth: 3 + + installation/index.rst + intervals/index.rst + linear/index.rst + functions/index.rst + tubes/index.rst + contractors/index.rst + separators/index.rst + pavers/index.rst + cn/index.rst + geometry/index.rst + ellipsoids/index.rst + topology/index.rst + visualization/index.rst + extensions/index.rst + seealso/index.rst + references/index.rst + + +.. toctree:: + :caption: How-to guides + :maxdepth: 3 + + howto/robotics/index.rst + howto/geometry/index.rst + howto/dynamical/index.rst + + +.. toctree:: + :caption: Development + :maxdepth: 3 + + Changelog + C++ API + Information for developers \ No newline at end of file diff --git a/doc/manual/tmp/empty.txt b/doc/manual/tmp/empty.txt new file mode 100644 index 000000000..e69de29bb diff --git a/doc/doc/tutorial-set4most/01-examples/index.rst b/prev_versions/v1.5.2/doc/doc/tutorial-set4most/01-examples/index.rst similarity index 100% rename from doc/doc/tutorial-set4most/01-examples/index.rst rename to prev_versions/v1.5.2/doc/doc/tutorial-set4most/01-examples/index.rst diff --git a/doc/doc/tutorial-set4most/01-examples/range-only-loc.py b/prev_versions/v1.5.2/doc/doc/tutorial-set4most/01-examples/range-only-loc.py similarity index 100% rename from doc/doc/tutorial-set4most/01-examples/range-only-loc.py rename to prev_versions/v1.5.2/doc/doc/tutorial-set4most/01-examples/range-only-loc.py diff --git a/doc/doc/tutorial-set4most/01-examples/slam.py b/prev_versions/v1.5.2/doc/doc/tutorial-set4most/01-examples/slam.py similarity index 100% rename from doc/doc/tutorial-set4most/01-examples/slam.py rename to prev_versions/v1.5.2/doc/doc/tutorial-set4most/01-examples/slam.py diff --git a/doc/doc/tutorial-set4most/01-examples/triskelion.py b/prev_versions/v1.5.2/doc/doc/tutorial-set4most/01-examples/triskelion.py similarity index 100% rename from doc/doc/tutorial-set4most/01-examples/triskelion.py rename to prev_versions/v1.5.2/doc/doc/tutorial-set4most/01-examples/triskelion.py diff --git a/doc/doc/tutorial-set4most/01-examples/walls-loc.py b/prev_versions/v1.5.2/doc/doc/tutorial-set4most/01-examples/walls-loc.py similarity index 100% rename from doc/doc/tutorial-set4most/01-examples/walls-loc.py rename to prev_versions/v1.5.2/doc/doc/tutorial-set4most/01-examples/walls-loc.py diff --git a/doc/doc/tutorial-set4most/index.rst b/prev_versions/v1.5.2/doc/doc/tutorial-set4most/index.rst similarity index 100% rename from doc/doc/tutorial-set4most/index.rst rename to prev_versions/v1.5.2/doc/doc/tutorial-set4most/index.rst diff --git a/scripts/CMakeModules/FindSphinx.cmake b/scripts/CMakeModules/FindSphinx.cmake new file mode 100644 index 000000000..6190fa010 --- /dev/null +++ b/scripts/CMakeModules/FindSphinx.cmake @@ -0,0 +1,20 @@ +include(FindPackageHandleStandardArgs) + +# We are likely to find Sphinx near the Python interpreter +find_package(PythonInterp) +if(PYTHONINTERP_FOUND) + get_filename_component(_PYTHON_DIR "${PYTHON_EXECUTABLE}" DIRECTORY) + set( + _PYTHON_PATHS + "${_PYTHON_DIR}" + "${_PYTHON_DIR}/bin" + "${_PYTHON_DIR}/Scripts") +endif() + +find_program( + SPHINX_EXECUTABLE + NAMES sphinx-build sphinx-build.exe + HINTS ${_PYTHON_PATHS}) +mark_as_advanced(SPHINX_EXECUTABLE) + +find_package_handle_standard_args(Sphinx DEFAULT_MSG SPHINX_EXECUTABLE) \ No newline at end of file diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index a323bb926..986b0ed20 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -50,7 +50,6 @@ ${CMAKE_CURRENT_SOURCE_DIR}/domains/codac2_BoolInterval.h ${CMAKE_CURRENT_SOURCE_DIR}/domains/codac2_Domain.h - ${CMAKE_CURRENT_SOURCE_DIR}/domains/interval/codac2_Interval.cpp ${CMAKE_CURRENT_SOURCE_DIR}/domains/interval/codac2_Interval.h ${CMAKE_CURRENT_SOURCE_DIR}/domains/interval/codac2_Interval_operations.cpp ${CMAKE_CURRENT_SOURCE_DIR}/domains/interval/codac2_Interval_operations.h diff --git a/src/core/domains/interval/codac2_Interval.cpp b/src/core/domains/interval/codac2_Interval.cpp deleted file mode 100644 index 7f53d83b7..000000000 --- a/src/core/domains/interval/codac2_Interval.cpp +++ /dev/null @@ -1,392 +0,0 @@ -/** - * codac2_Interval.cpp - * - * This class reuses several functions developed for ibex::Interval. - * The original IBEX code is encapsulated in Codac for allowing inheritance - * to Codac classes and also for documentation, binding, and independency purposes. - * See ibex::Interval (IBEX lib, main author: Gilles Chabert) - * https://ibex-lib.readthedocs.io - * - * ---------------------------------------------------------------------------- - * \date 2024 - * \author Gilles Chabert, Simon Rohou - * \copyright Copyright 2024 Codac Team - * \license GNU Lesser General Public License (LGPL) - */ - -#include -#include -#include "codac2_Interval.h" -#include "codac2_assert.h" - -using namespace std; - -namespace codac2 -{ - Interval::Interval() - : ibex::Interval() - { } - - Interval::Interval(double a) - : ibex::Interval(a) - { } - - Interval::Interval(double a, double b) - : ibex::Interval(a,b) - { } - - Interval::Interval(const Interval& x) - : ibex::Interval(x) - { } - - Interval::Interval(array array) - : ibex::Interval(array) - { } - - Interval::Interval(array array) - : ibex::Interval(array) - { } - - Interval::Interval(std::initializer_list l) - : Interval() - { - init_from_list(l); - } - - Interval& Interval::init(const Interval& x) - { - *this = x; - return *this; - } - - Interval& Interval::init_from_list(const std::list& l) - { - assert_release((l.size() == 1 || l.size() == 2) - && "'Interval' can only be defined by one or two 'double' values."); - *this = Interval(*l.begin(),*std::prev(l.end())); - return *this; - } - - Interval& Interval::operator=(const Interval& x) - { - ibex::Interval::operator=(x); - return *this; - } - - bool Interval::operator==(const Interval& x) const - { - return ibex::Interval::operator==(x); - } - - bool Interval::operator!=(const Interval& x) const - { - return ibex::Interval::operator!=(x); - } - - double Interval::lb() const - { - return ibex::Interval::lb(); - } - - double Interval::ub() const - { - return ibex::Interval::ub(); - } - - double Interval::mid() const - { - return ibex::Interval::mid(); - } - - double Interval::mag() const - { - return ibex::Interval::mag(); - } - - double Interval::mig() const - { - return ibex::Interval::mig(); - } - - double Interval::rand() const - { - if(is_empty()) - return std::numeric_limits::quiet_NaN(); - - double a = max(next_float(-oo),lb()); - double b = min(previous_float(oo),ub()); - return a + (((double)std::rand())/(double)RAND_MAX)*(b-a); - } - - double Interval::rad() const - { - return ibex::Interval::rad(); - } - - double Interval::diam() const - { - return ibex::Interval::diam(); - } - - double Interval::volume() const - { - return ibex::Interval::diam(); - } - - Index Interval::size() const - { - return 1; - } - - void Interval::set_empty() - { - ibex::Interval::set_empty(); - } - - bool Interval::is_empty() const - { - return ibex::Interval::is_empty(); - } - - bool Interval::contains(const double& x) const - { - return ibex::Interval::contains(x); - } - - bool Interval::interior_contains(const double& x) const - { - return ibex::Interval::interior_contains(x); - } - - bool Interval::is_unbounded() const - { - return ibex::Interval::is_unbounded(); - } - - bool Interval::is_degenerated() const - { - return ibex::Interval::is_degenerated(); - } - - bool Interval::intersects(const Interval &x) const - { - return ibex::Interval::intersects(x); - } - - bool Interval::is_disjoint(const Interval& x) const - { - return ibex::Interval::is_disjoint(x); - } - - bool Interval::overlaps(const Interval& x) const - { - return ibex::Interval::overlaps(x); - } - - bool Interval::is_subset(const Interval& x) const - { - return ibex::Interval::is_subset(x); - } - - bool Interval::is_strict_subset(const Interval& x) const - { - return ibex::Interval::is_strict_subset(x); - } - - bool Interval::is_interior_subset(const Interval& x) const - { - return ibex::Interval::is_interior_subset(x); - } - - bool Interval::is_strict_interior_subset(const Interval& x) const - { - return ibex::Interval::is_strict_interior_subset(x); - } - - bool Interval::is_superset(const Interval& x) const - { - return ibex::Interval::is_superset(x); - } - - bool Interval::is_strict_superset(const Interval& x) const - { - return ibex::Interval::is_strict_superset(x); - } - - Interval& Interval::inflate(const double& rad) - { - ibex::Interval::inflate(rad); - return *this; - } - - bool Interval::is_bisectable() const - { - return ibex::Interval::is_bisectable(); - } - - pair Interval::bisect(float ratio) const - { - assert_release(Interval(0,1).interior_contains(ratio)); - auto p = ibex::Interval::bisect(ratio); - return { p.first, p.second }; - } - - vector Interval::complementary(bool compactness) const - { - if(is_empty() || (compactness && is_degenerated())) - return { {-oo,oo} }; - - vector l; - - if(lb() > -oo) - l.push_back({-oo,lb()}); - - if(ub() < oo) - l.push_back({ub(),oo}); - - return l; - } - - vector Interval::diff(const Interval& y, bool compactness) const - { - if(compactness && is_degenerated()) - { - if(is_empty() || y.contains(lb())) - return {}; - else - return { *this }; - } - - vector l; - for(const auto& li : y.complementary(compactness)) - { - Interval inter = li & *this; - if(!inter.is_degenerated()) - l.push_back(inter); - } - - return l; - } - - Interval& Interval::operator|=(const Interval& x) - { - ibex::Interval::operator|=(x); - return *this; - } - - Interval& Interval::operator&=(const Interval& x) - { - ibex::Interval::operator&=(x); - return *this; - } - - Interval& Interval::operator+=(double x) - { - ibex::Interval::operator+=(x); - return *this; - } - - Interval& Interval::operator+=(const Interval& x) - { - ibex::Interval::operator+=(x); - return *this; - } - - Interval Interval::operator-() const - { - return 0.-*this; - } - - Interval& Interval::operator-=(double x) - { - ibex::Interval::operator-=(x); - return *this; - } - - Interval& Interval::operator-=(const Interval& x) - { - ibex::Interval::operator-=(x); - return *this; - } - - Interval& Interval::operator*=(double x) - { - ibex::Interval::operator*=(x); - return *this; - } - - Interval& Interval::operator*=(const Interval& x) - { - ibex::Interval::operator*=(x); - return *this; - } - - Interval& Interval::operator/=(double x) - { - ibex::Interval::operator/=(x); - return *this; - } - - Interval& Interval::operator/=(const Interval& x) - { - ibex::Interval::operator/=(x); - return *this; - } - - Interval Interval::empty() - { - return ibex::Interval::empty_set(); - } - - Interval Interval::zero() - { - return ibex::Interval::zero(); - } - - Interval Interval::zeros() - { - return ibex::Interval::zero(); - } - - Interval Interval::one() - { - return ibex::Interval::one(); - } - - Interval Interval::ones() - { - return ibex::Interval::one(); - } - - Interval Interval::half_pi() - { - return ibex::Interval::half_pi(); - } - - Interval Interval::pi() - { - return ibex::Interval::pi(); - } - - Interval Interval::two_pi() - { - return ibex::Interval::two_pi(); - } - - ostream& operator<<(ostream& os, const Interval& x) - { - gaol::interval::precision(os.precision()); - ibex::operator<<(os,x); - return os; - } - - Interval::Interval(const ibex::Interval& x) - : ibex::Interval(x) - { } - - Interval operator""_i(long double x) - { - return Interval(x); - } - -} // namespace codac diff --git a/src/core/domains/interval/codac2_Interval.h b/src/core/domains/interval/codac2_Interval.h index aa6f69a0e..80730c8cf 100644 --- a/src/core/domains/interval/codac2_Interval.h +++ b/src/core/domains/interval/codac2_Interval.h @@ -21,6 +21,7 @@ #include #include "codac2_Index.h" #include "codac2_Domain.h" +#include "codac2_assert.h" namespace codac2 { @@ -511,44 +512,60 @@ namespace codac2 * * \return an empty set */ - static Interval empty(); + static Interval empty() + { + return ibex::Interval::empty_set(); + } /** * \brief Provides an interval for \f$[0]\f$ * * \return an interval containing \f$0\f$ */ - static Interval zero(); - static Interval zeros(); + static Interval zero() + { + return ibex::Interval::zero(); + } /** * \brief Provides an interval for \f$[1]\f$ * * \return an interval containing \f$1\f$ */ - static Interval one(); - static Interval ones(); + static Interval one() + { + return ibex::Interval::one(); + } /** * \brief Provides an interval for \f$[\frac{\pi}{2}]\f$ * * \return an interval containing \f$\frac{\pi}{2}\f$ */ - static Interval half_pi(); + static Interval half_pi() + { + return ibex::Interval::half_pi(); + } /** * \brief Provides an interval for \f$[\pi]\f$ * * \return an interval containing \f$\pi\f$ */ - static Interval pi(); + static Interval pi() + { + return ibex::Interval::pi(); + } /** * \brief Provides an interval for \f$[2\pi]\f$ * * \return an interval containing \f$2\pi\f$ */ - static Interval two_pi(); + static Interval two_pi() + { + return ibex::Interval::two_pi(); + } friend std::ostream& operator<<(std::ostream& os, const Interval& x); @@ -680,3 +697,374 @@ namespace codac2 return ibex::next_float(x); } } + +// Inline functions + +namespace codac2 +{ + inline Interval::Interval() + : ibex::Interval() + { } + + inline Interval::Interval(double a) + : ibex::Interval(a) + { } + + inline Interval::Interval(double a, double b) + : ibex::Interval(a,b) + { } + + inline Interval::Interval(const Interval& x) + : ibex::Interval(x) + { } + + inline Interval::Interval(std::array array) + : ibex::Interval(array) + { } + + inline Interval::Interval(std::array array) + : ibex::Interval(array) + { } + + inline Interval::Interval(std::initializer_list l) + : Interval() + { + init_from_list(l); + } + + inline Interval& Interval::init(const Interval& x) + { + *this = x; + return *this; + } + + inline Interval& Interval::init_from_list(const std::list& l) + { + assert_release((l.size() == 1 || l.size() == 2) + && "'Interval' can only be defined by one or two 'double' values."); + *this = Interval(*l.begin(),*std::prev(l.end())); + return *this; + } + + inline Interval& Interval::operator=(const Interval& x) + { + ibex::Interval::operator=(x); + return *this; + } + + inline bool Interval::operator==(const Interval& x) const + { + return ibex::Interval::operator==(x); + } + + inline bool Interval::operator!=(const Interval& x) const + { + return ibex::Interval::operator!=(x); + } + + inline double Interval::lb() const + { + return ibex::Interval::lb(); + } + + inline double Interval::ub() const + { + return ibex::Interval::ub(); + } + + inline double Interval::mid() const + { + return ibex::Interval::mid(); + } + + inline double Interval::mag() const + { + return ibex::Interval::mag(); + } + + inline double Interval::mig() const + { + return ibex::Interval::mig(); + } + + inline double Interval::rand() const + { + if(is_empty()) + return std::numeric_limits::quiet_NaN(); + + double a = std::max(next_float(-oo),lb()); + double b = std::min(previous_float(oo),ub()); + return a + (((double)std::rand())/(double)RAND_MAX)*(b-a); + } + + inline double Interval::rad() const + { + return ibex::Interval::rad(); + } + + inline double Interval::diam() const + { + return ibex::Interval::diam(); + } + + inline double Interval::volume() const + { + return ibex::Interval::diam(); + } + + inline Index Interval::size() const + { + return 1; + } + + inline void Interval::set_empty() + { + ibex::Interval::set_empty(); + } + + inline bool Interval::is_empty() const + { + return ibex::Interval::is_empty(); + } + + inline bool Interval::contains(const double& x) const + { + return ibex::Interval::contains(x); + } + + inline bool Interval::interior_contains(const double& x) const + { + return ibex::Interval::interior_contains(x); + } + + inline bool Interval::is_unbounded() const + { + return ibex::Interval::is_unbounded(); + } + + inline bool Interval::is_degenerated() const + { + return ibex::Interval::is_degenerated(); + } + + inline bool Interval::intersects(const Interval &x) const + { + return ibex::Interval::intersects(x); + } + + inline bool Interval::is_disjoint(const Interval& x) const + { + return ibex::Interval::is_disjoint(x); + } + + inline bool Interval::overlaps(const Interval& x) const + { + return ibex::Interval::overlaps(x); + } + + inline bool Interval::is_subset(const Interval& x) const + { + return ibex::Interval::is_subset(x); + } + + inline bool Interval::is_strict_subset(const Interval& x) const + { + return ibex::Interval::is_strict_subset(x); + } + + inline bool Interval::is_interior_subset(const Interval& x) const + { + return ibex::Interval::is_interior_subset(x); + } + + inline bool Interval::is_strict_interior_subset(const Interval& x) const + { + return ibex::Interval::is_strict_interior_subset(x); + } + + inline bool Interval::is_superset(const Interval& x) const + { + return ibex::Interval::is_superset(x); + } + + inline bool Interval::is_strict_superset(const Interval& x) const + { + return ibex::Interval::is_strict_superset(x); + } + + inline Interval& Interval::inflate(const double& rad) + { + ibex::Interval::inflate(rad); + return *this; + } + + inline bool Interval::is_bisectable() const + { + return ibex::Interval::is_bisectable(); + } + + inline std::pair Interval::bisect(float ratio) const + { + assert_release(Interval(0,1).interior_contains(ratio)); + auto p = ibex::Interval::bisect(ratio); + return { p.first, p.second }; + } + + inline std::vector Interval::complementary(bool compactness) const + { + if(is_empty() || (compactness && is_degenerated())) + return { {-oo,oo} }; + + std::vector l; + + if(lb() > -oo) + l.push_back({-oo,lb()}); + + if(ub() < oo) + l.push_back({ub(),oo}); + + return l; + } + + inline std::vector Interval::diff(const Interval& y, bool compactness) const + { + if(compactness && is_degenerated()) + { + if(is_empty() || y.contains(lb())) + return {}; + else + return { *this }; + } + + std::vector l; + for(const auto& li : y.complementary(compactness)) + { + Interval inter = li & *this; + if(!inter.is_degenerated()) + l.push_back(inter); + } + + return l; + } + + inline Interval& Interval::operator|=(const Interval& x) + { + ibex::Interval::operator|=(x); + return *this; + } + + inline Interval& Interval::operator&=(const Interval& x) + { + ibex::Interval::operator&=(x); + return *this; + } + + inline Interval& Interval::operator+=(double x) + { + ibex::Interval::operator+=(x); + return *this; + } + + inline Interval& Interval::operator+=(const Interval& x) + { + ibex::Interval::operator+=(x); + return *this; + } + + inline Interval Interval::operator-() const + { + return 0.-*this; + } + + inline Interval& Interval::operator-=(double x) + { + ibex::Interval::operator-=(x); + return *this; + } + + inline Interval& Interval::operator-=(const Interval& x) + { + ibex::Interval::operator-=(x); + return *this; + } + + inline Interval& Interval::operator*=(double x) + { + ibex::Interval::operator*=(x); + return *this; + } + + inline Interval& Interval::operator*=(const Interval& x) + { + ibex::Interval::operator*=(x); + return *this; + } + + inline Interval& Interval::operator/=(double x) + { + ibex::Interval::operator/=(x); + return *this; + } + + inline Interval& Interval::operator/=(const Interval& x) + { + ibex::Interval::operator/=(x); + return *this; + } + + /*static inline Interval Interval::empty() + { + return ibex::Interval::empty_set(); + } + + static inline Interval Interval::zero() + { + return ibex::Interval::zero(); + } + + static inline Interval Interval::zeros() + { + return ibex::Interval::zero(); + } + + static inline Interval Interval::one() + { + return ibex::Interval::one(); + } + + static inline Interval Interval::ones() + { + return ibex::Interval::one(); + } + + static inline Interval Interval::half_pi() + { + return ibex::Interval::half_pi(); + } + + static inline Interval Interval::pi() + { + return ibex::Interval::pi(); + } + + static inline Interval Interval::two_pi() + { + return ibex::Interval::two_pi(); + }*/ + + inline std::ostream& operator<<(std::ostream& os, const Interval& x) + { + gaol::interval::precision(os.precision()); + ibex::operator<<(os,x); + return os; + } + + inline Interval::Interval(const ibex::Interval& x) + : ibex::Interval(x) + { } + + inline Interval operator""_i(long double x) + { + return Interval(x); + } +} \ No newline at end of file diff --git a/src/core/domains/interval/codac2_Interval_operations.cpp b/src/core/domains/interval/codac2_Interval_operations.cpp index 9af5818a6..8b1ce5acc 100644 --- a/src/core/domains/interval/codac2_Interval_operations.cpp +++ b/src/core/domains/interval/codac2_Interval_operations.cpp @@ -21,245 +21,13 @@ using namespace std; namespace codac2 { - const Interval& operator+(const Interval& x) + Interval operator-(double x, const Interval& y) { - return x; + return ibex::operator-(x, y); } - #define interval_arithm_op(f) \ - Interval f(const Interval& x, const Interval& y) \ - { \ - return ibex::f(x, y); \ - } \ - Interval f(double x, const Interval& y) \ - { \ - return ibex::f(x, y); \ - } \ - Interval f(const Interval& x, double y) \ - { \ - return ibex::f(x, y); \ - } \ - - interval_arithm_op(operator&) - interval_arithm_op(operator|) - interval_arithm_op(operator+) - interval_arithm_op(operator-) - interval_arithm_op(operator*) - interval_arithm_op(operator/) - - #define unary_interval_op(f) \ - Interval f(const Interval& x) \ - { \ - return ibex::f(x); \ - } \ - - #define binary_interval_op(f) \ - Interval f(const Interval& x, const Interval& y) \ - { \ - return ibex::f(x, y); \ - } \ - - unary_interval_op(sqr) - unary_interval_op(sqrt) - - Interval pow(const Interval& x, int n) - { - return ibex::pow(x, n); - } - - Interval pow(const Interval& x, double d) - { - return ibex::pow(x, d); - } - - binary_interval_op(pow) - - Interval root(const Interval& x, int n) - { - return ibex::root(x, n); - } - - unary_interval_op(exp) - unary_interval_op(log) - unary_interval_op(cos) - unary_interval_op(sin) - unary_interval_op(tan) - unary_interval_op(acos) - unary_interval_op(asin) - unary_interval_op(atan) - binary_interval_op(atan2) - unary_interval_op(cosh) - unary_interval_op(sinh) - unary_interval_op(tanh) - unary_interval_op(acosh) - unary_interval_op(asinh) - unary_interval_op(atanh) - unary_interval_op(abs) - binary_interval_op(min) - binary_interval_op(max) - unary_interval_op(sign) - unary_interval_op(integer) - unary_interval_op(floor) - unary_interval_op(ceil) - - void bwd_add(const Interval& y, Interval& x1, Interval& x2) - { - ibex::bwd_add(y,x1,x2); - } - - void bwd_sub(const Interval& y, Interval& x1, Interval& x2) - { - ibex::bwd_sub(y,x1,x2); - } - - void bwd_mul(const Interval& y, Interval& x1, Interval& x2) - { - ibex::bwd_mul(y,x1,x2); - } - - void bwd_div(const Interval& y, Interval& x1, Interval& x2) - { - ibex::bwd_div(y,x1,x2); - } - - void bwd_sqr(const Interval& y, Interval& x) - { - ibex::bwd_sqr(y,x); - } - - void bwd_sqrt(const Interval& y, Interval& x) - { - ibex::bwd_sqrt(y,x); - } - - void bwd_pow(const Interval& y, Interval& x, int p) - { - ibex::bwd_pow(y,p,x); - } - - void bwd_pow(const Interval& y, Interval& x, Interval& p) - { - assert(p.is_degenerated() && "bwd_power(y,x1,x2) (with x1 and x2 intervals) not implemented yet with Gaol"); - ibex::bwd_pow(y,p.mid(),x); - } - - void bwd_root(const Interval& y, Interval& x, int p) - { - ibex::bwd_root(y,p,x); - } - - void bwd_exp(const Interval& y, Interval& x) - { - ibex::bwd_exp(y,x); - } - - void bwd_log(const Interval& y, Interval& x) - { - ibex::bwd_log(y,x); - } - - void bwd_cos(const Interval& y, Interval& x) - { - ibex::bwd_cos(y,x); - } - - void bwd_sin(const Interval& y, Interval& x) - { - ibex::bwd_sin(y,x); - } - - void bwd_tan(const Interval& y, Interval& x) - { - ibex::bwd_tan(y,x); - } - - void bwd_acos(const Interval& y, Interval& x) - { - ibex::bwd_acos(y,x); - } - - void bwd_asin(const Interval& y, Interval& x) - { - ibex::bwd_asin(y,x); - } - - void bwd_atan(const Interval& y, Interval& x) - { - ibex::bwd_atan(y,x); - } - - void bwd_atan2(const Interval& y, Interval& x1, Interval& x2) - { - ibex::bwd_atan2(y,x1,x2); - } - - void bwd_cosh(const Interval& y, Interval& x) - { - ibex::bwd_cosh(y,x); - } - - void bwd_sinh(const Interval& y, Interval& x) - { - ibex::bwd_sinh(y,x); - } - - void bwd_tanh(const Interval& y, Interval& x) - { - ibex::bwd_tanh(y,x); - } - - void bwd_acosh(const Interval& y, Interval& x) - { - ibex::bwd_acosh(y,x); - } - - void bwd_asinh(const Interval& y, Interval& x) - { - ibex::bwd_asinh(y,x); - } - - void bwd_atanh(const Interval& y, Interval& x) - { - ibex::bwd_atanh(y,x); - } - - void bwd_abs(const Interval& y, Interval& x) - { - ibex::bwd_abs(y,x); - } - - void bwd_min(const Interval& y, Interval& x1, Interval& x2) - { - ibex::bwd_min(y,x1,x2); - } - - void bwd_max(const Interval& y, Interval& x1, Interval& x2) - { - ibex::bwd_max(y,x1,x2); - } - - void bwd_sign(const Interval& y, Interval& x) - { - ibex::bwd_sign(y,x); - } - - void bwd_floor(const Interval& y, Interval& x) - { - ibex::bwd_floor(y,x); - } - - void bwd_ceil(const Interval& y, Interval& x) - { - ibex::bwd_ceil(y,x); - } - - void bwd_saw(const Interval& y, Interval& x) - { - ibex::bwd_saw(y,x); - } - - void bwd_imod(Interval& x, Interval& y, double p) + Interval operator-(const Interval& x, double y) { - ibex::bwd_imod(x,y,p); + return ibex::operator-(x, y); } -} // namespace codac \ No newline at end of file +} \ No newline at end of file diff --git a/src/core/domains/interval/codac2_Interval_operations.h b/src/core/domains/interval/codac2_Interval_operations.h index 10cb30942..3a27fd101 100644 --- a/src/core/domains/interval/codac2_Interval_operations.h +++ b/src/core/domains/interval/codac2_Interval_operations.h @@ -29,7 +29,10 @@ namespace codac2 * \param y interval value * \return intersection result */ - Interval operator&(const Interval& x, const Interval& y); + inline Interval operator&(const Interval& x, const Interval& y) + { + return ibex::operator&(x,y); + } /** * \brief Returns the squared-union of two intervals: \f$[x]\sqcup[y]\f$ @@ -40,7 +43,10 @@ namespace codac2 * \param y interval value * \return squared-union result */ - Interval operator|(const Interval& x, const Interval& y); + inline Interval operator|(const Interval& x, const Interval& y) + { + return ibex::operator|(x,y); + } /** * \brief Returns this @@ -50,7 +56,10 @@ namespace codac2 * \param x interval value * \return the same interval */ - const Interval& operator+(const Interval& x); + inline const Interval& operator+(const Interval& x) + { + return x; + } /** * \brief Returns \f$[x]+y\f$ with \f$y\in\mathbb{R}\f$ @@ -59,7 +68,10 @@ namespace codac2 * \param y real value * \return the addition result */ - Interval operator+(const Interval& x, double y); + inline Interval operator+(const Interval& x, double y) + { + return ibex::operator+(x,y); + } /** * \brief Returns \f$x+[y]\f$ with \f$x\in\mathbb{R}\f$ @@ -68,7 +80,10 @@ namespace codac2 * \param y interval value * \return the addition result */ - Interval operator+(double x, const Interval& y); + inline Interval operator+(double x, const Interval& y) + { + return ibex::operator+(x,y); + } /** * \brief Returns \f$[x]+[y]\f$ @@ -77,7 +92,10 @@ namespace codac2 * \param y interval value * \return the addition result */ - Interval operator+(const Interval& x, const Interval& y); + inline Interval operator+(const Interval& x, const Interval& y) + { + return ibex::operator+(x,y); + } /** * \brief Returns \f$[x]-y\f$ with \f$y\in\mathbb{R}\f$ @@ -104,7 +122,10 @@ namespace codac2 * \param y interval value * \return the substraction result */ - Interval operator-(const Interval& x, const Interval& y); + inline Interval operator-(const Interval& x, const Interval& y) + { + return ibex::operator-(x, y); + } /** * \brief Returns \f$[x]*y\f$ with \f$y\in\mathbb{R}\f$ @@ -113,7 +134,10 @@ namespace codac2 * \param y real value * \return the multiplication result */ - Interval operator*(const Interval& x, double y); + inline Interval operator*(const Interval& x, double y) + { + return ibex::operator*(x,y); + } /** * \brief Returns \f$x*[y]\f$ with \f$x\in\mathbb{R}\f$ @@ -122,7 +146,10 @@ namespace codac2 * \param y interval value * \return the multiplication result */ - Interval operator*(double x, const Interval& y); + inline Interval operator*(double x, const Interval& y) + { + return ibex::operator*(x,y); + } /** * \brief Returns \f$[x]*[y]\f$ @@ -131,7 +158,10 @@ namespace codac2 * \param y interval value * \return the multiplication result */ - Interval operator*(const Interval& x, const Interval& y); + inline Interval operator*(const Interval& x, const Interval& y) + { + return ibex::operator*(x,y); + } /** * \brief Returns \f$[x]/y\f$ with \f$y\in\mathbb{R}\f$ @@ -140,7 +170,10 @@ namespace codac2 * \param y real value * \return the division result */ - Interval operator/(const Interval& x, double y); + inline Interval operator/(const Interval& x, double y) + { + return ibex::operator/(x,y); + } /** * \brief Returns \f$x/[y]\f$ with \f$x\in\mathbb{R}\f$ @@ -149,7 +182,10 @@ namespace codac2 * \param y interval value * \return the division result */ - Interval operator/(double x, const Interval& y); + inline Interval operator/(double x, const Interval& y) + { + return ibex::operator/(x,y); + } /** * \brief Returns \f$[x]/[y]\f$ @@ -158,7 +194,10 @@ namespace codac2 * \param y interval value * \return the division result */ - Interval operator/(const Interval& x, const Interval& y); + inline Interval operator/(const Interval& x, const Interval& y) + { + return ibex::operator/(x,y); + } /** * \brief Returns \f$[x]^2\f$ @@ -166,7 +205,10 @@ namespace codac2 * \param x interval value * \return the operation result */ - Interval sqr(const Interval& x); + inline Interval sqr(const Interval& x) + { + return ibex::sqr(x); + } /** * \brief Returns \f$\sqrt{[x]}\f$ @@ -174,7 +216,10 @@ namespace codac2 * \param x interval value * \return the operation result */ - Interval sqrt(const Interval& x); + inline Interval sqrt(const Interval& x) + { + return ibex::sqrt(x); + } /** * \brief Returns \f$[x]^n\f$, \f$n\in\mathbb{Z}\f$ @@ -183,7 +228,10 @@ namespace codac2 * \param n integer power value * \return the operation result */ - Interval pow(const Interval& x, int n); + inline Interval pow(const Interval& x, int n) + { + return ibex::pow(x,n); + } /** * \brief Returns \f$[x]^d\f$, \f$d\in\mathbb{R}\f$ @@ -192,7 +240,10 @@ namespace codac2 * \param d real power value * \return the operation result */ - Interval pow(const Interval& x, double d); + inline Interval pow(const Interval& x, double d) + { + return ibex::pow(x,d); + } /** * \brief Returns \f$[x]^{[y]}\f$, \f$y\in\mathbb{IR}\f$ @@ -201,7 +252,10 @@ namespace codac2 * \param y interval power value * \return the operation result */ - Interval pow(const Interval& x, const Interval& y); + inline Interval pow(const Interval& x, const Interval& y) + { + return ibex::pow(x,y); + } /** * \brief Returns the n-th root: \f$\sqrt[n]{[x]}\f$ @@ -210,7 +264,10 @@ namespace codac2 * \param n integer root * \return the operation result */ - Interval root(const Interval& x, int n); + inline Interval root(const Interval& x, int n) + { + return ibex::root(x,n); + } /** * \brief Returns \f$\exp([x])\f$ @@ -218,7 +275,10 @@ namespace codac2 * \param x interval value * \return the operation result */ - Interval exp(const Interval& x); + inline Interval exp(const Interval& x) + { + return ibex::exp(x); + } /** * \brief Returns \f$\log([x])\f$ @@ -226,7 +286,10 @@ namespace codac2 * \param x interval value * \return the operation result */ - Interval log(const Interval& x); + inline Interval log(const Interval& x) + { + return ibex::log(x); + } /** * \brief Returns \f$\cos([x])\f$ @@ -234,7 +297,10 @@ namespace codac2 * \param x interval value * \return the operation result */ - Interval cos(const Interval& x); + inline Interval cos(const Interval& x) + { + return ibex::cos(x); + } /** * \brief Returns \f$\sin([x])\f$ @@ -242,7 +308,10 @@ namespace codac2 * \param x interval value * \return the operation result */ - Interval sin(const Interval& x); + inline Interval sin(const Interval& x) + { + return ibex::sin(x); + } /** * \brief Returns \f$\tan([x])\f$ @@ -250,7 +319,10 @@ namespace codac2 * \param x interval value * \return the operation result */ - Interval tan(const Interval& x); + inline Interval tan(const Interval& x) + { + return ibex::tan(x); + } /** * \brief Returns \f$\acos([x])\f$ @@ -258,7 +330,10 @@ namespace codac2 * \param x interval value * \return the operation result */ - Interval acos(const Interval& x); + inline Interval acos(const Interval& x) + { + return ibex::acos(x); + } /** * \brief Returns \f$\asin([x])\f$ @@ -266,7 +341,10 @@ namespace codac2 * \param x interval value * \return the operation result */ - Interval asin(const Interval& x); + inline Interval asin(const Interval& x) + { + return ibex::asin(x); + } /** * \brief Returns \f$\atan([x])\f$ @@ -274,7 +352,10 @@ namespace codac2 * \param x interval value * \return the operation result */ - Interval atan(const Interval& x); + inline Interval atan(const Interval& x) + { + return ibex::atan(x); + } /** * \brief Returns \f$\mathrm{arctan2}([y],[x])\f$ @@ -283,7 +364,10 @@ namespace codac2 * \param x interval value * \return the operation result */ - Interval atan2(const Interval& y, const Interval& x); + inline Interval atan2(const Interval& y, const Interval& x) + { + return ibex::atan2(y,x); + } /** * \brief Returns \f$\cosh([x])\f$ @@ -291,7 +375,10 @@ namespace codac2 * \param x interval value * \return the operation result */ - Interval cosh(const Interval& x); + inline Interval cosh(const Interval& x) + { + return ibex::cosh(x); + } /** * \brief Returns \f$\sinh([x])\f$ @@ -299,7 +386,10 @@ namespace codac2 * \param x interval value * \return the operation result */ - Interval sinh(const Interval& x); + inline Interval sinh(const Interval& x) + { + return ibex::sinh(x); + } /** * \brief Returns \f$\tanh([x])\f$ @@ -307,7 +397,10 @@ namespace codac2 * \param x interval value * \return the operation result */ - Interval tanh(const Interval& x); + inline Interval tanh(const Interval& x) + { + return ibex::tanh(x); + } /** * \brief Returns \f$\acosh([x])\f$ @@ -315,7 +408,10 @@ namespace codac2 * \param x interval value * \return the operation result */ - Interval acosh(const Interval& x); + inline Interval acosh(const Interval& x) + { + return ibex::acosh(x); + } /** * \brief Returns \f$\asinh([x])\f$ @@ -323,7 +419,10 @@ namespace codac2 * \param x interval value * \return the operation result */ - Interval asinh(const Interval& x); + inline Interval asinh(const Interval& x) + { + return ibex::asinh(x); + } /** * \brief Returns \f$\atanh([x])\f$ @@ -331,7 +430,10 @@ namespace codac2 * \param x interval value * \return the operation result */ - Interval atanh(const Interval& x); + inline Interval atanh(const Interval& x) + { + return ibex::atanh(x); + } /** * \brief Returns \f$\mid[x]\mid = \left\{\mid x \mid, x\in[x]\right\}\f$ @@ -339,7 +441,10 @@ namespace codac2 * \param x interval value * \return the operation result */ - Interval abs(const Interval& x); + inline Interval abs(const Interval& x) + { + return ibex::abs(x); + } /** * \brief Returns \f$\min([x],[y])=\left\{\min(x,y), x\in[x], y\in[y]\right\}\f$ @@ -348,7 +453,10 @@ namespace codac2 * \param y interval value * \return the operation result */ - Interval min(const Interval& x, const Interval& y); + inline Interval min(const Interval& x, const Interval& y) + { + return ibex::min(x,y); + } /** * \brief Returns \f$\max([x],[y])=\left\{\max(x,y), x\in[x], y\in[y]\right\}\f$ @@ -357,7 +465,10 @@ namespace codac2 * \param y interval value * \return the operation result */ - Interval max(const Interval& x, const Interval& y); + inline Interval max(const Interval& x, const Interval& y) + { + return ibex::max(x,y); + } /** * \brief Returns \f$\sign([x])=\left[\left\{\sign(x), x\in[x]\right\}\right]\f$ @@ -367,7 +478,10 @@ namespace codac2 * \param x interval value * \return the operation result */ - Interval sign(const Interval& x); + inline Interval sign(const Interval& x) + { + return ibex::sign(x); + } /** * \brief Returns the largest integer interval included in \f$[x]\f$ @@ -375,7 +489,10 @@ namespace codac2 * \param x interval value * \return the operation result */ - Interval integer(const Interval& x); + inline Interval integer(const Interval& x) + { + return ibex::integer(x); + } /** * \brief Returns floor of \f$[x]\f$ @@ -383,7 +500,10 @@ namespace codac2 * \param x interval value * \return the operation result */ - Interval floor(const Interval& x); + inline Interval floor(const Interval& x) + { + return ibex::floor(x); + } /** * \brief Returns ceil of \f$[x]\f$ @@ -391,7 +511,10 @@ namespace codac2 * \param x interval value * \return the operation result */ - Interval ceil(const Interval& x); + inline Interval ceil(const Interval& x) + { + return ibex::ceil(x); + } /** * \brief Computes the backward (reverse) addition @@ -403,7 +526,10 @@ namespace codac2 * \param x1 prior value for \f$[x_1]\f$, may be contracted * \param x2 prior value for \f$[x_2]\f$, may be contracted */ - void bwd_add(const Interval& y, Interval& x1, Interval& x2); + inline void bwd_add(const Interval& y, Interval& x1, Interval& x2) + { + ibex::bwd_add(y,x1,x2); + } /** * \brief Computes the backward (reverse) substraction @@ -415,7 +541,10 @@ namespace codac2 * \param x1 prior value for \f$[x_1]\f$, may be contracted * \param x2 prior value for \f$[x_2]\f$, may be contracted */ - void bwd_sub(const Interval& y, Interval& x1, Interval& x2); + inline void bwd_sub(const Interval& y, Interval& x1, Interval& x2) + { + ibex::bwd_sub(y,x1,x2); + } /** * \brief Computes the backward (reverse) multiplication @@ -427,7 +556,10 @@ namespace codac2 * \param x1 prior value for \f$[x_1]\f$, may be contracted * \param x2 prior value for \f$[x_2]\f$, may be contracted */ - void bwd_mul(const Interval& y, Interval& x1, Interval& x2); + inline void bwd_mul(const Interval& y, Interval& x1, Interval& x2) + { + ibex::bwd_mul(y,x1,x2); + } /** * \brief Computes the backward (reverse) division @@ -439,7 +571,10 @@ namespace codac2 * \param x1 prior value for \f$[x_1]\f$, may be contracted * \param x2 prior value for \f$[x_2]\f$, may be contracted */ - void bwd_div(const Interval& y, Interval& x1, Interval& x2); + inline void bwd_div(const Interval& y, Interval& x1, Interval& x2) + { + ibex::bwd_div(y,x1,x2); + } /** * \brief Computes the backward (reverse) squared operation @@ -450,7 +585,10 @@ namespace codac2 * \param y interval value (result of the forward operation) * \param x prior value for \f$[x]\f$, may be contracted */ - void bwd_sqr(const Interval& y, Interval& x); + inline void bwd_sqr(const Interval& y, Interval& x) + { + ibex::bwd_sqr(y,x); + } /** * \brief Computes the backward (reverse) squared-root operation @@ -461,7 +599,10 @@ namespace codac2 * \param y interval value (result of the forward operation) * \param x prior value for \f$[x]\f$, may be contracted */ - void bwd_sqrt(const Interval& y, Interval& x); + inline void bwd_sqrt(const Interval& y, Interval& x) + { + ibex::bwd_sqrt(y,x); + } /** * \brief Computes the backward (reverse) power operation @@ -473,7 +614,10 @@ namespace codac2 * \param x prior value for \f$[x]\f$, may be contracted * \param p power integer value */ - void bwd_pow(const Interval& y, Interval& x, int p); + inline void bwd_pow(const Interval& y, Interval& x, int p) + { + ibex::bwd_pow(y,p,x); + } /** * \brief Computes the backward (reverse) power operation @@ -485,7 +629,11 @@ namespace codac2 * \param x prior value for \f$[x]\f$, may be contracted * \param p prior value for \f$[p]\f$, may be contracted */ - void bwd_pow(const Interval& y, Interval& x, Interval& p); + inline void bwd_pow(const Interval& y, Interval& x, Interval& p) + { + assert(p.is_degenerated() && "bwd_power(y,x1,x2) (with x1 and x2 intervals) not implemented yet with Gaol"); + ibex::bwd_pow(y,p.mid(),x); + } /** * \brief Computes the backward (reverse) root operation @@ -497,7 +645,10 @@ namespace codac2 * \param x prior value for \f$[x]\f$, may be contracted * \param p root integer value */ - void bwd_root(const Interval& y, Interval& x, int p); + inline void bwd_root(const Interval& y, Interval& x, int p) + { + ibex::bwd_root(y,p,x); + } /** * \brief Computes the backward (reverse) exponential operation @@ -508,7 +659,10 @@ namespace codac2 * \param y interval value (result of the forward operation) * \param x prior value for \f$[x]\f$, may be contracted */ - void bwd_exp(const Interval& y, Interval& x); + inline void bwd_exp(const Interval& y, Interval& x) + { + ibex::bwd_exp(y,x); + } /** * \brief Computes the backward (reverse) logarithmic operation @@ -519,7 +673,10 @@ namespace codac2 * \param y interval value (result of the forward operation) * \param x prior value for \f$[x]\f$, may be contracted */ - void bwd_log(const Interval& y, Interval& x); + inline void bwd_log(const Interval& y, Interval& x) + { + ibex::bwd_log(y,x); + } /** * \brief Computes the backward (reverse) cosine operation @@ -530,7 +687,10 @@ namespace codac2 * \param y interval value (result of the forward operation) * \param x prior value for \f$[x]\f$, may be contracted */ - void bwd_cos(const Interval& y, Interval& x); + inline void bwd_cos(const Interval& y, Interval& x) + { + ibex::bwd_cos(y,x); + } /** * \brief Computes the backward (reverse) sine operation @@ -541,7 +701,10 @@ namespace codac2 * \param y interval value (result of the forward operation) * \param x prior value for \f$[x]\f$, may be contracted */ - void bwd_sin(const Interval& y, Interval& x); + inline void bwd_sin(const Interval& y, Interval& x) + { + ibex::bwd_sin(y,x); + } /** * \brief Computes the backward (reverse) tangent operation @@ -552,7 +715,10 @@ namespace codac2 * \param y interval value (result of the forward operation) * \param x prior value for \f$[x]\f$, may be contracted */ - void bwd_tan(const Interval& y, Interval& x); + inline void bwd_tan(const Interval& y, Interval& x) + { + ibex::bwd_tan(y,x); + } /** * \brief Computes the backward (reverse) arccos operation @@ -563,7 +729,10 @@ namespace codac2 * \param y interval value (result of the forward operation) * \param x prior value for \f$[x]\f$, may be contracted */ - void bwd_acos(const Interval& y, Interval& x); + inline void bwd_acos(const Interval& y, Interval& x) + { + ibex::bwd_acos(y,x); + } /** * \brief Computes the backward (reverse) arcsin operation @@ -574,7 +743,10 @@ namespace codac2 * \param y interval value (result of the forward operation) * \param x prior value for \f$[x]\f$, may be contracted */ - void bwd_asin(const Interval& y, Interval& x); + inline void bwd_asin(const Interval& y, Interval& x) + { + ibex::bwd_asin(y,x); + } /** * \brief Computes the backward (reverse) arctan operation @@ -585,7 +757,10 @@ namespace codac2 * \param y interval value (result of the forward operation) * \param x prior value for \f$[x]\f$, may be contracted */ - void bwd_atan(const Interval& y, Interval& x); + inline void bwd_atan(const Interval& y, Interval& x) + { + ibex::bwd_atan(y,x); + } /** * \brief Computes the backward (reverse) arctan2 operation @@ -597,7 +772,10 @@ namespace codac2 * \param x1 prior value for \f$[x_1]\f$, may be contracted * \param x2 prior value for \f$[x_2]\f$, may be contracted */ - void bwd_atan2(const Interval& y, Interval& x1, Interval& x2); + inline void bwd_atan2(const Interval& y, Interval& x1, Interval& x2) + { + ibex::bwd_atan2(y,x1,x2); + } /** * \brief Computes the backward (reverse) hyperbolic cosine operation @@ -608,7 +786,10 @@ namespace codac2 * \param y interval value (result of the forward operation) * \param x prior value for \f$[x]\f$, may be contracted */ - void bwd_cosh(const Interval& y, Interval& x); + inline void bwd_cosh(const Interval& y, Interval& x) + { + ibex::bwd_cosh(y,x); + } /** * \brief Computes the backward (reverse) hyperbolic sine operation @@ -619,7 +800,10 @@ namespace codac2 * \param y interval value (result of the forward operation) * \param x prior value for \f$[x]\f$, may be contracted */ - void bwd_sinh(const Interval& y, Interval& x); + inline void bwd_sinh(const Interval& y, Interval& x) + { + ibex::bwd_sinh(y,x); + } /** * \brief Computes the backward (reverse) hyperbolic tangent operation @@ -630,7 +814,10 @@ namespace codac2 * \param y interval value (result of the forward operation) * \param x prior value for \f$[x]\f$, may be contracted */ - void bwd_tanh(const Interval& y, Interval& x); + inline void bwd_tanh(const Interval& y, Interval& x) + { + ibex::bwd_tanh(y,x); + } /** * \brief Computes the backward (reverse) hyperbolic arccos operation @@ -641,7 +828,10 @@ namespace codac2 * \param y interval value (result of the forward operation) * \param x prior value for \f$[x]\f$, may be contracted */ - void bwd_acosh(const Interval& y, Interval& x); + inline void bwd_acosh(const Interval& y, Interval& x) + { + ibex::bwd_acosh(y,x); + } /** * \brief Computes the backward (reverse) hyperbolic arcsin operation @@ -652,7 +842,10 @@ namespace codac2 * \param y interval value (result of the forward operation) * \param x prior value for \f$[x]\f$, may be contracted */ - void bwd_asinh(const Interval& y, Interval& x); + inline void bwd_asinh(const Interval& y, Interval& x) + { + ibex::bwd_asinh(y,x); + } /** * \brief Computes the backward (reverse) hyperbolic arctan operation @@ -663,7 +856,10 @@ namespace codac2 * \param y interval value (result of the forward operation) * \param x prior value for \f$[x]\f$, may be contracted */ - void bwd_atanh(const Interval& y, Interval& x); + inline void bwd_atanh(const Interval& y, Interval& x) + { + ibex::bwd_atanh(y,x); + } /** * \brief Computes the backward (reverse) absolute-value operation @@ -674,7 +870,10 @@ namespace codac2 * \param y interval value (result of the forward operation) * \param x prior value for \f$[x]\f$, may be contracted */ - void bwd_abs(const Interval& y, Interval& x); + inline void bwd_abs(const Interval& y, Interval& x) + { + ibex::bwd_abs(y,x); + } /** * \brief Computes the backward (reverse) of the max operation @@ -686,7 +885,10 @@ namespace codac2 * \param x1 prior value for \f$[x_1]\f$, may be contracted * \param x2 prior value for \f$[x_2]\f$, may be contracted */ - void bwd_min(const Interval& y, Interval& x1, Interval& x2); + inline void bwd_min(const Interval& y, Interval& x1, Interval& x2) + { + ibex::bwd_min(y,x1,x2); + } /** * \brief Computes the backward (reverse) of the min operation @@ -698,7 +900,10 @@ namespace codac2 * \param x1 prior value for \f$[x_1]\f$, may be contracted * \param x2 prior value for \f$[x_2]\f$, may be contracted */ - void bwd_max(const Interval& y, Interval& x1, Interval& x2); + inline void bwd_max(const Interval& y, Interval& x1, Interval& x2) + { + ibex::bwd_max(y,x1,x2); + } /** * \brief Computes the backward (reverse) sign operation @@ -709,7 +914,10 @@ namespace codac2 * \param y interval value (result of the forward operation) * \param x prior value for \f$[x]\f$, may be contracted */ - void bwd_sign(const Interval& y, Interval& x); + inline void bwd_sign(const Interval& y, Interval& x) + { + ibex::bwd_sign(y,x); + } /** * \brief Computes the backward (reverse) floor operation @@ -720,7 +928,10 @@ namespace codac2 * \param y interval value (result of the forward operation) * \param x prior value for \f$[x]\f$, may be contracted */ - void bwd_floor(const Interval& y, Interval& x); + inline void bwd_floor(const Interval& y, Interval& x) + { + ibex::bwd_floor(y,x); + } /** * \brief Computes the backward (reverse) ceil operation @@ -731,7 +942,10 @@ namespace codac2 * \param y interval value (result of the forward operation) * \param x prior value for \f$[x]\f$, may be contracted */ - void bwd_ceil(const Interval& y, Interval& x); + inline void bwd_ceil(const Interval& y, Interval& x) + { + ibex::bwd_ceil(y,x); + } /** * \brief Contract \f$[x_1]\f$ and \f$[x_2]\f$ w.r.t. the fact that they are equivalent modulo the period \f$p\f$ @@ -740,6 +954,9 @@ namespace codac2 * \param x2 prior value for \f$[x_2]\f$, may be contracted * \param p period value */ - void bwd_imod(Interval& x1, Interval& x2, double p); + inline void bwd_imod(Interval& x1, Interval& x2, double p) + { + ibex::bwd_imod(x1,x2,p); + } } \ No newline at end of file