3.0.0
Freundlich's C++ toolkit
Classes | Typedefs | Functions
fcppt::math::dim Namespace Reference

Contains 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...
 
class  object
 A class representing a static n-dimensional dimension. More...
 
struct  object< T, N, S >>
 

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). More...
 

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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
template<typename T1 , typename T2 , fcppt::math::size_type N, typename S1 , typename S2 , typename Function >
fcppt::math::dim::static_< std::result_of_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. More...
 
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. More...
 
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. More...
 
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 lexicographically. More...
 
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 lexicographically. More...
 
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 lexicographically. More...
 
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 lexicographically. More...
 
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. More...
 
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. More...
 
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. More...
 
template<typename Dim , typename Function >
Dim init (Function const &_function)
 Initializes a dim. More...
 
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. More...
 
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. More...
 
template<typename T , fcppt::math::size_type N, typename S , typename Function >
fcppt::math::dim::static_< std::result_of_t< Function(T) >, N > map (fcppt::math::dim::object< T, N, S > const &_value, Function const &_function)
 Maps over the elements of a dim. More...
 
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. More...
 
template<typename Dim >
fcppt::math::dim::static_< fcppt::type_traits::value_type< Dim >, Dim::static_size::value > null ()
 Returns the null dim. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 

Detailed Description

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