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

Everything math-related goes in here. More...

Namespaces

 box
 Contains box::object and helper functions, classes and types for it.
 
 dim
 Contains dim::object and helper functions, classes and types for it.
 
 interpolation
 Contains interpolation functions.
 
 matrix
 Contains matrix::object and helper functions, classes and types for it.
 
 sphere
 Contains sphere::object and helper functions, classes and types for it.
 
 vector
 Contains vector::object and helper functions, classes and types for it.
 

Classes

struct  is_zero_impl
 
struct  quantity< Unit, Type >>
 Integrates boost.units with fcppt::math::is_zero.
 

Typedefs

typedef std::make_signed_t< fcppt::math::size_typedifference_type
 The difference type used for structure sizes. More...
 
template<fcppt::math::size_type Start, fcppt::math::size_type End>
using int_range = ::brigand::range< fcppt::math::size_type, Start, End >
 A static int range. More...
 
template<fcppt::math::size_type Count>
using int_range_count = fcppt::math::int_range< fcppt::literal< fcppt::math::size_type >(0u), Count >
 A static int range starting at 0. More...
 
typedef unsigned size_type
 The size type used for structure sizes. More...
 
template<fcppt::math::size_type N>
using static_size = std::integral_constant< fcppt::math::size_type, N >
 An mpl integral_c for math::size_type. More...
 
template<typename Type >
using to_array_type = std::array< typename Type::value_type, fcppt::math::detail::storage_size< typename Type::storage_type >::value >
 Returns the array type of an object with static storage. More...
 

Functions

template<typename T >
fcppt::optional::object< T > ceil_div (T const &_dividend, T const &_divisor)
 Calculates dividend / divisor rounded towards infinity. More...
 
template<typename T >
fcppt::optional::object< T > ceil_div_signed (T const &_dividend, T const &_divisor)
 Calculates dividend / divisor rounded towards infinity. More...
 
template<typename T >
clamp (T const &_value, T const &_vmin, T const &_vmax)
 Clamps a value into a range. More...
 
template<typename T >
deg_to_rad (T const deg)
 Transforms degrees into radians. More...
 
template<typename T >
diff (T const &_a, T const &_b)
 Calculates the absolute distance between a and b. More...
 
template<typename L , typename R >
fcppt::optional::object<> div (L const &_dividend, R const &_divisor)
 Calculates dividend / divisor. More...
 
template<typename Type >
Type from_array (fcppt::math::to_array_type< Type > &&_value)
 Constructs an object with static storage from an array rvalue. More...
 
template<typename Type >
Type from_array (fcppt::math::to_array_type< Type > const &_value)
 Constructs an object with static storage from an array lvalue. More...
 
template<typename Type >
Type interval_distance (fcppt::homogenous_pair< Type > _i1, fcppt::homogenous_pair< Type > _i2)
 Calculates the distance of two intervals. More...
 
template<typename T >
constexpr bool is_power_of_2 (T const x) noexcept
 Checks if a number is a power of two. More...
 
template<typename T >
bool is_zero (T const &_value)
 Compares a value against zero. More...
 
template<typename T >
log2 (T const x)
 Calculates $\log_2(x)$ for unsigned types (using a loop) More...
 
template<typename T >
fcppt::optional::object< T > mod (T const &_dividend, T const &_divisor)
 Wraps the integral modulo operator and the floating point modulo functions. More...
 
template<typename T >
next_power_of_2 (T const _value)
 Calculates the next power of 2 for an unsigned value. More...
 
template<typename T >
pi ()
 Returns Pi for type T. More...
 
template<typename Result , typename Exponent >
constexpr Result power_of_2 (Exponent const _exponent)
 Calculates two to the power of n. More...
 
template<typename T >
rad_to_deg (T const rad)
 Transforms radians into degrees. More...
 
template<typename Type >
fcppt::math::to_array_type< Type > to_array (Type const &_value)
 Returns the array of an object with static storage. More...
 
template<typename T >
twopi ()
 Returns two Pi for type T. More...
 

Detailed Description

Everything math-related goes in here.