4.6.0
Freundlich's C++ toolkit
Loading...
Searching...
No Matches
fcppt::math::dim Namespace Reference

Contains fcppt::math::dim::object dim::object and helper functions, classes and types for it. More...

Classes

struct  has_dim
 Metafunction to check the dimension of a static dim. More...
 
struct  has_dim< fcppt::math::dim::object< T, N, S >, Size >
 
struct  is_dim
 Metafunction to test if a type is a dim type. More...
 
struct  is_dim< fcppt::math::dim::object< T, N, S > >
 
class  object
 A class representing a static n-dimensional dimension. More...
 

Typedefs

template<typename T , fcppt::math::size_type N>
using static_ = fcppt::math::dim::object<T, N, fcppt::math::detail::static_storage<T, N>>
 Typedef helper for static dimsSee the introduction to fcppt::math::vector::object for more information on static dims (and on this class).
 

Functions

template<typename T , fcppt::math::size_type N, typename S >
fcppt::math::dim::static_< FCPPT_MATH_DETAIL_UNARY_TYPE(T, -), N > operator- (fcppt::math::dim::object< T, N, S > const &_left)
 Negates a dim.
 
template<typename L , typename R , fcppt::math::size_type N, typename S1 , typename S2 >
fcppt::math::dim::static_< FCPPT_MATH_DETAIL_BINARY_TYPE(L,+, R), N > operator+ (fcppt::math::dim::object< L, N, S1 > const &_left, fcppt::math::dim::object< R, N, S2 > const &_right)
 Adds a dim to a dim.
 
template<typename L , typename R , fcppt::math::size_type N, typename S1 , typename S2 >
fcppt::math::dim::static_< FCPPT_MATH_DETAIL_BINARY_TYPE(L, -, R), N > operator- (fcppt::math::dim::object< L, N, S1 > const &_left, fcppt::math::dim::object< R, N, S2 > const &_right)
 Subtracts a dim from a dim.
 
template<typename L , typename R , fcppt::math::size_type N, typename S1 , typename S2 >
fcppt::math::dim::static_< FCPPT_MATH_DETAIL_BINARY_TYPE(L, *, R), N > operator* (fcppt::math::dim::object< L, N, S1 > const &_left, fcppt::math::dim::object< R, N, S2 > const &_right)
 Multiplies a dim by a dim.
 
template<typename L , typename R , fcppt::math::size_type N, typename S1 , typename S2 >
fcppt::optional::object< fcppt::math::dim::static_< FCPPT_MATH_DETAIL_BINARY_TYPE(L,/, R), N > > operator/ (fcppt::math::dim::object< L, N, S1 > const &_left, fcppt::math::dim::object< R, N, S2 > const &_right)
 Divides a dim by a dim.
 
template<typename L , typename R , fcppt::math::size_type N, typename S >
fcppt::math::dim::static_< FCPPT_MATH_DETAIL_BINARY_TYPE(L, *, R), N > operator* (fcppt::math::dim::object< L, N, S > const &_left, R const &_right)
 Multiplies a dim by a scalar on the right.
 
template<typename L , typename R , fcppt::math::size_type N, typename S >
fcppt::math::dim::static_< FCPPT_MATH_DETAIL_BINARY_TYPE(L, *, R), N > operator* (L const &_left, fcppt::math::dim::object< R, N, S > const &_right)
 Multiplies a dim by a scalar on the left.
 
template<typename L , typename R , fcppt::math::size_type N, typename S >
fcppt::optional::object< fcppt::math::dim::static_< FCPPT_MATH_DETAIL_BINARY_TYPE(L,/, R), N > > operator/ (fcppt::math::dim::object< L, N, S > const &_left, R const &_right)
 Divides a dim by a scalar.
 
template<fcppt::math::size_type Index, typename Dim >
fcppt::container::to_reference_type< std::remove_reference_t< Dim > > at (Dim &_value)
 Access an element using a compile-time constant.
 
template<typename T1 , typename T2 , fcppt::math::size_type N, typename S1 , typename S2 , typename Function >
fcppt::math::dim::static_< std::invoke_result_t< Function, T1, T2 >, N > binary_map (fcppt::math::dim::object< T1, N, S1 > const &_left, fcppt::math::dim::object< T2, N, S2 > const &_right, Function const &_function)
 Maps over two dims.
 
