Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuki Wada committed Feb 26, 2020
2 parents 3e76293 + d91bb80 commit b09c2b4
Show file tree
Hide file tree
Showing 336 changed files with 1,430 additions and 855 deletions.
12 changes: 6 additions & 6 deletions include/dimensional/dimensional.hpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#ifndef MITAMA_DIMENSIONAL_HPP
#define MITAMA_DIMENSIONAL_HPP
#include <dimensional/fwd/dimensional_fwd.hpp>
#include <dimensional/fwd/system.hpp>
#include <dimensional/mitamagic/utility_ext.hpp>
#include <dimensional/mitamagic/type_traits_ext.hpp>
#include <dimensional/mitamagic/ratio_ext.hpp>
#include <dimensional/mitamagic/type_list.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 {
Expand Down
13 changes: 0 additions & 13 deletions include/dimensional/math/all.hpp

This file was deleted.

4 changes: 2 additions & 2 deletions include/dimensional/quantity.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef MITAMA_DIMENSIONAL_QUANTITY_HPP
#define MITAMA_DIMENSIONAL_QUANTITY_HPP
#include <dimensional/fwd/quantity_fwd.hpp>
#include <dimensional/dimensional_traits.hpp>
#include <mitama/dimensional/fwd/quantity_fwd.hpp>
#include <mitama/dimensional/dimensional_traits.hpp>

