opynsim
Unofficial C++ Documentation
Loading...
Searching...
No Matches
Namespaces | Concepts | Functions
common_functions.h File Reference
#include <liboscar/maths/constants.h>
#include <liboscar/maths/functors.h>
#include <liboscar/maths/vector.h>
#include <liboscar/utilities/algorithms.h>
#include <algorithm>
#include <cmath>
#include <concepts>
#include <cstddef>
#include <initializer_list>
#include <iterator>
#include <numeric>
#include <ranges>
#include <span>
#include <tuple>
#include <type_traits>
Include dependency graph for common_functions.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  osc
 

Concepts

concept  osc::HasAbsFunction
 
concept  osc::HasFloorFunction
 
concept  osc::HasModFunction
 
concept  osc::HasMinFunction
 
concept  osc::HasMaxFunction
 
concept  osc::HasClampFunction
 
concept  osc::HasSaturateFunction
 
concept  osc::HasLerpFunction
 
concept  osc::LessThanComparable
 
concept  osc::LessThanOrEqualToComparable
 
concept  osc::HasMidpointFunction
 

Functions

template<std::signed_integral T>
T osc::abs (T num)
 
template<HasAbsFunction T, size_t N>
Vector< T, Nosc::abs (const Vector< T, N > &x)
 
template<std::floating_point T>
T osc::floor (T num)
 
template<HasFloorFunction T, size_t N>
Vector< T, Nosc::floor (const Vector< T, N > &x)
 
template<std::floating_point T>
T osc::copysign (T mag, T sgn)
 
template<std::integral T>
constexpr T osc::mod (T x, T y)
 
template<std::floating_point T>
T osc::mod (T x, T y)
 
template<HasModFunction T, size_t N>
constexpr Vector< T, Nosc::mod (const Vector< T, N > &x, const Vector< T, N > &y)
 
template<HasMinFunction T, size_t N>
constexpr Vector< T, Nosc::elementwise_min (const Vector< T, N > &x, const Vector< T, N > &y)
 
template<HasMaxFunction T, size_t N>
requires std::is_arithmetic_v<T>
constexpr Vector< T, Nosc::elementwise_max (const Vector< T, N > &x, const Vector< T, N > &y)
 
template<HasClampFunction T, size_t N>
constexpr Vector< T, Nosc::elementwise_clamp (const Vector< T, N > &v, const Vector< T, N > &lo, const Vector< T, N > &hi)
 
template<HasClampFunction T, size_t N>
constexpr Vector< T, Nosc::elementwise_clamp (const Vector< T, N > &v, const T &lo, const T &hi)
 
template<std::floating_point T>
constexpr T osc::saturate (T num)
 
template<HasSaturateFunction T, size_t N>
constexpr Vector< T, Nosc::saturate (const Vector< T, N > &x)
 
template<typename Arithmetic1 , typename Arithmetic2 , typename Arithmetic3 >
requires std::is_arithmetic_v<Arithmetic1>
and std::is_arithmetic_v< Arithmetic2 > and std::is_arithmetic_v< Arithmetic3 > constexpr auto osc::lerp (const Arithmetic1 &a, const Arithmetic2 &b, const Arithmetic3 &t)
 
template<typename T , size_t N, typename TInterpolant >
requires HasLerpFunction<T, TInterpolant>
constexpr auto osc::lerp (const Vector< T, N > &x, const Vector< T, N > &y, const TInterpolant &t) -> Vector< decltype(lerp(x[0], y[0], t)), N >
 
template<std::equality_comparable T, size_t N>
constexpr Vector< bool, Nosc::elementwise_equal (const Vector< T, N > &x, const Vector< T, N > &y)
 
template<LessThanComparable T, size_t N>
constexpr Vector< bool, Nosc::elementwise_less (const Vector< T, N > &x, const Vector< T, N > &y)
 
template<LessThanComparable T, size_t N>
constexpr Vector< bool, Nosc::elementwise_less (const Vector< T, N > &x, const T &v)
 
template<LessThanOrEqualToComparable T, size_t N>
constexpr Vector< bool, Nosc::elementwise_less_equal (const Vector< T, N > &x, const Vector< T, N > &y)
 
template<typename T >
requires HasAbsFunction<T>
and LessThanComparable< T > bool osc::equal_within_absdiff (T x, T y, T absdiff)
 
template<typename T , size_t N>
requires HasAbsFunction<T>
and LessThanComparable< T > Vector< bool, Nosc::equal_within_absdiff (const Vector< T, N > &x, const Vector< T, N > &y, const Vector< T, N > &absdiff)
 
template<typename T , size_t N>
requires HasAbsFunction<T>
and LessThanComparable< T > Vector< bool, Nosc::equal_within_absdiff (const Vector< T, N > &x, const Vector< T, N > &y, const T &absdiff)
 
template<std::floating_point T>
bool osc::equal_within_epsilon (T x, T y)
 
template<std::floating_point T, size_t N>
Vector< bool, Nosc::equal_within_epsilon (const Vector< T, N > &x, const Vector< T, N > &y)
 
template<std::floating_point T>
bool osc::equal_within_scaled_epsilon (T x, T y)
 
template<std::floating_point T>
bool osc::equal_within_reldiff (T x, T y, T reldiff)
 
template<std::floating_point T, size_t N>
Vector< bool, Nosc::equal_within_reldiff (const Vector< T, N > &x, const Vector< T, N > &y, T reldiff)
 
template<std::floating_point T>
bool osc::isnan (T num)
 
template<std::floating_point T, size_t N>
Vector< bool, Nosc::isnan (const Vector< T, N > &x)
 
template<std::floating_point T>
T osc::log (T num)
 
template<std::floating_point T>
T osc::pow (T base, T exp)
 
template<typename T >
requires std::is_integral_v<T>
or std::is_floating_point_v< T > or std::is_pointer_v< T > constexpr T osc::midpoint (T a, T b)
 
template<typename T , size_t N>
Vector< T, Nosc::midpoint (const Vector< T, N > &x, const Vector< T, N > &y)
 
template<std::ranges::range R, typename T = typename std::ranges::range_value_t<R>::value_type, size_t N = std::tuple_size_v<typename std::ranges::range_value_t<R>>>
requires std::is_arithmetic_v<T>
constexpr Vector< T, Nosc::centroid_of (const R &r)
 
template<typename T , size_t N>
requires std::is_arithmetic_v<T>
constexpr Vector< T, Nosc::centroid_of (const std::initializer_list< Vector< T, N > > &vs)