template<typename T , fcppt::math::size_type N, typename S1 , typename S2 >
bool operator== (fcppt::math::dim::object< T, N, S1 > const &_v1, fcppt::math::dim::object< T, N, S2 > const &_v2)
 Compares two dims for equality.
 
template<typename T , fcppt::math::size_type N, typename S1 , typename S2 >
bool operator!= (fcppt::math::dim::object< T, N, S1 > const &_v1, fcppt::math::dim::object< T, N, S2 > const &_v2)
 Compares two dims for disequality.
 
template<typename T , fcppt::math::size_type N, typename S1 , typename S2 >
bool componentwise_equal (fcppt::math::dim::object< T, N, S1 > const &_v1, fcppt::math::dim::object< T, N, S2 > const &_v2, T const _epsilon)
 Compares two dims for equality using an epsilon.
 
template<typename T , fcppt::math::size_type N, typename S >
contents (fcppt::math::dim::object< T, N, S > const &_dim)
 Returns the area/volume of the dimension.
 
template<typename Dim >
Dim fill (fcppt::type_traits::value_type< Dim > const &_value)
 Constructs a static dim with all components set to a given value.
 
template<typename Dim , typename Function >
Dim init (Function const &_function)
 Initializes a dim.
 
template<typename T , fcppt::math::size_type N, typename S , typename Ch , typename Traits >
std::basic_istream< Ch, Traits > & operator>> (std::basic_istream< Ch, Traits > &_stream, fcppt::math::dim::object< T, N, S > &_dim)
 Reads a dim from s, expecting it in the format.
 
template<typename T , fcppt::math::size_type N, typename S >
bool is_quadratic (fcppt::math::dim::object< T, N, S > const &_dim)
 Checks if all elements of the dim are the same.
 
template<typename T , fcppt::math::size_type N, typename S , typename Function >
fcppt::math::dim::static_< std::invoke_result_t< Function, T >, N > map (fcppt::math::dim::object< T, N, S > const &_value, Function const &_function)
 Maps over the elements of a dim.
 
template<typename Dest , typename T , fcppt::math::size_type N, typename S >
Dest narrow_cast (fcppt::math::dim::object< T, N, S > const &_src)
 Shortens a dim to a smaller dimension.
 
template<typename Dim >
fcppt::math::dim::static_< fcppt::type_traits::value_type< Dim >, Dim::static_size::value > null ()
 Returns the null dim.
 
template<typename T , fcppt::math::size_type N, typename S , typename Ch , typename Traits >
std::basic_ostream< Ch, Traits > & operator<< (std::basic_ostream< Ch, Traits > &_stream, fcppt::math::dim::object< T, N, S > const &_dim)
 Outputs a dim to s, in the format.
 
template<typename T , fcppt::math::size_type N, typename S >
fcppt::math::dim::static_< T, N+1U > push_back (fcppt::math::dim::object< T, N, S > const &_dim, T const &_value)
 Pushes an element to the back of a dim.
 
template<typename T , fcppt::math::size_type N, typename S >
fcppt::optional::object< fcppt::math::dim::static_< T, N > > sequence (fcppt::math::dim::object< fcppt::optional::object< T >, N, S > const &_value)
 Sequence for a dim.
 
template<typename Dest , typename Conv , typename T , fcppt::math::size_type N, typename S >
Dest structure_cast (fcppt::math::dim::object< T, N, S > const &_src)
 Converts a dim into a different dim of the same dimension.
 
template<typename T , fcppt::math::size_type N, typename S >
fcppt::math::dim::static_< std::make_signed_t< T >, N > to_signed (fcppt::math::dim::object< T, N, S > const &_src)
 Converts a dim into a corresponding signed dim.
 
template<typename T , fcppt::math::size_type N, typename S >
fcppt::math::dim::static_< std::make_unsigned_t< T >, N > to_unsigned (fcppt::math::dim::object< T, N, S > const &_src)
 Converts a dim into a corresponding unsigned dim.
 
template<typename T , fcppt::math::size_type N, typename S >
fcppt::math::vector::static_< T, N > to_vector (fcppt::math::dim::object< T, N, S > const &_src)
 Converts a dim into a corresponding vector.
 

Detailed Description

Contains fcppt::math::dim::object dim::object and helper functions, classes and types for it.