feat: add module mp_units
This commit is contained in:
1 parent
f3ad392123
commit
7cb2099af5
92 files changed
+754
-141
No files matched your search
@@ -25,7 +25,12 @@ cmake_minimum_required(VERSION 3.5)
|
||||
find_package(Catch2 3 CONFIG REQUIRED)
|
||||
|
||||
add_executable(unit_tests_runtime distribution_test.cpp fmt_test.cpp math_test.cpp)
|
||||
target_link_libraries(unit_tests_runtime PRIVATE mp-units::mp-units Catch2::Catch2WithMain)
|
||||
if(TARGET mp-units::modules)
|
||||
target_link_libraries(unit_tests_runtime PRIVATE mp-units::modules)
|
||||
else()
|
||||
target_link_libraries(unit_tests_runtime PRIVATE mp-units::mp-units)
|
||||
endif()
|
||||
target_link_libraries(unit_tests_runtime PRIVATE Catch2::Catch2WithMain)
|
||||
|
||||
if(${projectPrefix}BUILD_LA)
|
||||
find_package(wg21_linear_algebra CONFIG REQUIRED)
|
||||
|
||||
@@ -21,9 +21,14 @@
|
||||
// SOFTWARE.
|
||||
|
||||
#include <catch2/matchers/catch_matchers_templated.hpp>
|
||||
#include <mp-units/bits/fmt_hacks.h>
|
||||
#include <algorithm>
|
||||
#ifdef MP_UNITS_MODULES
|
||||
import mp_units;
|
||||
#else
|
||||
#include <mp-units/format.h>
|
||||
#include <mp-units/quantity.h>
|
||||
#include <algorithm>
|
||||
#endif
|
||||
|
||||
namespace mp_units {
|
||||
|
||||
|
||||
@@ -21,14 +21,18 @@
|
||||
// SOFTWARE.
|
||||
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
#include <mp-units/ostream.h>
|
||||
#include <mp-units/random.h>
|
||||
#include <mp-units/systems/si/unit_symbols.h>
|
||||
#include <mp-units/systems/si/units.h>
|
||||
#include <array>
|
||||
#include <initializer_list>
|
||||
#include <random>
|
||||
#include <vector>
|
||||
#ifdef MP_UNITS_MODULES
|
||||
import mp_units;
|
||||
#else
|
||||
#include <mp-units/ostream.h>
|
||||
#include <mp-units/random.h>
|
||||
#include <mp-units/systems/si/unit_symbols.h>
|
||||
#include <mp-units/systems/si/units.h>
|
||||
#endif
|
||||
|
||||
|
||||
using namespace mp_units;
|
||||
|
||||
@@ -22,6 +22,13 @@
|
||||
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
#include <catch2/matchers/catch_matchers_exception.hpp>
|
||||
#include <mp-units/bits/fmt_hacks.h>
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <locale>
|
||||
#ifdef MP_UNITS_MODULES
|
||||
import mp_units;
|
||||
#else
|
||||
#include <mp-units/customization_points.h>
|
||||
#include <mp-units/format.h>
|
||||
#include <mp-units/ostream.h>
|
||||
@@ -29,9 +36,7 @@
|
||||
#include <mp-units/systems/isq/mechanics.h>
|
||||
#include <mp-units/systems/isq/space_and_time.h>
|
||||
#include <mp-units/systems/si/si.h>
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <locale>
|
||||
#endif
|
||||
|
||||
template<class T>
|
||||
requires mp_units::is_scalar<T>
|
||||
|
||||
@@ -21,6 +21,12 @@
|
||||
// SOFTWARE.
|
||||
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
#include <mp-units/bits/fmt_hacks.h>
|
||||
#include <cmath>
|
||||
#include <matrix>
|
||||
#ifdef MP_UNITS_MODULES
|
||||
import mp_units;
|
||||
#else
|
||||
#include <mp-units/customization_points.h>
|
||||
#include <mp-units/format.h>
|
||||
#include <mp-units/math.h>
|
||||
@@ -28,8 +34,7 @@
|
||||
#include <mp-units/systems/isq/mechanics.h>
|
||||
#include <mp-units/systems/isq/space_and_time.h>
|
||||
#include <mp-units/systems/si/si.h>
|
||||
#include <cmath>
|
||||
#include <matrix>
|
||||
#endif
|
||||
|
||||
template<typename Rep = double>
|
||||
using vector = STD_LA::fixed_size_column_vector<Rep, 3>;
|
||||
|
||||
@@ -22,13 +22,17 @@
|
||||
|
||||
#include "almost_equals.h"
|
||||
#include <catch2/catch_all.hpp>
|
||||
#include <limits>
|
||||
#ifdef MP_UNITS_MODULES
|
||||
import mp_units;
|
||||
#else
|
||||
#include <mp-units/math.h>
|
||||
#include <mp-units/ostream.h>
|
||||
#include <mp-units/systems/angular/angular.h>
|
||||
#include <mp-units/systems/isq/space_and_time.h>
|
||||
#include <mp-units/systems/si/unit_symbols.h>
|
||||
#include <mp-units/systems/si/units.h>
|
||||
#include <limits>
|
||||
#endif
|
||||
|
||||
using namespace mp_units;
|
||||
using namespace mp_units::si::unit_symbols;
|
||||
|
||||
Reference in new issue
Block a user