-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
336 changed files
with
1,430 additions
and
855 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 was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
22 changes: 11 additions & 11 deletions
22
include/dimensional/systems/si/base_units/fwd/si_base_units.hpp
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 was deleted.
Oops, something went wrong.
6 changes: 3 additions & 3 deletions
6
include/dimensional/arithmetic.hpp → include/mitama/dimensional/arithmetic.hpp
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
6 changes: 3 additions & 3 deletions
6
include/dimensional/delta.hpp → include/mitama/dimensional/delta.hpp
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 |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#ifndef MITAMA_DIMENSIONAL_HPP | ||
#define MITAMA_DIMENSIONAL_HPP | ||
#include <mitama/dimensional/fwd/dimensional_fwd.hpp> | ||
#include <mitama/dimensional/fwd/system.hpp> | ||
#include <mitama/dimensional/mitamagic/utility_ext.hpp> | ||
#include <mitama/dimensional/mitamagic/type_traits_ext.hpp> | ||
#include <mitama/dimensional/mitamagic/ratio_ext.hpp> | ||
#include <mitama/dimensional/mitamagic/type_list.hpp> | ||
#include <type_traits> | ||
|
||
namespace mitama::mitamagic { | ||
template <class T, class... Types> | ||
inline constexpr std::size_t dimension_count_v = | ||
(static_cast<std::size_t>(std::is_same_v<typename T::dimension_type, | ||
typename Types::dimension_type>) + | ||
... + std::size_t{}); // type count meta-function | ||
} // namespace mitama::mitamagic | ||
|
||
namespace mitama { | ||
|
||
template < class > | ||
struct si_base_units {}; | ||
|
||
template <int I, class Dim, class Exponent> struct dimension_tag {}; | ||
|
||
template <class... Units> | ||
struct dimensional_t : private Units::tag... // for Dimensional tags | ||
{ | ||
template < class T > | ||
struct is_wildcard : std::is_same<T, system<>> {}; | ||
// sanity check for duplicate | ||
static_assert(std::conjunction_v<std::bool_constant< | ||
(mitamagic::dimension_count_v<Units, Units...> == 1)>...>, | ||
"same dimension is not allowed"); | ||
// sanity check for system | ||
static_assert(mitamagic::tlist_all_same_v< | ||
mitamagic::tlist_remove_if_t<is_wildcard, | ||
mitamagic::type_list<typename Units::system_type...>>>, | ||
"different units within a dimension"); | ||
static constexpr std::size_t value = sizeof...(Units); | ||
using system_type | ||
= mitamagic::tlist_element_t<0, | ||
std::conditional_t< | ||
std::is_same_v< | ||
mitamagic::type_list<>, | ||
mitamagic::tlist_remove_if_t<is_wildcard, | ||
mitamagic::type_list<typename Units::system_type...> | ||
> | ||
>, | ||
mitamagic::type_list<system<>>, | ||
mitamagic::tlist_remove_if_t<is_wildcard, | ||
mitamagic::type_list<typename Units::system_type...> | ||
> | ||
> | ||
>; | ||
}; | ||
|
||
template <class... Units> | ||
using make_dimensional_t = si_base_units<dimensional_t<Units...>>; | ||
|
||
|
||
} // namespace mitama | ||
#endif |
12 changes: 6 additions & 6 deletions
12
include/dimensional/dimensional_traits.hpp → ...mitama/dimensional/dimensional_traits.hpp
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
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
include/dimensional/fwd/quantity_fwd.hpp → ...e/mitama/dimensional/fwd/quantity_fwd.hpp
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
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
include/dimensional/fwd/units_fwd.hpp → include/mitama/dimensional/fwd/units_fwd.hpp
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
6 changes: 3 additions & 3 deletions
6
include/dimensional/io.hpp → include/mitama/dimensional/io.hpp
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#ifndef MITAMA_DIMENSIONAL_MATH_ALL_HPP | ||
#define MITAMA_DIMENSIONAL_MATH_ALL_HPP | ||
|
||
#include <mitama/dimensional/math/abs.hpp> | ||
#include <mitama/dimensional/math/minmax.hpp> | ||
#include <mitama/dimensional/math/pow.hpp> | ||
#include <mitama/dimensional/math/root.hpp> | ||
#include <mitama/dimensional/math/nearest_integer.hpp> | ||
#include <mitama/dimensional/math/trigonometric.hpp> | ||
#include <mitama/dimensional/math/modular.hpp> | ||
#include <mitama/dimensional/math/logarithm.hpp> | ||
|
||
#endif |
4 changes: 2 additions & 2 deletions
4
include/dimensional/math/logarithm.hpp → ...ude/mitama/dimensional/math/logarithm.hpp
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
2 changes: 1 addition & 1 deletion
2
include/dimensional/math/minmax.hpp → include/mitama/dimensional/math/minmax.hpp
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
2 changes: 1 addition & 1 deletion
2
include/dimensional/math/nearest_integer.hpp → ...tama/dimensional/math/nearest_integer.hpp
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
2 changes: 1 addition & 1 deletion
2
include/dimensional/math/trigonometric.hpp → ...mitama/dimensional/math/trigonometric.hpp
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
File renamed without changes.
8 changes: 4 additions & 4 deletions
8
include/dimensional/mitamagic/quotient.hpp → ...mitama/dimensional/mitamagic/quotient.hpp
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.