namespace mitama {

Expand Down
10 changes: 0 additions & 10 deletions include/dimensional/systems/si/all.hpp

This file was deleted.

10 changes: 0 additions & 10 deletions include/dimensional/systems/si/base_units/all.hpp

This file was deleted.

6 changes: 3 additions & 3 deletions include/dimensional/systems/si/base_units/ampere.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#ifndef MITAMA_DIMENSIONAL_SI_UNITS_AMPERE_HPP
#define MITAMA_DIMENSIONAL_SI_UNITS_AMPERE_HPP
#include <dimensional/systems/si/base_units/fwd/si_base_units.hpp>
#include <dimensional/systems/si/prefix.hpp>
#include <dimensional/units.hpp>
#include <mitama/dimensional/systems/si/base_units/fwd/si_base_units.hpp>
#include <mitama/dimensional/systems/si/prefix.hpp>
#include <mitama/dimensional/units.hpp>

namespace mitama::systems::si {

Expand Down
22 changes: 11 additions & 11 deletions include/dimensional/systems/si/base_units/fwd/si_base_units.hpp
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#ifndef MITAMA_DIMENSIONAL_SI_BASE_UNITS_FWD_HPP
#define MITAMA_DIMENSIONAL_SI_BASE_UNITS_FWD_HPP
#include <dimensional/systems/si/base_dimension/electric_current.hpp>
#include <dimensional/systems/si/base_dimension/luminous_intensity.hpp>
#include <dimensional/systems/si/base_dimension/thermodynamic_temperature.hpp>
#include <dimensional/systems/si/base_dimension/mass.hpp>
#include <dimensional/systems/si/base_dimension/length.hpp>
#include <dimensional/systems/si/base_dimension/amount_of_substance.hpp>
#include <dimensional/systems/si/base_dimension/time.hpp>
#include <dimensional/systems/si/base_dimension/angle.hpp>
#include <dimensional/systems/si/base_dimension/solid_angle.hpp>
#include <dimensional/units.hpp>
#include <dimensional/system.hpp>
#include <mitama/dimensional/systems/si/base_dimension/electric_current.hpp>
#include <mitama/dimensional/systems/si/base_dimension/luminous_intensity.hpp>
#include <mitama/dimensional/systems/si/base_dimension/thermodynamic_temperature.hpp>
#include <mitama/dimensional/systems/si/base_dimension/mass.hpp>
#include <mitama/dimensional/systems/si/base_dimension/length.hpp>
#include <mitama/dimensional/systems/si/base_dimension/amount_of_substance.hpp>
#include <mitama/dimensional/systems/si/base_dimension/time.hpp>
#include <mitama/dimensional/systems/si/base_dimension/angle.hpp>
#include <mitama/dimensional/systems/si/base_dimension/solid_angle.hpp>
#include <mitama/dimensional/units.hpp>
#include <mitama/dimensional/system.hpp>

namespace mitama::systems::si {
using ampere_base_unit = base_units<electric_current, 0>;
Expand Down
6 changes: 0 additions & 6 deletions include/dimensional/systems/si/literals/all.hpp

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#ifndef MITAMA_DIMENSIONAL_ARITHMETIC_HPP
#define MITAMA_DIMENSIONAL_ARITHMETIC_HPP
#include <dimensional/quantity.hpp>
#include <dimensional/delta.hpp>
#include <dimensional/system.hpp>
#include <mitama/dimensional/quantity.hpp>
#include <mitama/dimensional/delta.hpp>
#include <mitama/dimensional/system.hpp>

namespace mitama {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#ifndef MITAMA_DIMENSIONAL_DELTA_HPP
#define MITAMA_DIMENSIONAL_DELTA_HPP
#include <dimensional/quantity.hpp>
#include <dimensional/systems/nonsi/degree_celsius.hpp>
#include <dimensional/systems/si/base_units/kelvin.hpp>
#include <mitama/dimensional/quantity.hpp>
#include <mitama/dimensional/systems/nonsi/degree_celsius.hpp>
#include <mitama/dimensional/systems/si/base_units/kelvin.hpp>
#include <type_traits>

namespace mitama {
Expand Down
63 changes: 63 additions & 0 deletions include/mitama/dimensional/dimensional.hpp
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
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#ifndef MITAMA_DIMENSIONAL_DIMENSIONAL_TRAITS_HPP
#define MITAMA_DIMENSIONAL_DIMENSIONAL_TRAITS_HPP
#include <dimensional/fwd/quantity_fwd.hpp>
#include <dimensional/fwd/units_fwd.hpp>
#include <dimensional/fwd/dimensional_fwd.hpp>
#include <dimensional/mitamagic/type_traits_ext.hpp>
#include <dimensional/mitamagic/type_list.hpp>
#include <mitama/dimensional/fwd/quantity_fwd.hpp>
#include <mitama/dimensional/fwd/units_fwd.hpp>
#include <mitama/dimensional/fwd/dimensional_fwd.hpp>
#include <mitama/dimensional/mitamagic/type_traits_ext.hpp>
#include <mitama/dimensional/mitamagic/type_list.hpp>
#include <type_traits>
#include <dimensional/mitamagic/quotient.hpp>
#include <mitama/dimensional/mitamagic/quotient.hpp>

namespace mitama {
// quantity_t traits
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#ifndef MITAMA_DIMENSIONAL_FWD_QUANTITY_FWD_HPP
#define MITAMA_DIMENSIONAL_FWD_QUANTITY_FWD_HPP
#include <dimensional/fwd/system.hpp>
#include <mitama/dimensional/fwd/system.hpp>

namespace mitama {

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef MITAMA_DIMENSIONAL_FWD_UNITS_FWD_HPP
#define MITAMA_DIMENSIONAL_FWD_UNITS_FWD_HPP
#include <ratio>
#include <dimensional/fwd/system.hpp>
#include <mitama/dimensional/fwd/system.hpp>

namespace mitama {
template <int N, class Dim, class = std::ratio<1>, class = std::ratio<1>, class = system<>>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#ifndef MITAMA_DIMENSIONAL_IO_HPP
#define MITAMA_DIMENSIONAL_IO_HPP
#include <dimensional/quantity.hpp>
#include <dimensional/systems/si/all.hpp>
#include <dimensional/mitamagic/utility_ext.hpp>
#include <mitama/dimensional/quantity.hpp>
#include <mitama/dimensional/systems/si/all.hpp>
#include <mitama/dimensional/mitamagic/utility_ext.hpp>
#include <iostream>
#include <type_traits>
#include <string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define MITAMA_DIMENSIONAL_MATH_ABS_HPP

#include <cmath>
#include <dimensional/quantity.hpp>
#include <mitama/dimensional/quantity.hpp>

namespace mitama {

Expand Down
13 changes: 13 additions & 0 deletions include/mitama/dimensional/math/all.hpp
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
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#ifndef MITAMA_DIMENSIONAL_MATH_LOGATITHM_HPP
#define MITAMA_DIMENSIONAL_MATH_LOGATITHM_HPP
#include <cmath>
#include <dimensional/quantity.hpp>
#include <dimensional/arithmetic.hpp>
#include <mitama/dimensional/quantity.hpp>
#include <mitama/dimensional/arithmetic.hpp>

namespace mitama {
template <template <class> class Synonym,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef MITAMA_DIMENSIONAL_MATH_MINMAX_HPP
#define MITAMA_DIMENSIONAL_MATH_MINMAX_HPP

#include <dimensional/quantity.hpp>
#include <mitama/dimensional/quantity.hpp>
#include <cmath>

namespace mitama {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#define MITAMA_DIMENSIONAL_MATH_MODULAR_HPP

#include <cmath>
#include <dimensional/quantity.hpp>
#include <dimensional/arithmetic.hpp>
#include <mitama/dimensional/quantity.hpp>
#include <mitama/dimensional/arithmetic.hpp>

namespace mitama {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#ifndef MITAMA_DIMENSIONAL_MATH_NEARBYINT_HPP
#define MITAMA_DIMENSIONAL_MATH_NEARBYINT_HPP
#include <dimensional/quantity.hpp>
#include <mitama/dimensional/quantity.hpp>
#include <cmath>
namespace mitama {
template <template<class> class Synonym, class T, class... Units, class S>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define MITAMA_DIMENSIONAL_MATH_POW_HPP

#include <cmath>
#include <dimensional/quantity.hpp>
#include <mitama/dimensional/quantity.hpp>

namespace mitama {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#define MITAMA_DIMENSIONAL_MATH_ROOT_HPP

#include <cmath>
#include <dimensional/quantity.hpp>
#include <dimensional/systems/si/base_units/meter.hpp>
#include <mitama/dimensional/quantity.hpp>
#include <mitama/dimensional/systems/si/base_units/meter.hpp>
namespace mitama {

template < template <class> class Synonym, class T, class... Units, class S >
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef MITAMA_DIMENSIONAL_MATH_TRIGONOMETRIC_HPP
#define MITAMA_DIMENSIONAL_MATH_TRIGONOMETRIC_HPP

#include <dimensional/systems/si/derived_units/angle.hpp>
#include <mitama/dimensional/systems/si/derived_units/angle.hpp>
#include <cmath>

namespace mitama {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#ifndef MITAMA_DIMENSIONAL_MITAMAGIC_QUOTIENT_HPP
#define MITAMA_DIMENSIONAL_MITAMAGIC_QUOTIENT_HPP
#include <dimensional/dimensional.hpp>
#include <dimensional/units.hpp>
#include <dimensional/mitamagic/type_list.hpp>
#include <dimensional/dimensional_traits.hpp>
#include <mitama/dimensional/dimensional.hpp>
#include <mitama/dimensional/units.hpp>
#include <mitama/dimensional/mitamagic/type_list.hpp>
#include <mitama/dimensional/dimensional_traits.hpp>
#include <cmath>
#include <iostream>
#include <ratio>
Expand Down
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit b09c2b4

Please sign in to comment.