emlabcpp
modern opinionated embedded C++ library
emlabcpp Namespace Reference

MIT License. More...

Namespaces

 bits
 
 cfg
 MIT License.
 
 coro
 MIT License.
 
 detail
 
 impl
 MIT License.
 
 iterators
 MIT License.
 
 pmr
 MIT License.
 
 protocol
 MIT License.
 
 rpc
 MIT License.
 
 testing
 MIT License.
 

Classes

struct  convert_to
 Object with operator() that constructs object of type Tout of passed-in value. More...
 
class  bounded
 The bounded class represents a wrapper over type T constrained between MinVal and MaxVal as compile-time constants. More...
 
class  defer
 The defer class stores a callable object and ensures it is executed when the defer object goes out of scope. More...
 
class  bounded_view
 
class  cobs_encoder
 TODO: make this no inline. More...
 
struct  cobs_decoder
 
class  decode_cobs_iter
 
class  contiguous_request_adapter
 
class  contiguous_object_handle
 
class  contiguous_array_handle
 
class  contiguous_node
 
class  contiguous_tree
 
class  derived_storage
 
class  function_view
 
class  function_view< ReturnType(ArgTypes...) >
 
class  point
 Class implementing multidimensional point in coordinate system of dimension N. More...
 
struct  pose_distance
 distance between two poses in space, represented as 'space distance' and 'angular distance' More...
 
struct  pose
 represents orientation and position in 3D space More...
 
class  quaternion
 API and behavior of this is inspired by tf::Quaternion. More...
 
class  simplex
 
class  vec_point_base
 
class  vector
 
class  linked_list_node_base
 
class  linked_list_node
 
class  matrix
 
class  transposed_matrix
 
class  identity_matrix
 
class  rowcol_submatrix
 
struct  string_buffer
 
struct  generic_iterator
 generic_iterator simplifies custom iterator implementation using CRTP. More...
 
class  generic_iterator_base
 
struct  matcher
 
struct  min_max
 A structure representing a range defined by a minimum and a maximum value. More...
 
struct  outcome
 outcome represents tristate resut of some operation, which can succeed, fail or produce an error. More...
 
struct  physical_quantity
 physical_quantity represents all physical units defined using the International System of Units and more. More...
 
struct  pid_coefficients
 
struct  pid_config
 Structure to configure the pid regulator. More...
 
struct  pid
 Implementation of PID regulator, the object should be constructed and populated with pid<T>::conf structure with configuration values (p,i,d coeficients, min/max output vals). More...
 
class  quantity
 Class representing generic quantity. More...
 
class  tagged_quantity
 Class represents a quantity that uses tags to distinguish quantities instead of inheritance. More...
 
struct  result
 result represents an result of some operation, as an alternative to returning just bool with true/false value. More...
 
class  static_circular_buffer_iterator
 
class  static_circular_buffer
 Class implementing circular buffer of any type for up to N elements. More...
 
class  static_function_base
 
class  static_function_base< ReturnType(ArgTypes...), Capacity, Align >
 
struct  static_storage
 Continuous data container that can contain N of uninitialized elements. More...
 
class  static_vector
 Data container for up to N elements. More...
 
struct  status
 
struct  iterator_of
 
struct  data_iterator_of
 
struct  is_view
 
struct  are_same
 
struct  are_same< T, Ts... >
 
struct  are_same<>
 
struct  tuple_has_type
 
struct  tuple_has_type< T, std::tuple< Us... > >
 
struct  is_std_tuple
 
struct  is_std_array
 
struct  is_std_vector
 
struct  static_size
 
struct  signature_of
 
struct  signature_of< ReturnType(Class::*)(Args...) >
 
struct  signature_of< ReturnType(Class::*)(Args...) const >
 
struct  signature_of< ReturnType(Args...) >
 
struct  mapped
 
struct  mapped< Container, UnaryCallable >
 
struct  tag
 
struct  select_utype
 
struct  type_map
 
struct  type_map< std::tuple< Ts... >, Fun >
 
struct  type_tag
 
struct  index_of
 
struct  index_of< T, std::variant< Ts... > >
 
class  view
 Generic class to represent view of some container. More...
 
class  zip_iterator
 zip_ierator iterates over a group of iterators, where value is a tuple of references to value for each iterator. More...
 

Typedefs

template<std::size_t N>
using line = std::array< point< N >, 2 >
 
template<std::size_t N>
using triangle = simplex< point< N >, 2 >
 
template<typename Signature , std::size_t Capacity>
using static_function = static_function_base< Signature, Capacity, alignof(void *) >
 
using value_type = T
 
using reference = T &
 
using const_reference = T const &
 
using pointer = T *
 
using const_pointer = T const *
 
using size_type = std::size_t
 
template<typename Container >
using iterator_of_t = typename iterator_of< Container >::type
 
template<typename Container >
using data_iterator_of_t = typename data_iterator_of< Container >::type
 
template<typename Container , typename UnaryCallable >
using mapped_t = typename mapped< Container, UnaryCallable >::type
 
template<std::size_t N>
using select_utype_t = typename select_utype< N >::type
 
template<typename T , template< typename > class Fun>
using type_map_t = typename type_map< T, Fun >::type
 
template<typename T , typename Variant >
using index_of_v = index_of< T, Variant >::value
 
using unitless = physical_quantity< 0, 0, 0, 0, 0, 0, 0, 0, 0 >
 
using length = physical_quantity< 1, 0, 0, 0, 0, 0, 0, 0, 0 >
 
using mass = physical_quantity< 0, 1, 0, 0, 0, 0, 0, 0, 0 >
 
using timeq = physical_quantity< 0, 0, 1, 0, 0, 0, 0, 0, 0 >
 
using current = physical_quantity< 0, 0, 0, 1, 0, 0, 0, 0, 0 >
 
using temp = physical_quantity< 0, 0, 0, 0, 1, 0, 0, 0, 0 >
 
using amount_of_substance = physical_quantity< 0, 0, 0, 0, 0, 1, 0, 0, 0 >
 
using luminous_intensity = physical_quantity< 0, 0, 0, 0, 0, 0, 1, 0, 0 >
 
using angle = physical_quantity< 0, 0, 0, 0, 0, 0, 0, 1, 0 >
 
using byte = physical_quantity< 0, 0, 0, 0, 0, 0, 0, 0, 1 >
 
using acceleration = physical_quantity< 1, 0, -2, 0, 0, 0, 0, 0, 0 >
 
using angular_velocity = physical_quantity< 0, 0, -1, 0, 0, 0, 0, 1, 0 >
 
using area = physical_quantity< 2, 0, 0, 0, 0, 0, 0, 0, 0 >
 
using volume = physical_quantity< 3, 0, 0, 0, 0, 0, 0, 0, 0 >
 
using velocity = physical_quantity< 1, 0, -1, 0, 0, 0, 0, 0, 0 >
 
using frequency = physical_quantity< 0, 0, -1, 0, 0, 0, 0, 0, 0 >
 
using force = physical_quantity< 1, 1, -2, 0, 0, 0, 0, 0, 0 >
 
using power = physical_quantity< 2, 1, -3, 0, 0, 0, 0, 0, 0 >
 
using voltage = physical_quantity< 2, 1, -3, -1, 0, 0, 0, 0, 0 >
 
using resistance = physical_quantity< 2, 1, -3, -2, 0, 0, 0, 0, 0 >
 
using distance = length
 
using radius = length
 

Enumerations

enum class  contiguous_tree_type : uint8_t {
  VALUE = 1 ,
  OBJECT = 2 ,
  ARRAY = 3
}
 
enum class  contiguous_container_type : uint8_t {
  ARRAY = 1 ,
  OBJECT = 2
}
 
enum class  contiguous_request_adapter_errors : uint8_t {
  MISSING_NODE = 1 ,
  WRONG_TYPE = 2 ,
  CHILD_MISSING = 3 ,
  FULL = 4
}
 
enum class  outcome_e : uint8_t {
  SUCCESS = 0 ,
  FAILURE = 1 ,
  ERROR = 2
}
 
enum class  result_e : uint8_t {
  SUCCESS = 0 ,
  ERROR = 1
}
 

Functions

template<typename T >
constexpr int sign (T const &val)
 returns sign of variable T: -1,0,1 More...
 
template<typename T >
constexpr T ceil_to (T val, T base)
 takes an value val and rounds it up to nearest multiply of base More...
 
template<additive_operators T, arithmetic_operators U>
constexpr U map_range (T input, T from_min, T from_max, U to_min, U to_max)
 maps input value 'input' from input range to equivalent value in output range More...
 
template<container Container>
constexpr std::size_t cont_size (Container const &cont) noexcept
 Returns the size of the container, regardless of what it is. More...
 
template<typename T >
constexpr bool almost_equal (T const &lh, T const &rh, float const eps=default_epsilon)
 Two items 'lh' and 'rh' are almost equal if their difference is smaller than value 'eps'. More...
 
template<referenceable_container Container, typename Iterator = iterator_of_t< Container >>
constexpr view< Iterator > tail (Container &&cont, int const step=1)
 Returns range over Container, which skips first item of container. More...
 
template<referenceable_container Container, typename Iterator = iterator_of_t< Container >>
constexpr view< Iterator > init (Container &&cont, int const step=1)
 Returns range over Container, which skips last item of container. More...
 
template<range_container Container, container_invocable< Container > PredicateCallable = std::identity>
constexpr auto find_if (Container &&cont, PredicateCallable &&f=std::identity())
 Returns iterator for first item, for which call to predicate f(*iter) holds true. More...
 
template<gettable_container Container, container_invocable< Container > PredicateCallable = std::identity>
 requires (!range_container< Container >) const expr std
 Returns index of an element in tuple 't', for which call to predicate f(x) holds true, otherwise returns index of 'past the end' item - size of the tuple. More...
 
template<container Container, typename T >
constexpr auto find (Container &&cont, T const &item)
 Finds first item in container 'cont' that is equal to 'item', returns iterator for container, or index for tuples. More...
 
template<container Container, typename T >
constexpr bool contains (Container const &cont, T const &item)
 Checks if container cont contains at least one occurence of item, returns true/false. More...
 
template<gettable_container Container, container_invocable< Container > UnaryCallable>
 requires (!range_container< Container >) const expr void for_each(Container &&cont
 Applies unary callable 'f' to each element of container 'cont'. More...
 
template<range_container Container, container_invocable< Container > UnaryCallable>
constexpr void for_each (Container &&cont, UnaryCallable &&f)
 Applies unary callable 'f' to each element of container 'cont'. More...
 
template<container Container, container_invocable< Container > UnaryCallable = std::identity, typename T = std::decay_t< mapped_t< Container, UnaryCallable > >>
constexpr min_max< T > min_max_elem (Container &&cont, UnaryCallable &&f=std::identity())
 Applies unary callable 'f(x)' to each element of container 'cont', returns the largest and the smallest return value. More...
 
template<container Container, container_invocable< Container > UnaryCallable = std::identity, typename T = std::decay_t< mapped_t< Container, UnaryCallable > >>
constexpr T max_elem (Container &&cont, UnaryCallable &&f=std::identity())
 Applies unary callable 'f(x)' to each element of container 'cont', returns the largest return value of 'f(x)' calls. More...
 
template<container Container, container_invocable< Container > UnaryCallable = std::identity, typename T = std::decay_t< mapped_t< Container, UnaryCallable > >>
constexpr T min_elem (Container &&cont, UnaryCallable &&f=std::identity())
 Applies unary callable 'f(x) to each element of container 'cont‘, returns the smallest return value of 'f(x)’ calls. More...
 
template<container Container, container_invocable< Container > UnaryCallable = std::identity>
constexpr std::size_t count (Container &&cont, UnaryCallable &&f=std::identity())
 Applies the predicate 'f(x)' to each element of container 'cont' and returns the count of items, for which f(x) returned 'true'. More...
 
template<container Container, container_invocable< Container > UnaryCallable = std::identity, typename T = std::decay_t< mapped_t< Container, UnaryCallable > >>
constexpr T sum (Container &&cont, UnaryCallable &&f=std::identity(), T init={})
 Applies f(x) to each item of container 'cont', returns the sum of all the return values of each call to 'f(x)' and 'init' item. More...
 
template<container Container, typename T , typename BinaryCallable >
constexpr T accumulate (Container &&cont, T init, BinaryCallable &&f)
 Applies callable 'f(init,x)' to each element of container 'x' and actual value of 'init' in iteration, returns a result of last application. More...
 
template<container Container, container_invocable< Container > UnaryCallable = std::identity, typename T = std::decay_t< mapped_t< Container, UnaryCallable > >>
constexpr T avg (Container &&cont, UnaryCallable &&f=std::identity())
 Applies callable 'f(x)' to each element of container 'cont' and returns the average value of each call. More...
 
template<container Container, container_invocable< Container > UnaryCallable = std::identity, typename T = std::decay_t< mapped_t< Container, UnaryCallable > >>
constexpr T variance (Container &&cont, UnaryCallable &&f=std::identity())
 Applies callable 'f(x)' to each element of container 'cont' and returns the variance of values returned from the call. More...
 
template<container LhContainer, container RhContainer, typename BinaryCallable >
constexpr void for_cross_joint (LhContainer &&lh_cont, RhContainer &&rh_cont, BinaryCallable &&f)
 Applies binary callable 'f(x,y)' to each combination of items x from lh_cont and y from rh_cont More...
 
template<container Container, container_invocable< Container > PredicateCallable = std::identity>
constexpr bool any_of (Container &&cont, PredicateCallable &&f=std::identity())
 Returns true if call to predicate 'f(x)' returns true for at least one item x in 'cont'. More...
 
template<container Container, container_invocable< Container > PredicateCallable = std::identity>
constexpr bool none_of (Container &&cont, PredicateCallable &&f=std::identity())
 Returns true if call to predicate 'f(x)' returns false for all items in 'cont'. More...
 
template<container Container, container_invocable< Container > PredicateCallable = std::identity>
constexpr bool all_of (Container &&cont, PredicateCallable &&f=std::identity())
 Returns true if call to predicate 'f(x)' returns true for all items in 'cont'. More...
 
template<range_container LhContainer, range_container RhContainer, typename BinaryPredicateCallable = std::equal_to< void >>
constexpr bool equal (LhContainer &&lh, RhContainer &&rh, BinaryPredicateCallable &&f=std::equal_to< void >{})
 Returns true if containers 'lh' and 'rh' has same size and calls to predicate f - f(lh[i],rh[i]) return true for each item. More...
 
template<impl::map_f_collectable ResultContainer, container Container, container_invocable< Container > UnaryCallable = std::identity>
ResultContainer map_f (Container &&cont, UnaryCallable &&f=std::identity())
 Calls callable f(x) for each item in container 'cont' (or tuple) and stores result in 'ResultContainer', which is returned. More...
 
template<std::size_t N, range_container Container, container_invocable< Container > UnaryCallable = std::identity, typename T = std::decay_t< mapped_t< Container, UnaryCallable > >>
std::array< T, Nmap_f_to_a (Container &&cont, UnaryCallable &&f=std::identity()) requires(!static_sized< Container >)
 Calls callable f(cont[i]) for i = 0...N and stores the result in array of an size N. More...
 
template<range_container Container, typename T , container_invocable< Container > UnaryCallable = std::identity>
constexpr T joined (Container &&cont, T const &val, UnaryCallable &&f=std::identity())
 Function applies callable f to each item in container cont and contacts results with operator+, val is used as a separator between the items. More...
 
template<container Container, typename Iterator >
void copy (Container &&cont, Iterator iter)
 
template<std::size_t N, typename NullCallable >
constexpr void for_each_index (NullCallable &&f)
 Executes unary callable f() with template argument of type 'std::size_t', which ranges from 0 to N. More...
 
template<std::size_t N, typename PredicateCallable >
constexpr std::size_t find_if_index (PredicateCallable &&f)
 Executes unary callable f() with template argument of type 'std::size_t', which ranges from 0 to N until first call that returns true. More...
 
template<std::size_t i, typename PredicateCallable >
constexpr bool until_index (PredicateCallable &&f)
 Executes predicate f() with template argument of type 'std::size_t', which ranges from 0 to i until first call that returns true. More...
 
template<bounded_derived IndexType, typename Callable >
 requires (!requires(Callable f) { { f.template operator()< 0 >() } -> std::same_as< void >;}) const expr auto select_index(IndexType i
 Function expectes bounded value as index input and callable. More...
 
 select_index (i, [&res, &f]< std::size_t i >() { res=f.template operator()< i >();})
 
template<bounded_derived IndexType, typename Callable >
requires requires (Callable f)
 
constexpr void select_index (IndexType i, Callable &&f)
 
template<typename... Args, std::size_t N = sizeof...( Args )>
constexpr std::array< std::byte, Nbytes (Args const &... args)
 Conveft the provided arguments into array of std::byte. More...
 
template<typename Arr , typename... Arrs>
constexpr auto merge_arrays (Arr &&first, Arrs &&... arrs)
 Expects multiple std::arrays on input, and merges all together into one std::array instance. More...
 
template<std::size_t N, typename T >
constexpr std::array< T, Nfilled (T const &item)
 Constructs an array filled with value x More...
 
template<typename T , typename Container , typename Iterator = iterator_of_t< Container >>
view< iterators::convert_iterator< T, Iterator > > convert_view (Container &&cont)
 
template<typename T , typename Iterator >
constexpr view< iterators::convert_iterator< T, Iterator > > convert_view_n (Iterator begin, std::size_t n)
 
template<typename Enum >
 requires (std::is_enum_v< Enum >) auto convert_enum(Enum val)
 Returns a string-like name of the enum value val More...
 
template<typename Container >
auto enumerate (Container &&cont)
 
std::tuple< bool, view< std::byte * > > encode_cobs (view< std::byte const * > source, view< std::byte * > target)
 Encodes data from source range into target buffer with Consistent Overhead Byte Stuffing (COBS) encoding, returns bool indicating whenever conversion succeeded and subview used for conversion from target buffer. More...
 
std::tuple< bool, view< std::byte * > > decode_cobs (view< std::byte const * > source, view< std::byte * > target)
 Decodes data from source range into target buffer with Consistent Overhead Byte Stuffing (COBS) encoding, returns bool indicating whenever conversion succeeded and subview used for conversion from target buffer. More...
 
template<typename Iter >
view< decode_cobs_iter< Iter >, decode_cobs_iter< Iter > > cobs_decode_view (view< Iter > data)
 
template<decomposable_0 T>
constexpr std::tuple decompose (T &&)
 
template<typename T , typename Tuple >
constexpr T compose (Tuple tpl)
 
 EMLABCPP_GENERATE_DECOMPOSE (16, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15) template< typename T > using decomposed_type
 
template<std::size_t N>
constexpr float distance_of (line< N > const &l, point< N > const &p)
 
template<std::size_t N>
constexpr float distance_of (point< N > const &p, line< N > const &line)
 
template<std::size_t N>
constexpr point< Npoint_cast (vector< N > const &v)
 
template<std::size_t N>
constexpr vector< Nvector_cast (point< N > const &p)
 
template<std::size_t N>
constexpr point< Noperator* (point< N > a, point< N > const &b)
 Multiplication of points multiplies each coordinate of A by coordinate of B on same dimension. More...
 
template<std::size_t N>
constexpr vector< Noperator- (point< N > a, point< N > const &b)
 Returns a result of subtraction of A from B, viz -= operator. More...
 
template<std::size_t N>
constexpr point< Noperator+ (point< N > a, vector< N > const &b)
 Returns a result of addition a to b, viz += operator. More...
 
template<std::size_t N>
constexpr point< Noperator- (point< N > a, vector< N > const &b)
 Returns a result of subtraction a to b, viz += operator. More...
 
template<std::size_t N>
constexpr float distance_of (point< N > const &a, point< N > const &b)
 Returns euclidian distance of point A from point B. More...
 
template<std::size_t N>
constexpr float point_angle (point< N > const &a, point< N > const &b)
 
template<std::size_t N>
std::vector< point< N > > lineary_interpolate_path (std::vector< point< N > > const &ipath, float d_step)
 
template<std::size_t N>
constexpr float axis_projection_distance (point< N > const &a, vector< N > const &axis_direction)
 Function to calculate distance of projection of point A. More...
 
constexpr std::size_t steps (pose_distance dist, float dist_step, float angle_step)
 returns steps necessary for linear interpolation of distance between poses 'dis', such that: More...
 
constexpr bool operator< (pose const &x, pose const &y)
 
constexpr bool operator== (pose const &x, pose const &y)
 compares poses on their position and orientation More...
 
constexpr bool operator!= (pose const &x, pose const &y)
 negation of operator== between poses More...
 
constexpr pose_distance distance_of (pose const &x, pose const &y)
 returns PoseDistance between provided poses More...
 
constexpr pose lin_interp (pose const &from, pose const &goal, float factor)
 linear interpolation between base se and goal pose, with factor 0 'base' is returned, with factor 1 'goal' is returned. More...
 
std::vector< poselineary_interpolate_path (std::vector< pose > const &ipath, float d_step, float a_step)
 
constexpr point< 3 > transform (point< 3 > const &a, pose const &transformation)
 Point A is rotated based on 'transformation' orientation and than moved based on 'transformation' position. More...
 
constexpr vector< 3 > transform (vector< 3 > const &v, pose const &transformation)
 
constexpr pose transform (pose const &x, pose const &transformation)
 Pose X is rotated based on 'transformation' orientation and than moved based on 'transformation' position. More...
 
template<typename T >
constexpr auto transform (min_max< T > const &mm, pose const &transformation)
 
constexpr pose inverse (pose const &x)
 
template<typename T >
constexpr auto inverse_transform (T const &item, pose const &transformation)
 
constexpr pose rotate (pose const &x, quaternion const &quat)
 Pose X is rotated based on quaternion 'quad'. More...
 
constexpr quaternion inverse (quaternion const &q)
 
constexpr quaternion operator- (quaternion const &q)
 
constexpr float dot (quaternion const &q, quaternion const &s)
 
constexpr float norm2_of (quaternion const &q)
 
constexpr float angle_shortest_path (quaternion const &m, quaternion const &n)
 
constexpr quaternion slerp (quaternion const &q, quaternion const &s, float f)
 
constexpr bool operator== (quaternion const &q, quaternion const &s)
 
constexpr bool operator!= (quaternion const &q, quaternion const &s)
 
constexpr bool operator< (quaternion const &q, quaternion const &s)
 
constexpr quaternion operator* (quaternion const &q, quaternion const &s)
 
constexpr quaternion operator* (quaternion const &q, point< 3 > const &x)
 
constexpr quaternion operator* (point< 3 > const &x, quaternion const &q)
 
constexpr quaternion operator+ (quaternion const &lh, quaternion const &rh)
 
constexpr bool almost_equal (quaternion const &q, quaternion const &s, float eps=default_epsilon)
 
constexpr quaternion shortest_arc_quat (point< 3 > x, point< 3 > y)
 
constexpr point< 3 > rotate (point< 3 > const &x, quaternion const &q)
 
constexpr quaternion rotate (quaternion const &x, quaternion const &q)
 
constexpr vector< 3 > rotate (vector< 3 > const &v, quaternion const &q)
 
template<std::size_t N, std::size_t U>
constexpr point< Ncenter_of (simplex< point< N >, U > const &s)
 
template<std::size_t N>
constexpr float volume_of (simplex< point< N >, N > const &simplex)
 
template<typename Item , std::size_t N>
constexpr bool operator< (simplex< Item, N > const &lh, simplex< Item, N > const &rh)
 
template<typename Item , std::size_t N>
constexpr bool operator> (simplex< Item, N > const &lh, simplex< Item, N > const &rh)
 
template<typename Item , std::size_t N>
constexpr bool operator<= (simplex< Item, N > const &lh, simplex< Item, N > const &rh)
 
template<typename Item , std::size_t N>
constexpr bool operator>= (simplex< Item, N > const &lh, simplex< Item, N > const &rh)
 
template<typename Item , std::size_t N>
constexpr bool operator== (simplex< Item, N > const &lh, simplex< Item, N > const &rh)
 
template<typename Item , std::size_t N>
constexpr bool operator!= (simplex< Item, N > const &lh, simplex< Item, N > const &rh)
 
point< 3 > get_triangle_sphere_center (triangle< 3 > const &tri)
 
constexpr vector< 3 > normal_of (triangle< 3 > const &tri)
 
constexpr triangle< 3 > transform (triangle< 3 > const &t, pose const &transformation)
 
template<std::size_t N>
constexpr triangle< Nscale (triangle< N > const &t, point< N > const &scales)
 
template<typename Derived , std::size_t N, typename T , typename = typename std::enable_if_t< std::is_arithmetic_v< T > >>
constexpr Derived operator* (vec_point_base< Derived, N > const &a, T s)
 Multiplies each coordinate of A by item 's' of type T, if T satifies std::is_arithmetic. More...
 
template<typename Derived , std::size_t N, typename T >
constexpr Derived operator* (T s, vec_point_base< Derived, N > const &a)
 Multiplies each coordinate of A by item 's' of type T, if T satifies std::is_arithmetic. More...
 
template<typename Derived , std::size_t N, typename T , typename = typename std::enable_if_t< std::is_arithmetic_v< T > >>
constexpr Derived operator/ (vec_point_base< Derived, N > const &a, T s)
 Divides each coordinate of A by item 's' of type T, if T satifies std::is_arithmetic. More...
 
template<typename Derived , std::size_t N>
constexpr float dot (vec_point_base< Derived, N > const &a, vec_point_base< Derived, N > const &b)
 Calculates the dot product between A and B. More...
 
template<typename Derived , std::size_t N>
constexpr auto length2_of (vec_point_base< Derived, N > const &a)
 Returns squared distance of A from [0,0,0], this is a squared length of vector represented by A. More...
 
template<typename Derived , std::size_t N>
constexpr float length_of (vec_point_base< Derived, N > const &a)
 Returns distance of A from [0,0,0], this is a length of vector represented by A. More...
 
template<typename Derived , std::size_t N>
constexpr Derived normalized (vec_point_base< Derived, N > const &a)
 Calculates normalized version of A, this means that length(A) equals to 1. More...
 
template<typename Derived , std::size_t N>
constexpr Derived abs (vec_point_base< Derived, N > const &a)
 Creates absolute version of A - removing signs on all dimensions. More...
 
template<typename Derived , std::size_t N>
constexpr Derived max (vec_point_base< Derived, N > const &a, vec_point_base< Derived, N > const &b)
 
template<typename Derived , std::size_t N>
constexpr Derived const & min (vec_point_base< Derived, N > const &a, vec_point_base< Derived, N > const &b)
 
template<typename Derived , std::size_t N>
constexpr Derived dimensional_max (vec_point_base< Derived, N > const &a, vec_point_base< Derived, N > const &b)
 Calculates a C, where C[i] = max(A[i], B[i]) holds for 0 <= i < N. More...
 
template<typename Derived , std::size_t N>
constexpr Derived dimensional_min (vec_point_base< Derived, N > const &a, vec_point_base< Derived, N > const &b)
 Calculates a C, where C[i] = min(A[i], B[i]) holds for 0 <= i < N. More...
 
template<typename Container , typename UnaryFunction = std::identity, typename Derived = std::decay_t< mapped_t< Container, UnaryFunction > >>
constexpr min_max< Derived > dimensional_min_max_elem (Container const &cont, UnaryFunction &&f=std::identity{})
 
template<typename Derived , std::size_t N>
constexpr Derived lin_interp (vec_point_base< Derived, N > const &from, vec_point_base< Derived, N > const &goal, float factor)
 
template<std::size_t N>
constexpr vector< Noperator+ (vector< N > lh, vector< N > const &rh)
 
constexpr vector< 3 > cross_product (vector< 3 > const &a, vector< 3 > const &b)
 Calculates cross product between points A and B. More...
 
constexpr vector< 2 > normal_of (vector< 2 > const &a)
 Returns a normal to a point A in two dimensions. More...
 
template<std::size_t N>
constexpr float vector_angle (vector< N > const &a, vector< N > const &b)
 
template<matrix_like LH, matrix_like RH>
 requires (LH::rows==RH::rows &&LH::cols==RH::cols) const expr auto operator
 
template<matrix_like M>
 requires (M::rows==2 &&M::cols==2) const expr auto determinant(M const &m)
 
template<matrix_like M>
 requires (M::rows > 2 &&M::cols==M::rows) const expr auto determinant(M const &m)
 
template<matrix_like M>
 requires (M::rows==1 &&M::cols==1) const expr matrix< M
 
template<std::size_t N>
std::ostream & operator<< (std::ostream &os, string_buffer< N > const &sb)
 
template<typename... Callables>
 matcher (Callables &&...) -> matcher< std::decay_t< Callables >... >
 
template<typename Variant , typename... Callables>
decltype(auto) match (Variant &&var, Callables &&... cals)
 
template<typename Variant , typename... Callables>
decltype(auto) apply_on_match (Variant &&var, Callables &&... cals)
 
template<typename T , typename Compare >
constexpr T const & clamp (T const &x, min_max< T > const &mm, Compare &&comp)
 
template<typename T >
constexpr T const & clamp (T const &x, min_max< T > const &mm)
 
template<typename T , typename... Args>
 requires (std::same_as< Args, min_max< T > > &&...) const expr min_max< T > intersection(min_max< T > const &head
 
 f (args)
 
template<typename T >
constexpr min_max< T > expand (min_max< T > const &mm, T const &val)
 
template<typename T >
constexpr bool contains (min_max< T > const &mm, T const &val)
 
template<int Len0, int Mass0, int Time0, int Current0, int Temp0, int Mol0, int Li0, int Angle0, int Byte0, int Len1, int Mass1, int Time1, int Current1, int Temp1, int Mol1, int Li1, int Angle1, int Byte1>
constexpr auto operator* (physical_quantity< Len0, Mass0, Time0, Current0, Temp0, Mol0, Li0, Angle0, Byte0 > lh, physical_quantity< Len1, Mass1, Time1, Current1, Temp1, Mol1, Li1, Angle1, Byte1 > rh)
 Multiplication of physical_quantity multiplies the internal values and the result is a type, where the exponents of each side of the multiplication are added together. More...
 
template<int Len0, int Mass0, int Time0, int Current0, int Temp0, int Mol0, int Li0, int Angle0, int Byte0, int Len1, int Mass1, int Time1, int Current1, int Temp1, int Mol1, int Li1, int Angle1, int Byte1>
constexpr auto operator/ (physical_quantity< Len0, Mass0, Time0, Current0, Temp0, Mol0, Li0, Angle0, Byte0 > lh, physical_quantity< Len1, Mass1, Time1, Current1, Temp1, Mol1, Li1, Angle1, Byte1 > rh)
 Divison of physical_quantiy divides the internal values and the result is a type, where the exponents of each side of the multiplication are subtracted. More...
 
template<int Len, int Mass, int Time, int Current, int Temp, int Mol, int Li, int Angle, int Byte>
constexpr auto sqrt (physical_quantity< Len, Mass, Time, Current, Temp, Mol, Li, Angle, Byte > val)
 Square root of physical quantity is square root of it's value and the exponents are divided in half. More...
 
template<int Power, int Len, int Mass, int Time, int Current, int Temp, int Mol, int Li, int Angle, int Byte>
constexpr auto pow (physical_quantity< Len, Mass, Time, Current, Temp, Mol, Li, Angle, Byte > val)
 Power of physical quantity is power of root of it's value and the exponents are multiplied by the value. More...
 
template<typename TimeType >
void update_limits (pid< TimeType > &pid, min_max< float > lim)
 
template<typename TimeType >
void update_output (pid< TimeType > &pid, float output)
 
template<typename TimeType >
float update (pid< TimeType > &pid, TimeType now, float measured, float desired)
 Call this reularly, the meaning of time value 'now' is up to you, just be consistent. More...
 
template<typename TimeType >
void reset (pid< TimeType > &pid, TimeType now, float last_measured)
 
template<typename Derived , typename ValueType >
constexpr Derived operator+ (quantity< Derived, ValueType > lhs, quantity< Derived, ValueType > const rhs)
 Sum of quantities with same Derived and value_type. More...
 
template<typename Derived , typename ValueType >
constexpr Derived operator- (quantity< Derived, ValueType > lhs, quantity< Derived, ValueType > const rhs)
 Subtraction of quantities with same Derived and value_type. More...
 
template<typename Derived , typename ValueType >
constexpr Derived operator- (quantity< Derived, ValueType > const val)
 Provides negation of the quantity. More...
 
template<typename Derived , typename ValueType , arithmetic_like RhValueType>
constexpr bool operator< (quantity< Derived, ValueType > const lhs, RhValueType const rhs)
 Provides abillity to compare quantity with non-quantity arithmetic value. More...
 
template<typename Derived , typename ValueType , arithmetic_like LhValueType>
constexpr bool operator< (LhValueType const lhs, quantity< Derived, ValueType > const rhs)
 Provides abillity to compare quantity with non-quantity arithmetic value. More...
 
template<typename Derived , typename ValueType >
constexpr Derived operator* (quantity< Derived, ValueType > q, arithmetic auto const val)
 Multiplication of quantity by it's value_type. More...
 
template<typename Derived , typename ValueType >
constexpr Derived operator/ (quantity< Derived, ValueType > q, arithmetic auto const val)
 Division of quantity by it's value_type. More...
 
template<typename Derived , typename ValueType >
constexpr Derived abs (quantity< Derived, ValueType > const q)
 Quantity with absolute value of internal value. More...
 
template<typename Derived , typename ValueType >
constexpr auto cos (quantity< Derived, ValueType > const u)
 Returns cosinus of the quantity as scalar. More...
 
template<typename Derived , typename ValueType >
constexpr auto sin (quantity< Derived, ValueType > const u)
 Returns sinus of the quantity as scalar. More...
 
template<typename Derived , typename ValueType >
constexpr Derived max (quantity< Derived, ValueType > const lh, quantity< Derived, ValueType > const rh)
 Quantity with maximum value of one of the quantities. More...
 
template<typename Derived , typename ValueType >
constexpr Derived min (quantity< Derived, ValueType > const lh, quantity< Derived, ValueType > const rh)
 Quantity with minimum value of one of the quantities. More...
 
template<typename Derived , typename ValueType >
constexpr Derived operator* (ValueType const val, quantity< Derived, ValueType > const q)
 Multiplication of value_type by quantity returns quantity. More...
 
template<typename Derived , typename ValueType >
constexpr ValueType operator/ (ValueType const val, quantity< Derived, ValueType > const q)
 Division of value_type by quantity returns quantity. More...
 
template<typename Numeric >
constexpr view< iterators::numeric_iterator< Numeric > > range (Numeric from, Numeric to)
 Builds numeric view over interval [from, to) More...
 
template<typename Numeric >
constexpr view< iterators::numeric_iterator< Numeric > > range (Numeric to)
 Builds numeric view over interval [0, to) More...
 
template<typename T , std::size_t N>
auto operator<=> (static_circular_buffer< T, N > const &lh, static_circular_buffer< T, N > const &rh)
 
template<typename T , std::size_t N>
bool operator== (static_circular_buffer< T, N > const &lh, static_circular_buffer< T, N > const &rh)
 
template<typename T , std::size_t N>
bool operator!= (static_circular_buffer< T, N > const &lh, static_circular_buffer< T, N > const &rh)
 
template<typename T , std::size_t N>
 requires (trivial_for_static_storage< T >) struct static_storage< T
 
constexpr pointer data () noexcept
 Returns pointer to first item of the storage. More...
 
template<typename... Args>
constexpr T & emplace_item (size_type const i, Args &&... args) noexcept(std::is_nothrow_constructible_v< T, Args... >)
 Constructs an item at position i with arguments args... More...
 
constexpr void delete_item (size_type const i) noexcept(std::is_nothrow_destructible_v< T >)
 Deconstructs an item at position i. More...
 
constexpr reference operator[] (size_type const i) noexcept
 Provides a reference to item at position i. More...
 
template<typename T , std::size_t N>
auto operator<=> (static_vector< T, N > const &lh, static_vector< T, N > const &rh)
 
template<typename T , std::size_t N>
bool operator== (static_vector< T, N > const &lh, static_vector< T, N > const &rh)
 
template<typename T , std::size_t N>
bool operator!= (static_vector< T, N > const &lh, static_vector< T, N > const &rh)
 
template<typename T , std::size_t N>
void swap (static_vector< T, N > const &lh, static_vector< T, N > const &rh) noexcept
 
template<typename T >
auto pretty_type_name ()
 
template<std::size_t N>
 requires (sizeof(uint8_t)==N) struct select_utype< N >
 
template<std::size_t N>
 requires (sizeof(uint16_t)==N) struct select_utype< N >
 
template<std::size_t N>
 requires (sizeof(uint32_t)==N) struct select_utype< N >
 
template<std::size_t N>
 requires (sizeof(uint64_t)==N) struct select_utype< N >
 
template<typename IteratorLh , typename IteratorRh >
constexpr bool operator== (view< IteratorLh > const &lh, view< IteratorRh > const &rh)
 
template<typename IteratorLh , typename IteratorRh >
constexpr bool operator!= (view< IteratorLh > const &lh, view< IteratorRh > const &rh)
 
template<range_container Container>
 view (Container &cont) -> view< iterator_of_t< Container > >
 The container deduction guide uses iterator_of_t. More...
 
template<typename Iter >
constexpr view< Iter > view_n (Iter begin, std::size_t const n)
 Creates view over 'n' items of dataset starting at 'begin' This does not check validity of the range! More...
 
template<data_container Container>
constexpr auto data_view (Container &cont)
 
template<range_container Container>
constexpr view< iterator_of_t< Container > > trim_view (Container &cont, float const r)
 Creates the view over over Container, where we ignore first r*size/2 items and last r*size/2 items. More...
 
constexpr auto reversed (referenceable_container auto &container) -> view< decltype(std::rbegin(container)) >
 Returns view to the Container in reverse order. More...
 
template<typename Iterator , typename EndIterator >
void string_serialize_view (auto &&w, view< Iterator, EndIterator > const &output)
 
template<typename Visitor , typename Variant >
decltype(auto) visit_index (Visitor &&vis, Variant const &var)
 
template<typename Visitor , typename Variant >
decltype(auto) visit (Visitor &&vis, Variant &&var)
 Reimplementation of std::visit. More...
 
template<typename Visitor , typename Variant >
decltype(auto) apply_on_visit (Visitor &&vis, Variant &&var)
 Combines visit and std::apply into one step - provided variant is expanded with visit and apply is called on the present alternative, items from apply are passed to calle to visitor vis. More...
 
template<typename... Iterators>
constexpr zip_iterator< Iterators... > operator+ (zip_iterator< Iterators... > lh, std::ptrdiff_t m)
 
template<typename... Iterators>
constexpr bool operator!= (zip_iterator< Iterators... > const &lh, zip_iterator< Iterators... > const &rh)
 
template<range_container... Ts>
auto zip (Ts &&... cont)
 Creates a view of zip iterators for specified containers. More...
 
template<typename TuplesTuple , std::size_t... ItemIndexes, std::size_t... TupleIndexes>
auto tuple_zip_impl (TuplesTuple &&tpls, std::index_sequence< ItemIndexes... >, std::index_sequence< TupleIndexes... >)
 
template<gettable_container Tuple, gettable_container... Tuples>
auto zip (Tuple &&frst, Tuples &&... tpls)
 Zips a set of gettable containers of same size into a tuples. More...
 

Variables

constexpr float default_epsilon = 1.19e-07f
 
UnaryCallable && f
 
res {}
 
template<std::size_t N>
constexpr auto bounded_constant = bounded< std::size_t, N, N >{}
 Simple type alias for bounded index constants. More...
 
template<typename T >
concept bounded_derived = requires( T val ) { detail::bounded_derived_test( val ); }
 Concept that matchestype deriving from bounded. More...
 
template<typename T >
concept additive_operators
 
template<typename T >
concept multiplicative_operators
 
template<typename T >
concept arithmetic_operators = additive_operators< T > && multiplicative_operators< T >
 
template<typename T >
concept arithmetic_assignment
 
template<typename T >
concept arithmetic_like = arithmetic_operators< T > && arithmetic_assignment< T >
 
template<typename T >
concept arithmetic = std::integral< T > || std::floating_point< T >
 
template<typename T >
concept gettable_container
 
template<typename T >
concept range_container
 so, std::ranges::range is meh because it expects return of begin() being input_output_iterator, which has to be def.constructible More...
 
template<typename T >
concept data_container
 
template<typename T >
concept container = range_container< T > || gettable_container< T > || data_container< T >
 
template<typename T >
concept referenceable_container
 
template<typename T , typename ValueType >
concept range_container_with
 
template<typename T , typename Iterator >
concept range_container_with_iter
 
template<typename T , typename ValueType >
concept data_container_with
 
template<typename T , typename DataIterator >
concept data_container_with_iter
 
template<typename T >
concept static_sized
 
template<typename UnaryCallable , typename Container >
concept container_invocable
 
template<typename UnaryCallable , typename ReturnValue , typename... Args>
concept invocable_returning
 
template<typename T >
concept ostreamlike
 
template<typename T >
concept ostreamable
 
template<typename T , typename Variant >
concept alternative_of
 Thanks for the solution goes to PJBoy@libera. More...
 
template<typename T , typename Tuple >
concept element_of
 
template<typename T >
concept with_value_type = requires { typename T::value_type; }
 
template<typename T , typename Signature >
concept with_signature = std::same_as< typename signature_of< T >::signature, Signature >
 
template<typename T >
concept with_push_back
 
template<typename T , typename U >
concept some = std::same_as< std::remove_cv_t< T >, U >
 
template<typename T >
concept decomposable
 
template<typename T >
concept decomposable_0 = decomposable< T > && ( detail::decompose_count< T >() == 0 )
 
constexpr quaternion neutral_quat { 0.f, 0.f, 0.f, 1.f }
 
template<typename T >
concept vec_point_derived = requires( T val ) { detail::vec_point_derived_test( val ); }
 
constexpr vector< 3 > x_axis { 1, 0, 0 }
 instances of constants in the code for X/Y/Z axis More...
 
constexpr vector< 3 > y_axis { 0, 1, 0 }
 
constexpr vector< 3 > z_axis { 0, 0, 1 }
 
template<typename M >
concept matrix_like
 
template<typename T >
concept is_string_buffer_v = bits::is_string_buffer< T >::value
 
template<typename Derived >
concept nothrow_dereference
 
template<typename Derived >
concept nothrow_add_assign
 
template<typename Derived >
concept nothrow_sub_assign
 
template<typename Derived >
concept nothrow_threeway_compare
 
template<typename Derived >
concept nothrow_equality_compare
 
Args const & args
 
constexpr angle pi = angle{ 3.14159265358979323846f }
 Constants of units that are relevant for us. More...
 
template<typename T >
concept quantity_derived = requires( T val ) { detail::quantity_derived_test( val ); }
 Concept satisfies any type T that inherits from any form of quantity<U>. More...
 
template<typename T >
concept trivial_for_static_storage
 
 N
 
template<typename T >
constexpr bool is_view_v = is_view< T >::value
 
template<typename... Ts>
constexpr bool are_same_v = are_same< Ts... >::value
 
template<typename T , typename... Us>
constexpr bool tuple_has_type_v = tuple_has_type< T, Us... >::value
 
template<typename T >
constexpr bool is_std_tuple_v = is_std_tuple< T >::value
 
template<typename T >
constexpr bool is_std_array_v = is_std_array< T >::value
 
template<typename T >
constexpr bool is_std_vector_v = is_std_vector< T >::value
 
template<typename T >
constexpr std::size_t static_size_v = static_size< T >::value
 Marked deprecated on 19.4.2021. More...
 
template<typename T >
constexpr bool has_static_size_v = static_sized< T >
 
 UnaryCallable
 

Detailed Description

MIT License.

Copyright (c) 2025 Jan Veverak Koniarik

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


Class Documentation

◆ emlabcpp::function_view

class emlabcpp::function_view

template<typename Signature>
class emlabcpp::function_view< Signature >

◆ emlabcpp::pose_distance

struct emlabcpp::pose_distance

distance between two poses in space, represented as 'space distance' and 'angular distance'

Class Members
float angle_dist
float dist

◆ emlabcpp::generic_iterator

struct emlabcpp::generic_iterator

template<typename Derived>
struct emlabcpp::generic_iterator< Derived >

generic_iterator simplifies custom iterator implementation using CRTP.

Users inherit from generic_iterator and pass their class as the Derived template argument. It relies on std::iterator_traits<Derived> for type definitions and provides additional methods based on those implemented in the Derived class.

◆ emlabcpp::pid_coefficients

struct emlabcpp::pid_coefficients
Class Members
float d
float i
float p coeficients

◆ emlabcpp::pid_config

struct emlabcpp::pid_config

Structure to configure the pid regulator.

+ Collaboration diagram for emlabcpp::pid_config:
Class Members
pid_coefficients coefficients
min_max< float > limits limits the output of the pid regulator and internal anti-windup mechanism

◆ emlabcpp::static_function_base

class emlabcpp::static_function_base

template<typename CallableType, std::size_t Capacity, std::size_t Align>
class emlabcpp::static_function_base< CallableType, Capacity, Align >

◆ emlabcpp::iterator_of

struct emlabcpp::iterator_of

template<typename Container>
struct emlabcpp::iterator_of< Container >


iterator_of is structure where iterator_of<Container>::type returns type of iterator that is returned by cont.begin();

Class Members
typedef decltype(begin(declval< add_lvalue_reference_t< Container > >())) type

◆ emlabcpp::data_iterator_of

struct emlabcpp::data_iterator_of

template<typename Container>
struct emlabcpp::data_iterator_of< Container >


data_iterator_of is structure where data_iterator_of<Container>::type returns type of pointer that is returned by cont.data();

Class Members
typedef decltype(data(declval< add_lvalue_reference_t< Container > >())) type

◆ emlabcpp::are_same

struct emlabcpp::are_same

template<typename...>
struct emlabcpp::are_same<... >


are_same<Ts..>::value is true if all Ts... are equal types.

◆ emlabcpp::tuple_has_type

struct emlabcpp::tuple_has_type

template<typename T, typename Tuple>
struct emlabcpp::tuple_has_type< T, Tuple >


tuple_has_type<T, Tuple>::value is true if Tuple s std::tuple and contains type T

◆ emlabcpp::signature_of

struct emlabcpp::signature_of

template<typename Signature>
struct emlabcpp::signature_of< Signature >


◆ emlabcpp::signature_of< ReturnType(Args...) >

struct emlabcpp::signature_of< ReturnType(Args...) >

template<typename ReturnType, typename... Args>
struct emlabcpp::signature_of< ReturnType(Args...) >

Class Members
args_type
typedef ReturnType return_type
signature

◆ emlabcpp::mapped

struct emlabcpp::mapped

template<typename Container, typename UnaryCallable>
struct emlabcpp::mapped< Container, UnaryCallable >


mapped<T,F>::type is type returned by instance of F::operator() when applied on items from instance of T. It can differentiate between tuples or containers

◆ emlabcpp::select_utype

struct emlabcpp::select_utype

template<std::size_t>
struct emlabcpp::select_utype< size_t >


◆ emlabcpp::type_map

struct emlabcpp::type_map

template<typename, template< typename > class>
struct emlabcpp::type_map< typename, class >


◆ emlabcpp::type_map< std::tuple< Ts... >, Fun >

struct emlabcpp::type_map< std::tuple< Ts... >, Fun >

template<typename... Ts, template< typename > class Fun>
struct emlabcpp::type_map< std::tuple< Ts... >, Fun >

Class Members
type

◆ emlabcpp::type_tag

struct emlabcpp::type_tag

template<typename T>
struct emlabcpp::type_tag< T >


Class Members
typedef T type

◆ emlabcpp::index_of

struct emlabcpp::index_of

template<typename T, typename Variant>
struct emlabcpp::index_of< T, Variant >


Typedef Documentation

◆ acceleration

using emlabcpp::acceleration = typedef physical_quantity< 1, 0, -2, 0, 0, 0, 0, 0, 0 >

◆ amount_of_substance

using emlabcpp::amount_of_substance = typedef physical_quantity< 0, 0, 0, 0, 0, 1, 0, 0, 0 >

◆ angle

using emlabcpp::angle = typedef physical_quantity< 0, 0, 0, 0, 0, 0, 0, 1, 0 >

◆ angular_velocity

using emlabcpp::angular_velocity = typedef physical_quantity< 0, 0, -1, 0, 0, 0, 0, 1, 0 >

◆ area

using emlabcpp::area = typedef physical_quantity< 2, 0, 0, 0, 0, 0, 0, 0, 0 >

◆ byte

using emlabcpp::byte = typedef physical_quantity< 0, 0, 0, 0, 0, 0, 0, 0, 1 >

◆ const_pointer

using emlabcpp::const_pointer = typedef T const*

◆ const_reference

using emlabcpp::const_reference = typedef T const&

◆ current

using emlabcpp::current = typedef physical_quantity< 0, 0, 0, 1, 0, 0, 0, 0, 0 >

◆ data_iterator_of_t

template<typename Container >
using emlabcpp::data_iterator_of_t = typedef typename data_iterator_of< Container >::type

◆ distance

using emlabcpp::distance = typedef length

◆ force

using emlabcpp::force = typedef physical_quantity< 1, 1, -2, 0, 0, 0, 0, 0, 0 >

◆ frequency

using emlabcpp::frequency = typedef physical_quantity< 0, 0, -1, 0, 0, 0, 0, 0, 0 >

◆ index_of_v

template<typename T , typename Variant >
using emlabcpp::index_of_v = typedef index_of< T, Variant >::value

◆ iterator_of_t

template<typename Container >
using emlabcpp::iterator_of_t = typedef typename iterator_of< Container >::type

◆ length

using emlabcpp::length = typedef physical_quantity< 1, 0, 0, 0, 0, 0, 0, 0, 0 >

◆ line

template<std::size_t N>
using emlabcpp::line = typedef std::array< point< N >, 2 >

◆ luminous_intensity

using emlabcpp::luminous_intensity = typedef physical_quantity< 0, 0, 0, 0, 0, 0, 1, 0, 0 >

◆ mapped_t

template<typename Container , typename UnaryCallable >
using emlabcpp::mapped_t = typedef typename mapped< Container, UnaryCallable >::type

◆ mass

using emlabcpp::mass = typedef physical_quantity< 0, 1, 0, 0, 0, 0, 0, 0, 0 >

◆ pointer

using emlabcpp::pointer = typedef T*

◆ power

using emlabcpp::power = typedef physical_quantity< 2, 1, -3, 0, 0, 0, 0, 0, 0 >

◆ radius

using emlabcpp::radius = typedef length

◆ reference

using emlabcpp::reference = typedef T&

◆ resistance

using emlabcpp::resistance = typedef physical_quantity< 2, 1, -3, -2, 0, 0, 0, 0, 0 >

◆ select_utype_t

template<std::size_t N>
using emlabcpp::select_utype_t = typedef typename select_utype< N >::type

◆ size_type

using emlabcpp::size_type = typedef std::size_t

◆ static_function

template<typename Signature , std::size_t Capacity>
using emlabcpp::static_function = typedef static_function_base< Signature, Capacity, alignof( void* ) >

◆ temp

using emlabcpp::temp = typedef physical_quantity< 0, 0, 0, 0, 1, 0, 0, 0, 0 >

◆ timeq

using emlabcpp::timeq = typedef physical_quantity< 0, 0, 1, 0, 0, 0, 0, 0, 0 >

◆ triangle

template<std::size_t N>
using emlabcpp::triangle = typedef simplex< point< N >, 2 >

◆ type_map_t

template<typename T , template< typename > class Fun>
using emlabcpp::type_map_t = typedef typename type_map< T, Fun >::type

◆ unitless

using emlabcpp::unitless = typedef physical_quantity< 0, 0, 0, 0, 0, 0, 0, 0, 0 >

Type alieases of physical quantity for used quantities.

◆ value_type

using emlabcpp::value_type = typedef T

◆ velocity

using emlabcpp::velocity = typedef physical_quantity< 1, 0, -1, 0, 0, 0, 0, 0, 0 >

◆ voltage

using emlabcpp::voltage = typedef physical_quantity< 2, 1, -3, -1, 0, 0, 0, 0, 0 >

◆ volume

using emlabcpp::volume = typedef physical_quantity< 3, 0, 0, 0, 0, 0, 0, 0, 0 >

Enumeration Type Documentation

◆ contiguous_container_type

enum emlabcpp::contiguous_container_type : uint8_t
strong
Enumerator
ARRAY 
OBJECT 

◆ contiguous_request_adapter_errors

Enumerator
MISSING_NODE 
WRONG_TYPE 
CHILD_MISSING 
FULL 

◆ contiguous_tree_type

enum emlabcpp::contiguous_tree_type : uint8_t
strong
Enumerator
VALUE 
OBJECT 
ARRAY 

◆ outcome_e

enum emlabcpp::outcome_e : uint8_t
strong
Enumerator
SUCCESS 
FAILURE 
ERROR 

◆ result_e

enum emlabcpp::result_e : uint8_t
strong
Enumerator
SUCCESS 
ERROR 

Function Documentation

◆ abs() [1/2]

template<typename Derived , typename ValueType >
constexpr Derived emlabcpp::abs ( quantity< Derived, ValueType > const  q)
constexpr

Quantity with absolute value of internal value.

◆ abs() [2/2]

template<typename Derived , std::size_t N>
constexpr Derived emlabcpp::abs ( vec_point_base< Derived, N > const &  a)
constexpr

Creates absolute version of A - removing signs on all dimensions.

References N, range(), and res.

◆ accumulate()

template<container Container, typename T , typename BinaryCallable >
constexpr T emlabcpp::accumulate ( Container &&  cont,
init,
BinaryCallable &&  f 
)
constexpr

Applies callable 'f(init,x)' to each element of container 'x' and actual value of 'init' in iteration, returns a result of last application.

NOLINT(bugprone-use-after-move)

References f, for_each(), and init().

◆ all_of()

template<container Container, container_invocable< Container > PredicateCallable = std::identity>
constexpr bool emlabcpp::all_of ( Container &&  cont,
PredicateCallable &&  f = std::identity() 
)
constexpr

Returns true if call to predicate 'f(x)' returns true for all items in 'cont'.

References any_of(), and f.

◆ almost_equal() [1/2]

constexpr bool emlabcpp::almost_equal ( quaternion const &  q,
quaternion const &  s,
float  eps = default_epsilon 
)
constexpr

References all_of(), and almost_equal().

◆ almost_equal() [2/2]

template<typename T >
constexpr bool emlabcpp::almost_equal ( T const &  lh,
T const &  rh,
float const  eps = default_epsilon 
)
constexpr

Two items 'lh' and 'rh' are almost equal if their difference is smaller than value 'eps'.

References abs().

◆ angle_shortest_path()

constexpr float emlabcpp::angle_shortest_path ( quaternion const &  m,
quaternion const &  n 
)
constexpr

References dot(), norm2_of(), and sqrt().

◆ any_of()

template<container Container, container_invocable< Container > PredicateCallable = std::identity>
constexpr bool emlabcpp::any_of ( Container &&  cont,
PredicateCallable &&  f = std::identity() 
)
constexpr

Returns true if call to predicate 'f(x)' returns true for at least one item x in 'cont'.

References f, find_if(), and res.

◆ apply_on_match()

template<typename Variant , typename... Callables>
decltype( auto ) emlabcpp::apply_on_match ( Variant &&  var,
Callables &&...  cals 
)

References apply_on_visit().

◆ apply_on_visit()

template<typename Visitor , typename Variant >
decltype( auto ) emlabcpp::apply_on_visit ( Visitor &&  vis,
Variant &&  var 
)

Combines visit and std::apply into one step - provided variant is expanded with visit and apply is called on the present alternative, items from apply are passed to calle to visitor vis.

References visit().

◆ avg()

template<container Container, container_invocable< Container > UnaryCallable = std::identity, typename T = std::decay_t< mapped_t< Container, UnaryCallable > >>
constexpr T emlabcpp::avg ( Container &&  cont,
UnaryCallable &&  f = std::identity() 
)
constexpr

Applies callable 'f(x)' to each element of container 'cont' and returns the average value of each call.

References cont_size(), f, for_each(), and res.

◆ axis_projection_distance()

template<std::size_t N>
constexpr float emlabcpp::axis_projection_distance ( point< N > const &  a,
vector< N > const &  axis_direction 
)
constexpr

Function to calculate distance of projection of point A.

That point is projected on axis defined only by it's direction - 'axis_direction'. The distance of that projection from the [0,0,0] coordinate is returned.

References dot(), and vector_cast().

◆ bytes()

template<typename... Args, std::size_t N = sizeof...( Args )>
constexpr std::array< std::byte, N > emlabcpp::bytes ( Args const &...  args)
constexpr

Conveft the provided arguments into array of std::byte.

References args.

◆ ceil_to()

template<typename T >
constexpr T emlabcpp::ceil_to ( val,
base 
)
constexpr

takes an value val and rounds it up to nearest multiply of base

◆ center_of()

template<std::size_t N, std::size_t U>
constexpr point< N > emlabcpp::center_of ( simplex< point< N >, U > const &  s)
constexpr

References avg(), point_cast(), sum(), and vector_cast().

◆ clamp() [1/2]

template<typename T >
constexpr T const& emlabcpp::clamp ( T const &  x,
min_max< T > const &  mm 
)
constexpr

References clamp().

◆ clamp() [2/2]

template<typename T , typename Compare >
constexpr T const& emlabcpp::clamp ( T const &  x,
min_max< T > const &  mm,
Compare &&  comp 
)
constexpr

◆ cobs_decode_view()

template<typename Iter >
view< decode_cobs_iter< Iter >, decode_cobs_iter< Iter > > emlabcpp::cobs_decode_view ( view< Iter >  data)

References data(), and find().

◆ compose()

template<typename T , typename Tuple >
constexpr T emlabcpp::compose ( Tuple  tpl)
constexpr

References args.

◆ cont_size()

template<container Container>
constexpr std::size_t emlabcpp::cont_size ( Container const &  cont)
constexprnoexcept

Returns the size of the container, regardless of what it is.

◆ contains() [1/2]

template<container Container, typename T >
constexpr bool emlabcpp::contains ( Container const &  cont,
T const &  item 
)
constexpr

Checks if container cont contains at least one occurence of item, returns true/false.

References cont_size(), and find().

◆ contains() [2/2]

template<typename T >
constexpr bool emlabcpp::contains ( min_max< T > const &  mm,
T const &  val 
)
constexpr

◆ convert_view()

template<typename T , typename Container , typename Iterator = iterator_of_t< Container >>
view< iterators::convert_iterator< T, Iterator > > emlabcpp::convert_view ( Container &&  cont)

◆ convert_view_n()

template<typename T , typename Iterator >
constexpr view< iterators::convert_iterator< T, Iterator > > emlabcpp::convert_view_n ( Iterator  begin,
std::size_t  n 
)
constexpr

References view_n().

◆ copy()

template<container Container, typename Iterator >
void emlabcpp::copy ( Container &&  cont,
Iterator  iter 
)

References for_each().

◆ cos()

template<typename Derived , typename ValueType >
constexpr auto emlabcpp::cos ( quantity< Derived, ValueType > const  u)
constexpr

Returns cosinus of the quantity as scalar.

◆ count()

template<container Container, container_invocable< Container > UnaryCallable = std::identity>
constexpr std::size_t emlabcpp::count ( Container &&  cont,
UnaryCallable &&  f = std::identity() 
)
constexpr

Applies the predicate 'f(x)' to each element of container 'cont' and returns the count of items, for which f(x) returned 'true'.

References f, for_each(), and res.

◆ cross_product()

constexpr vector< 3 > emlabcpp::cross_product ( vector< 3 > const &  a,
vector< 3 > const &  b 
)
constexpr

Calculates cross product between points A and B.

◆ data()

constexpr const_pointer emlabcpp::data ( )
constexprnoexcept

Returns pointer to first item of the storage.

◆ data_view()

template<data_container Container>
constexpr auto emlabcpp::data_view ( Container &  cont)
constexpr

References data(), and view_n().

◆ decode_cobs()

std::tuple< bool, view< std::byte* > > emlabcpp::decode_cobs ( view< std::byte const * >  source,
view< std::byte * >  target 
)
inline

Decodes data from source range into target buffer with Consistent Overhead Byte Stuffing (COBS) encoding, returns bool indicating whenever conversion succeeded and subview used for conversion from target buffer.

Note that this does not expect 0 at the end.

References emlabcpp::view< Iterator, EndIterator >::begin(), emlabcpp::view< Iterator, EndIterator >::end(), emlabcpp::view< Iterator, EndIterator >::front(), emlabcpp::cobs_decoder::iter(), and tail().

◆ decompose()

template<decomposable_0 T>
constexpr std::tuple emlabcpp::decompose ( T &&  )
constexpr

◆ delete_item()

constexpr void emlabcpp::delete_item ( size_type const  i)
constexprnoexcept

Deconstructs an item at position i.

◆ dimensional_max()

template<typename Derived , std::size_t N>
constexpr Derived emlabcpp::dimensional_max ( vec_point_base< Derived, N > const &  a,
vec_point_base< Derived, N > const &  b 
)
constexpr

Calculates a C, where C[i] = max(A[i], B[i]) holds for 0 <= i < N.

References max(), N, range(), and res.

◆ dimensional_min()

template<typename Derived , std::size_t N>
constexpr Derived emlabcpp::dimensional_min ( vec_point_base< Derived, N > const &  a,
vec_point_base< Derived, N > const &  b 
)
constexpr

Calculates a C, where C[i] = min(A[i], B[i]) holds for 0 <= i < N.

References min(), N, range(), and res.

◆ dimensional_min_max_elem()

template<typename Container , typename UnaryFunction = std::identity, typename Derived = std::decay_t< mapped_t< Container, UnaryFunction > >>
constexpr min_max< Derived > emlabcpp::dimensional_min_max_elem ( Container const &  cont,
UnaryFunction &&  f = std::identity{} 
)
constexpr

◆ distance_of() [1/4]

template<std::size_t N>
constexpr float emlabcpp::distance_of ( line< N > const &  l,
point< N > const &  p 
)
constexpr

References clamp(), dot(), and length2_of().

◆ distance_of() [2/4]

template<std::size_t N>
constexpr float emlabcpp::distance_of ( point< N > const &  a,
point< N > const &  b 
)
constexpr

Returns euclidian distance of point A from point B.

References N, pow(), range(), sqrt(), and sum().

◆ distance_of() [3/4]

template<std::size_t N>
constexpr float emlabcpp::distance_of ( point< N > const &  p,
line< N > const &  line 
)
constexpr

References distance_of().

◆ distance_of() [4/4]

constexpr pose_distance emlabcpp::distance_of ( pose const &  x,
pose const &  y 
)
constexpr

returns PoseDistance between provided poses

References angle_shortest_path(), distance_of(), emlabcpp::pose::orientation, and emlabcpp::pose::position.

◆ dot() [1/2]

constexpr float emlabcpp::dot ( quaternion const &  q,
quaternion const &  s 
)
constexpr

◆ dot() [2/2]

template<typename Derived , std::size_t N>
constexpr float emlabcpp::dot ( vec_point_base< Derived, N > const &  a,
vec_point_base< Derived, N > const &  b 
)
constexpr

Calculates the dot product between A and B.

References N, range(), and sum().

◆ EMLABCPP_GENERATE_DECOMPOSE()

emlabcpp::EMLABCPP_GENERATE_DECOMPOSE ( 16  ,
a0  ,
a1  ,
a2  ,
a3  ,
a4  ,
a5  ,
a6  ,
a7  ,
a8  ,
a9  ,
a10  ,
a11  ,
a12  ,
a13  ,
a14  ,
a15   
)

◆ emplace_item()

template<typename... Args>
constexpr T& emlabcpp::emplace_item ( size_type const  i,
Args &&...  args 
)
constexprnoexcept

Constructs an item at position i with arguments args...

References args.

◆ encode_cobs()

std::tuple< bool, view< std::byte* > > emlabcpp::encode_cobs ( view< std::byte const * >  source,
view< std::byte * >  target 
)
inline

Encodes data from source range into target buffer with Consistent Overhead Byte Stuffing (COBS) encoding, returns bool indicating whenever conversion succeeded and subview used for conversion from target buffer.

Note that this does not store 0 at the end.

References emlabcpp::cobs_encoder::insert().

◆ enumerate()

template<typename Container >
auto emlabcpp::enumerate ( Container &&  cont)

References range(), and zip().

◆ equal()

template<range_container LhContainer, range_container RhContainer, typename BinaryPredicateCallable = std::equal_to< void >>
constexpr bool emlabcpp::equal ( LhContainer &&  lh,
RhContainer &&  rh,
BinaryPredicateCallable &&  f = std::equal_to< void >{} 
)
constexpr

Returns true if containers 'lh' and 'rh' has same size and calls to predicate f - f(lh[i],rh[i]) return true for each item.

Default callable is equality. all 0 <= i < size()

◆ expand()

template<typename T >
constexpr min_max< T > emlabcpp::expand ( min_max< T > const &  mm,
T const &  val 
)
constexpr

◆ f()

emlabcpp::f ( args  )

◆ filled()

template<std::size_t N, typename T >
constexpr std::array< T, N > emlabcpp::filled ( T const &  item)
constexpr

Constructs an array filled with value x

References N, and range().

◆ find()

template<container Container, typename T >
constexpr auto emlabcpp::find ( Container &&  cont,
T const &  item 
)
constexpr

Finds first item in container 'cont' that is equal to 'item', returns iterator for container, or index for tuples.

References find_if().

◆ find_if()

template<range_container Container, container_invocable< Container > PredicateCallable = std::identity>
constexpr auto emlabcpp::find_if ( Container &&  cont,
PredicateCallable &&  f = std::identity() 
)
constexpr

Returns iterator for first item, for which call to predicate f(*iter) holds true.

end() iterator is returned otherwise. The end() iterator is taken once, before the container is iterated.

References f.

◆ find_if_index()

template<std::size_t N, typename PredicateCallable >
constexpr std::size_t emlabcpp::find_if_index ( PredicateCallable &&  f)
constexpr

Executes unary callable f() with template argument of type 'std::size_t', which ranges from 0 to N until first call that returns true.

Function returns the index on which predicate returned true.

References f, N, and res.

◆ for_cross_joint()

template<container LhContainer, container RhContainer, typename BinaryCallable >
constexpr void emlabcpp::for_cross_joint ( LhContainer &&  lh_cont,
RhContainer &&  rh_cont,
BinaryCallable &&  f 
)
constexpr

Applies binary callable 'f(x,y)' to each combination of items x from lh_cont and y from rh_cont

References f, and for_each().

◆ for_each()

template<range_container Container, container_invocable< Container > UnaryCallable>
constexpr void emlabcpp::for_each ( Container &&  cont,
UnaryCallable &&  f 
)
constexpr

Applies unary callable 'f' to each element of container 'cont'.

References f.

◆ for_each_index()

template<std::size_t N, typename NullCallable >
constexpr void emlabcpp::for_each_index ( NullCallable &&  f)
constexpr

Executes unary callable f() with template argument of type 'std::size_t', which ranges from 0 to N.

References f.

◆ get_triangle_sphere_center()

point< 3 > emlabcpp::get_triangle_sphere_center ( triangle< 3 > const &  tri)
inline

◆ init()

template<referenceable_container Container, typename Iterator = iterator_of_t< Container >>
constexpr view< Iterator > emlabcpp::init ( Container &&  cont,
int const  step = 1 
)
constexpr

Returns range over Container, which skips last item of container.

◆ inverse() [1/2]

constexpr pose emlabcpp::inverse ( pose const &  x)
constexpr

◆ inverse() [2/2]

constexpr quaternion emlabcpp::inverse ( quaternion const &  q)
constexpr

◆ inverse_transform()

template<typename T >
constexpr auto emlabcpp::inverse_transform ( T const &  item,
pose const &  transformation 
)
constexpr

References inverse(), and transform().

◆ joined()

template<range_container Container, typename T , container_invocable< Container > UnaryCallable = std::identity>
constexpr T emlabcpp::joined ( Container &&  cont,
T const &  val,
UnaryCallable &&  f = std::identity() 
)
constexpr

Function applies callable f to each item in container cont and contacts results with operator+, val is used as a separator between the items.

Returns f(cont[0]) + val + f(cont[1]) + val + ... + val + f(cont[n]);.

References f, res, and tail().

◆ length2_of()

template<typename Derived , std::size_t N>
constexpr auto emlabcpp::length2_of ( vec_point_base< Derived, N > const &  a)
constexpr

Returns squared distance of A from [0,0,0], this is a squared length of vector represented by A.

References N, pow(), range(), res, and sum().

◆ length_of()

template<typename Derived , std::size_t N>
constexpr float emlabcpp::length_of ( vec_point_base< Derived, N > const &  a)
constexpr

Returns distance of A from [0,0,0], this is a length of vector represented by A.

References length2_of(), and sqrt().

◆ lin_interp() [1/2]

constexpr pose emlabcpp::lin_interp ( pose const &  from,
pose const &  goal,
float  factor 
)
constexpr

linear interpolation between base se and goal pose, with factor 0 'base' is returned, with factor 1 'goal' is returned.

With factor 0.5, pose between 'base' and 'goal' pose is returned

References emlabcpp::pose::orientation, emlabcpp::pose::position, and slerp().

◆ lin_interp() [2/2]

template<typename Derived , std::size_t N>
constexpr Derived emlabcpp::lin_interp ( vec_point_base< Derived, N > const &  from,
vec_point_base< Derived, N > const &  goal,
float  factor 
)
constexpr

References N, range(), and res.

◆ lineary_interpolate_path() [1/2]

template<std::size_t N>
std::vector< point< N > > emlabcpp::lineary_interpolate_path ( std::vector< point< N > > const &  ipath,
float  d_step 
)
inline

References distance_of(), lin_interp(), range(), and res.

◆ lineary_interpolate_path() [2/2]

std::vector< pose > emlabcpp::lineary_interpolate_path ( std::vector< pose > const &  ipath,
float  d_step,
float  a_step 
)
inline

◆ map_f()

template<impl::map_f_collectable ResultContainer, container Container, container_invocable< Container > UnaryCallable = std::identity>
ResultContainer emlabcpp::map_f ( Container &&  cont,
UnaryCallable &&  f = std::identity() 
)

Calls callable f(x) for each item in container 'cont' (or tuple) and stores result in 'ResultContainer', which is returned.

The behavior depends on what kind of 'ResultContainer' is used, rules are in this order:

  1. std::array is constructed and res[i] = f(cont[i]) is used for i = 0...N
  2. if 'ResultContainer' has push_back(x) method, that is used to insert result of calls to f(x)
  3. insert(x) method is used to insert result of calls to f(x)

References f, for_each(), and res.

◆ map_f_to_a()

template<std::size_t N, range_container Container, container_invocable< Container > UnaryCallable = std::identity, typename T = std::decay_t< mapped_t< Container, UnaryCallable > >>
std::array< T, N > emlabcpp::map_f_to_a ( Container &&  cont,
UnaryCallable &&  f = std::identity() 
)

Calls callable f(cont[i]) for i = 0...N and stores the result in array of an size N.

Calls callable f(cont[i]) for i = 0...N and stores the result in array of an appropiate size.

The function requires size 'N' as template parameter

THe size N is infered from container.

References f.

◆ map_range()

template<additive_operators T, arithmetic_operators U>
constexpr U emlabcpp::map_range ( input,
from_min,
from_max,
to_min,
to_max 
)
constexpr

maps input value 'input' from input range to equivalent value in output range

◆ match()

template<typename Variant , typename... Callables>
decltype( auto ) emlabcpp::match ( Variant &&  var,
Callables &&...  cals 
)

References visit().

◆ matcher()

template<typename... Callables>
emlabcpp::matcher ( Callables &&  ...) -> matcher< std::decay_t< Callables >... >

◆ max() [1/2]

template<typename Derived , typename ValueType >
constexpr Derived emlabcpp::max ( quantity< Derived, ValueType > const  lh,
quantity< Derived, ValueType > const  rh 
)
constexpr

Quantity with maximum value of one of the quantities.

◆ max() [2/2]

template<typename Derived , std::size_t N>
constexpr Derived emlabcpp::max ( vec_point_base< Derived, N > const &  a,
vec_point_base< Derived, N > const &  b 
)
constexpr

◆ max_elem()

template<container Container, container_invocable< Container > UnaryCallable = std::identity, typename T = std::decay_t< mapped_t< Container, UnaryCallable > >>
constexpr T emlabcpp::max_elem ( Container &&  cont,
UnaryCallable &&  f = std::identity() 
)
constexpr

Applies unary callable 'f(x)' to each element of container 'cont', returns the largest return value of 'f(x)' calls.

Returns lowest value of the return type if container is empty.

References f, for_each(), std::numeric_limits< T >::lowest(), and max().

◆ merge_arrays()

template<typename Arr , typename... Arrs>
constexpr auto emlabcpp::merge_arrays ( Arr &&  first,
Arrs &&...  arrs 
)
constexpr

Expects multiple std::arrays on input, and merges all together into one std::array instance.

References f.

◆ min() [1/2]

template<typename Derived , typename ValueType >
constexpr Derived emlabcpp::min ( quantity< Derived, ValueType > const  lh,
quantity< Derived, ValueType > const  rh 
)
constexpr

Quantity with minimum value of one of the quantities.

◆ min() [2/2]

template<typename Derived , std::size_t N>
constexpr Derived const& emlabcpp::min ( vec_point_base< Derived, N > const &  a,
vec_point_base< Derived, N > const &  b 
)
constexpr

◆ min_elem()

template<container Container, container_invocable< Container > UnaryCallable = std::identity, typename T = std::decay_t< mapped_t< Container, UnaryCallable > >>
constexpr T emlabcpp::min_elem ( Container &&  cont,
UnaryCallable &&  f = std::identity() 
)
constexpr

Applies unary callable 'f(x) to each element of container 'cont‘, returns the smallest return value of 'f(x)’ calls.

Returns maximum value of the return type if container is empty.

References f, for_each(), max(), and min().

◆ min_max_elem()

template<container Container, container_invocable< Container > UnaryCallable = std::identity, typename T = std::decay_t< mapped_t< Container, UnaryCallable > >>
constexpr min_max< T > emlabcpp::min_max_elem ( Container &&  cont,
UnaryCallable &&  f = std::identity() 
)
constexpr

Applies unary callable 'f(x)' to each element of container 'cont', returns the largest and the smallest return value.

of 'f(x)' calls. Returns the default value of the 'f(x)' return type if container is empty.

References f, for_each(), std::numeric_limits< T >::lowest(), max(), min(), and res.

◆ none_of()

template<container Container, container_invocable< Container > PredicateCallable = std::identity>
constexpr bool emlabcpp::none_of ( Container &&  cont,
PredicateCallable &&  f = std::identity() 
)
constexpr

Returns true if call to predicate 'f(x)' returns false for all items in 'cont'.

References any_of(), and f.

◆ norm2_of()

constexpr float emlabcpp::norm2_of ( quaternion const &  q)
constexpr

References dot().

◆ normal_of() [1/2]

constexpr vector< 3 > emlabcpp::normal_of ( triangle< 3 > const &  tri)
constexpr

References cross_product().

◆ normal_of() [2/2]

constexpr vector< 2 > emlabcpp::normal_of ( vector< 2 > const &  a)
constexpr

Returns a normal to a point A in two dimensions.

◆ normalized()

template<typename Derived , std::size_t N>
constexpr Derived emlabcpp::normalized ( vec_point_base< Derived, N > const &  a)
constexpr

Calculates normalized version of A, this means that length(A) equals to 1.

References length_of().

◆ operator!=() [1/7]

constexpr bool emlabcpp::operator!= ( pose const &  x,
pose const &  y 
)
constexpr

negation of operator== between poses

◆ operator!=() [2/7]

constexpr bool emlabcpp::operator!= ( quaternion const &  q,
quaternion const &  s 
)
constexpr

◆ operator!=() [3/7]

template<typename Item , std::size_t N>
constexpr bool emlabcpp::operator!= ( simplex< Item, N > const &  lh,
simplex< Item, N > const &  rh 
)
constexpr

◆ operator!=() [4/7]

template<typename T , std::size_t N>
bool emlabcpp::operator!= ( static_circular_buffer< T, N > const &  lh,
static_circular_buffer< T, N > const &  rh 
)

◆ operator!=() [5/7]

template<typename T , std::size_t N>
bool emlabcpp::operator!= ( static_vector< T, N > const &  lh,
static_vector< T, N > const &  rh 
)

◆ operator!=() [6/7]

template<typename IteratorLh , typename IteratorRh >
constexpr bool emlabcpp::operator!= ( view< IteratorLh > const &  lh,
view< IteratorRh > const &  rh 
)
constexpr

◆ operator!=() [7/7]

template<typename... Iterators>
constexpr bool emlabcpp::operator!= ( zip_iterator< Iterators... > const &  lh,
zip_iterator< Iterators... > const &  rh 
)
constexpr

◆ operator*() [1/9]

template<int Len0, int Mass0, int Time0, int Current0, int Temp0, int Mol0, int Li0, int Angle0, int Byte0, int Len1, int Mass1, int Time1, int Current1, int Temp1, int Mol1, int Li1, int Angle1, int Byte1>
constexpr auto emlabcpp::operator* ( physical_quantity< Len0, Mass0, Time0, Current0, Temp0, Mol0, Li0, Angle0, Byte0 >  lh,
physical_quantity< Len1, Mass1, Time1, Current1, Temp1, Mol1, Li1, Angle1, Byte1 >  rh 
)
constexpr

Multiplication of physical_quantity multiplies the internal values and the result is a type, where the exponents of each side of the multiplication are added together.

◆ operator*() [2/9]

constexpr quaternion emlabcpp::operator* ( point< 3 > const &  x,
quaternion const &  q 
)
constexpr

◆ operator*() [3/9]

template<std::size_t N>
constexpr point< N > emlabcpp::operator* ( point< N a,
point< N > const &  b 
)
constexpr

Multiplication of points multiplies each coordinate of A by coordinate of B on same dimension.

References N, and range().

◆ operator*() [4/9]

template<typename Derived , typename ValueType >
constexpr Derived emlabcpp::operator* ( quantity< Derived, ValueType >  q,
arithmetic auto const  val 
)
constexpr

Multiplication of quantity by it's value_type.

◆ operator*() [5/9]

constexpr quaternion emlabcpp::operator* ( quaternion const &  q,
point< 3 > const &  x 
)
constexpr

◆ operator*() [6/9]

constexpr quaternion emlabcpp::operator* ( quaternion const &  q,
quaternion const &  s 
)
constexpr

◆ operator*() [7/9]

template<typename Derived , std::size_t N, typename T >
constexpr Derived emlabcpp::operator* ( s,
vec_point_base< Derived, N > const &  a 
)
constexpr

Multiplies each coordinate of A by item 's' of type T, if T satifies std::is_arithmetic.

◆ operator*() [8/9]

template<typename Derived , typename ValueType >
constexpr Derived emlabcpp::operator* ( ValueType const  val,
quantity< Derived, ValueType > const  q 
)
constexpr

Multiplication of value_type by quantity returns quantity.

◆ operator*() [9/9]

template<typename Derived , std::size_t N, typename T , typename = typename std::enable_if_t< std::is_arithmetic_v< T > >>
constexpr Derived emlabcpp::operator* ( vec_point_base< Derived, N > const &  a,
s 
)
constexpr

Multiplies each coordinate of A by item 's' of type T, if T satifies std::is_arithmetic.

References N, range(), and res.

◆ operator+() [1/5]

template<std::size_t N>
constexpr point< N > emlabcpp::operator+ ( point< N a,
vector< N > const &  b 
)
constexpr

Returns a result of addition a to b, viz += operator.

◆ operator+() [2/5]

template<typename Derived , typename ValueType >
constexpr Derived emlabcpp::operator+ ( quantity< Derived, ValueType >  lhs,
quantity< Derived, ValueType > const  rhs 
)
constexpr

Sum of quantities with same Derived and value_type.

◆ operator+() [3/5]

constexpr quaternion emlabcpp::operator+ ( quaternion const &  lh,
quaternion const &  rh 
)
constexpr

◆ operator+() [4/5]

template<std::size_t N>
constexpr vector< N > emlabcpp::operator+ ( vector< N lh,
vector< N > const &  rh 
)
constexpr

◆ operator+() [5/5]

template<typename... Iterators>
constexpr zip_iterator< Iterators... > emlabcpp::operator+ ( zip_iterator< Iterators... >  lh,
std::ptrdiff_t  m 
)
constexpr

◆ operator-() [1/5]

template<std::size_t N>
constexpr vector< N > emlabcpp::operator- ( point< N a,
point< N > const &  b 
)
constexpr

Returns a result of subtraction of A from B, viz -= operator.

References vector_cast().

◆ operator-() [2/5]

template<std::size_t N>
constexpr point< N > emlabcpp::operator- ( point< N a,
vector< N > const &  b 
)
constexpr

Returns a result of subtraction a to b, viz += operator.

◆ operator-() [3/5]

template<typename Derived , typename ValueType >
constexpr Derived emlabcpp::operator- ( quantity< Derived, ValueType > const  val)
constexpr

Provides negation of the quantity.

◆ operator-() [4/5]

template<typename Derived , typename ValueType >
constexpr Derived emlabcpp::operator- ( quantity< Derived, ValueType >  lhs,
quantity< Derived, ValueType > const  rhs 
)
constexpr

Subtraction of quantities with same Derived and value_type.

◆ operator-() [5/5]

constexpr quaternion emlabcpp::operator- ( quaternion const &  q)
constexpr

◆ operator/() [1/4]

template<int Len0, int Mass0, int Time0, int Current0, int Temp0, int Mol0, int Li0, int Angle0, int Byte0, int Len1, int Mass1, int Time1, int Current1, int Temp1, int Mol1, int Li1, int Angle1, int Byte1>
constexpr auto emlabcpp::operator/ ( physical_quantity< Len0, Mass0, Time0, Current0, Temp0, Mol0, Li0, Angle0, Byte0 >  lh,
physical_quantity< Len1, Mass1, Time1, Current1, Temp1, Mol1, Li1, Angle1, Byte1 >  rh 
)
constexpr

Divison of physical_quantiy divides the internal values and the result is a type, where the exponents of each side of the multiplication are subtracted.

◆ operator/() [2/4]

template<typename Derived , typename ValueType >
constexpr Derived emlabcpp::operator/ ( quantity< Derived, ValueType >  q,
arithmetic auto const  val 
)
constexpr

Division of quantity by it's value_type.

◆ operator/() [3/4]

template<typename Derived , typename ValueType >
constexpr ValueType emlabcpp::operator/ ( ValueType const  val,
quantity< Derived, ValueType > const  q 
)
constexpr

Division of value_type by quantity returns quantity.

◆ operator/() [4/4]

template<typename Derived , std::size_t N, typename T , typename = typename std::enable_if_t< std::is_arithmetic_v< T > >>
constexpr Derived emlabcpp::operator/ ( vec_point_base< Derived, N > const &  a,
s 
)
constexpr

Divides each coordinate of A by item 's' of type T, if T satifies std::is_arithmetic.

References N, range(), and res.

◆ operator<() [1/5]

template<typename Derived , typename ValueType , arithmetic_like LhValueType>
constexpr bool emlabcpp::operator< ( LhValueType const  lhs,
quantity< Derived, ValueType > const  rhs 
)
constexpr

Provides abillity to compare quantity with non-quantity arithmetic value.

◆ operator<() [2/5]

constexpr bool emlabcpp::operator< ( pose const &  x,
pose const &  y 
)
constexpr

◆ operator<() [3/5]

template<typename Derived , typename ValueType , arithmetic_like RhValueType>
constexpr bool emlabcpp::operator< ( quantity< Derived, ValueType > const  lhs,
RhValueType const  rhs 
)
constexpr

Provides abillity to compare quantity with non-quantity arithmetic value.

◆ operator<() [4/5]

constexpr bool emlabcpp::operator< ( quaternion const &  q,
quaternion const &  s 
)
constexpr

References find_if(), and range().

◆ operator<() [5/5]

template<typename Item , std::size_t N>
constexpr bool emlabcpp::operator< ( simplex< Item, N > const &  lh,
simplex< Item, N > const &  rh 
)
constexpr

References find_if(), N, and range().

◆ operator<<()

template<std::size_t N>
std::ostream& emlabcpp::operator<< ( std::ostream &  os,
string_buffer< N > const &  sb 
)

◆ operator<=()

template<typename Item , std::size_t N>
constexpr bool emlabcpp::operator<= ( simplex< Item, N > const &  lh,
simplex< Item, N > const &  rh 
)
constexpr

◆ operator<=>() [1/2]

template<typename T , std::size_t N>
auto emlabcpp::operator<=> ( static_circular_buffer< T, N > const &  lh,
static_circular_buffer< T, N > const &  rh 
)

◆ operator<=>() [2/2]

template<typename T , std::size_t N>
auto emlabcpp::operator<=> ( static_vector< T, N > const &  lh,
static_vector< T, N > const &  rh 
)

◆ operator==() [1/6]

constexpr bool emlabcpp::operator== ( pose const &  x,
pose const &  y 
)
constexpr

compares poses on their position and orientation

References emlabcpp::pose::orientation, and emlabcpp::pose::position.

◆ operator==() [2/6]

constexpr bool emlabcpp::operator== ( quaternion const &  q,
quaternion const &  s 
)
constexpr

◆ operator==() [3/6]

template<typename Item , std::size_t N>
constexpr bool emlabcpp::operator== ( simplex< Item, N > const &  lh,
simplex< Item, N > const &  rh 
)
constexpr

References equal().

◆ operator==() [4/6]

template<typename T , std::size_t N>
bool emlabcpp::operator== ( static_circular_buffer< T, N > const &  lh,
static_circular_buffer< T, N > const &  rh 
)

◆ operator==() [5/6]

template<typename T , std::size_t N>
bool emlabcpp::operator== ( static_vector< T, N > const &  lh,
static_vector< T, N > const &  rh 
)

◆ operator==() [6/6]

template<typename IteratorLh , typename IteratorRh >
constexpr bool emlabcpp::operator== ( view< IteratorLh > const &  lh,
view< IteratorRh > const &  rh 
)
constexpr

◆ operator>()

template<typename Item , std::size_t N>
constexpr bool emlabcpp::operator> ( simplex< Item, N > const &  lh,
simplex< Item, N > const &  rh 
)
constexpr

◆ operator>=()

template<typename Item , std::size_t N>
constexpr bool emlabcpp::operator>= ( simplex< Item, N > const &  lh,
simplex< Item, N > const &  rh 
)
constexpr

◆ operator[]()

constexpr const_reference emlabcpp::operator[] ( size_type const  i)
constexprnoexcept

Provides a reference to item at position i.

◆ point_angle()

template<std::size_t N>
constexpr float emlabcpp::point_angle ( point< N > const &  a,
point< N > const &  b 
)
constexpr

References vector_angle(), and vector_cast().

◆ point_cast()

template<std::size_t N>
constexpr point< N > emlabcpp::point_cast ( vector< N > const &  v)
constexpr

◆ pow()

template<int Power, int Len, int Mass, int Time, int Current, int Temp, int Mol, int Li, int Angle, int Byte>
constexpr auto emlabcpp::pow ( physical_quantity< Len, Mass, Time, Current, Temp, Mol, Li, Angle, Byte >  val)
constexpr

Power of physical quantity is power of root of it's value and the exponents are multiplied by the value.

◆ pretty_type_name()

template<typename T >
auto emlabcpp::pretty_type_name ( )

/ central function for returning name of type that can demangle if necessary

References res.

◆ range() [1/2]

template<typename Numeric >
constexpr view< iterators::numeric_iterator< Numeric > > emlabcpp::range ( Numeric  from,
Numeric  to 
)
constexpr

Builds numeric view over interval [from, to)

◆ range() [2/2]

template<typename Numeric >
constexpr view< iterators::numeric_iterator< Numeric > > emlabcpp::range ( Numeric  to)
constexpr

Builds numeric view over interval [0, to)

◆ requires() [1/15]

template<gettable_container Container, container_invocable< Container > PredicateCallable = std::identity>
emlabcpp::requires ( !range_container< Container >  ) const

Returns index of an element in tuple 't', for which call to predicate f(x) holds true, otherwise returns index of 'past the end' item - size of the tuple.

References f, and emlabcpp::impl::find_if_impl().

◆ requires() [2/15]

template<gettable_container Container, container_invocable< Container > UnaryCallable>
emlabcpp::requires ( !range_container< Container >  ) const &&

Applies unary callable 'f' to each element of container 'cont'.

◆ requires() [3/15]

template<bounded_derived IndexType, typename Callable >
emlabcpp::requires ( !requires(Callable f) { { f.template operator()< 0 >() } -> std::same_as< void >;}  ) const

Function expectes bounded value as index input and callable.

Based on the value of index, f() is called with template argument std::size_t with internal value of provided index. Expectes the bounded value to be valid (that is within the range)

References f.

◆ requires() [4/15]

template<bounded_derived IndexType, typename Callable >
requires emlabcpp::requires ( Callable  f)

References f.

◆ requires() [5/15]

template<matrix_like LH, matrix_like RH>
emlabcpp::requires ( LH::rows  = =RH::rows &&LH::cols==RH::cols) const

References range().

◆ requires() [6/15]

template<matrix_like M>
emlabcpp::requires ( M::rows  ,
2 &&M::cols  = = M::rows 
) const &

References N, and res.

◆ requires() [7/15]

template<matrix_like M>
emlabcpp::requires ( M::rows  = = 1 && M::cols == 1) const

References res.

◆ requires() [8/15]

template<matrix_like M>
emlabcpp::requires ( M::rows  = = 2 && M::cols == 2) const &

◆ requires() [9/15]

template<std::size_t N>
emlabcpp::requires ( sizeof(uint16_t)  = N)

◆ requires() [10/15]

template<std::size_t N>
emlabcpp::requires ( sizeof(uint32_t)  = N)

◆ requires() [11/15]

template<std::size_t N>
emlabcpp::requires ( sizeof(uint64_t)  = N)

◆ requires() [12/15]

template<std::size_t N>
emlabcpp::requires ( sizeof(uint8_t)  = N)

◆ requires() [13/15]

template<typename Enum >
emlabcpp::requires ( std::is_enum_v< Enum >  )

Returns a string-like name of the enum value val

◆ requires() [14/15]

template<typename T , typename... Args>
emlabcpp::requires ( std::same_as< Args, min_max< T > > &&  ...) const &

◆ requires() [15/15]

template<typename T , std::size_t N>
emlabcpp::requires ( trivial_for_static_storage< T >  )

◆ reset()

template<typename TimeType >
void emlabcpp::reset ( pid< TimeType > &  pid,
TimeType  now,
float  last_measured 
)

◆ reversed()

constexpr auto emlabcpp::reversed ( referenceable_container auto &  container) -> view< decltype( std::rbegin( container ) ) >
constexpr

Returns view to the Container in reverse order.

References container.

◆ rotate() [1/4]

constexpr point< 3 > emlabcpp::rotate ( point< 3 > const &  x,
quaternion const &  q 
)
constexpr

References inverse().

◆ rotate() [2/4]

constexpr pose emlabcpp::rotate ( pose const &  x,
quaternion const &  quat 
)
constexpr

Pose X is rotated based on quaternion 'quad'.

References emlabcpp::pose::orientation, and emlabcpp::pose::position.

◆ rotate() [3/4]

constexpr quaternion emlabcpp::rotate ( quaternion const &  x,
quaternion const &  q 
)
constexpr

References inverse().

◆ rotate() [4/4]

constexpr vector< 3 > emlabcpp::rotate ( vector< 3 > const &  v,
quaternion const &  q 
)
constexpr

References point_cast(), rotate(), and vector_cast().

◆ scale()

template<std::size_t N>
constexpr triangle< N > emlabcpp::scale ( triangle< N > const &  t,
point< N > const &  scales 
)
constexpr

◆ select_index() [1/2]

emlabcpp::select_index ( ,
[&res, &f] < std::size_t i >() { res=f.template operator()< i >();}   
)

References f, and res.

◆ select_index() [2/2]

constexpr void emlabcpp::select_index ( IndexType  i,
Callable &&  f 
)
constexpr

References f.

◆ shortest_arc_quat()

constexpr quaternion emlabcpp::shortest_arc_quat ( point< 3 >  x,
point< 3 >  y 
)
constexpr

◆ sign()

template<typename T >
constexpr int emlabcpp::sign ( T const &  val)
constexpr

returns sign of variable T: -1,0,1

◆ sin()

template<typename Derived , typename ValueType >
constexpr auto emlabcpp::sin ( quantity< Derived, ValueType > const  u)
constexpr

Returns sinus of the quantity as scalar.

◆ slerp()

constexpr quaternion emlabcpp::slerp ( quaternion const &  q,
quaternion const &  s,
float  f 
)
constexpr

References angle_shortest_path(), dot(), f, and sin().

◆ sqrt()

template<int Len, int Mass, int Time, int Current, int Temp, int Mol, int Li, int Angle, int Byte>
constexpr auto emlabcpp::sqrt ( physical_quantity< Len, Mass, Time, Current, Temp, Mol, Li, Angle, Byte >  val)
constexpr

Square root of physical quantity is square root of it's value and the exponents are divided in half.

◆ steps()

constexpr std::size_t emlabcpp::steps ( pose_distance  dist,
float  dist_step,
float  angle_step 
)
constexpr

returns steps necessary for linear interpolation of distance between poses 'dis', such that:

  • the number of steps is minimized
  • space distance between interpolated poses is smaller than dist_step
  • angle distance between interpolated poses is smaller than angle_step

References emlabcpp::pose_distance::angle_dist, emlabcpp::pose_distance::dist, and max().

◆ string_serialize_view()

template<typename Iterator , typename EndIterator >
void emlabcpp::string_serialize_view ( auto &&  w,
view< Iterator, EndIterator > const &  output 
)

◆ sum()

template<container Container, container_invocable< Container > UnaryCallable = std::identity, typename T = std::decay_t< mapped_t< Container, UnaryCallable > >>
constexpr T emlabcpp::sum ( Container &&  cont,
UnaryCallable &&  f = std::identity(),
init = {} 
)
constexpr

Applies f(x) to each item of container 'cont', returns the sum of all the return values of each call to 'f(x)' and 'init' item.

◆ swap()

template<typename T , std::size_t N>
void emlabcpp::swap ( static_vector< T, N > const &  lh,
static_vector< T, N > const &  rh 
)
noexcept

◆ tail()

template<referenceable_container Container, typename Iterator = iterator_of_t< Container >>
constexpr view< Iterator > emlabcpp::tail ( Container &&  cont,
int const  step = 1 
)
constexpr

Returns range over Container, which skips first item of container.

References emlabcpp::cfg::next().

◆ transform() [1/5]

template<typename T >
constexpr auto emlabcpp::transform ( min_max< T > const &  mm,
pose const &  transformation 
)
constexpr

◆ transform() [2/5]

constexpr point< 3 > emlabcpp::transform ( point< 3 > const &  a,
pose const &  transformation 
)
constexpr

Point A is rotated based on 'transformation' orientation and than moved based on 'transformation' position.

References emlabcpp::pose::orientation, emlabcpp::pose::position, rotate(), and vector_cast().

◆ transform() [3/5]

constexpr pose emlabcpp::transform ( pose const &  x,
pose const &  transformation 
)
constexpr

Pose X is rotated based on 'transformation' orientation and than moved based on 'transformation' position.

References emlabcpp::pose::orientation, emlabcpp::pose::position, and transform().

◆ transform() [4/5]

constexpr triangle< 3 > emlabcpp::transform ( triangle< 3 > const &  t,
pose const &  transformation 
)
constexpr

References transform().

◆ transform() [5/5]

constexpr vector< 3 > emlabcpp::transform ( vector< 3 > const &  v,
pose const &  transformation 
)
constexpr

◆ trim_view()

template<range_container Container>
constexpr view< iterator_of_t< Container > > emlabcpp::trim_view ( Container &  cont,
float const  r 
)
constexpr

Creates the view over over Container, where we ignore first r*size/2 items and last r*size/2 items.

This can be used to get the dataset without first/last 5% for example, by using r=0.1

◆ tuple_zip_impl()

template<typename TuplesTuple , std::size_t... ItemIndexes, std::size_t... TupleIndexes>
auto emlabcpp::tuple_zip_impl ( TuplesTuple &&  tpls,
std::index_sequence< ItemIndexes... >  ,
std::index_sequence< TupleIndexes... >   
)

References f.

◆ until_index()

template<std::size_t i, typename PredicateCallable >
constexpr bool emlabcpp::until_index ( PredicateCallable &&  f)
constexpr

Executes predicate f() with template argument of type 'std::size_t', which ranges from 0 to i until first call that returns true.

Function returns whenever the f was called or not.

References f.

◆ update()

template<typename TimeType >
float emlabcpp::update ( pid< TimeType > &  pid,
TimeType  now,
float  measured,
float  desired 
)

Call this reularly, the meaning of time value 'now' is up to you, just be consistent.

Algorithm changes it's internal value output to the value that should be set to a 'thing' that controls measured_ value. It tries to control the 'thing' so the measured eventually converges to 'desired' value

improvements from naive PID:

  • we work with derivation of measured, not error (error jumps in case you change desired value a lot)
  • we store i_sum entirely (i * sum_) instead of just the sum_, makes it easier to change the scale of i (imagine what happens when you store sum_, use i*sum_ in the formula nad change i from 1 to 100)

References emlabcpp::pid< TimeType >::cfg, clamp(), emlabcpp::pid_config::coefficients, emlabcpp::pid_coefficients::d, emlabcpp::pid_coefficients::i, emlabcpp::pid< TimeType >::i_sum, emlabcpp::pid< TimeType >::last_measured, emlabcpp::pid< TimeType >::last_time, emlabcpp::pid_config::limits, emlabcpp::pid< TimeType >::output, and emlabcpp::pid_coefficients::p.

◆ update_limits()

template<typename TimeType >
void emlabcpp::update_limits ( pid< TimeType > &  pid,
min_max< float >  lim 
)

◆ update_output()

template<typename TimeType >
void emlabcpp::update_output ( pid< TimeType > &  pid,
float  output 
)

◆ variance()

template<container Container, container_invocable< Container > UnaryCallable = std::identity, typename T = std::decay_t< mapped_t< Container, UnaryCallable > >>
constexpr T emlabcpp::variance ( Container &&  cont,
UnaryCallable &&  f = std::identity() 
)
constexpr

Applies callable 'f(x)' to each element of container 'cont' and returns the variance of values returned from the call.

The f is applied twice to each element.

References avg(), cont_size(), f, res, and sum().

◆ vector_angle()

template<std::size_t N>
constexpr float emlabcpp::vector_angle ( vector< N > const &  a,
vector< N > const &  b 
)
constexpr

References dot(), length2_of(), and sqrt().

◆ vector_cast()

template<std::size_t N>
constexpr vector< N > emlabcpp::vector_cast ( point< N > const &  p)
constexpr

◆ view()

template<range_container Container>
emlabcpp::view ( Container &  cont) -> view< iterator_of_t< Container > >

The container deduction guide uses iterator_of_t.

◆ view_n()

template<typename Iter >
constexpr view< Iter > emlabcpp::view_n ( Iter  begin,
std::size_t const  n 
)
constexpr

Creates view over 'n' items of dataset starting at 'begin' This does not check validity of the range!

References emlabcpp::cfg::next().

◆ visit()

template<typename Visitor , typename Variant >
decltype( auto ) emlabcpp::visit ( Visitor &&  vis,
Variant &&  var 
)

Reimplementation of std::visit.

This one trades worse complexity (linear) in favor of less assembly generated.

References visit_index().

◆ visit_index()

template<typename Visitor , typename Variant >
decltype( auto ) emlabcpp::visit_index ( Visitor &&  vis,
Variant const &  var 
)

◆ volume_of()

template<std::size_t N>
constexpr float emlabcpp::volume_of ( simplex< point< N >, N > const &  simplex)
constexpr

◆ zip() [1/2]

template<range_container... Ts>
auto emlabcpp::zip ( Ts &&...  cont)

Creates a view of zip iterators for specified containers.

Beware that the function does not check that containers have same size of ranges. If the size differs, increments of begin iterator will never equal to the end iterator.

References view().

◆ zip() [2/2]

template<gettable_container Tuple, gettable_container... Tuples>
auto emlabcpp::zip ( Tuple &&  frst,
Tuples &&...  tpls 
)

Zips a set of gettable containers of same size into a tuples.

zip(tuple<A,B>(), tuple<C,D>()) -> tuple<tuple<A,C>, <tuple<B,d>>;

References tuple_zip_impl().

Variable Documentation

◆ additive_operators

template<typename T >
concept emlabcpp::additive_operators
Initial value:
= requires( T a, T b ) {
{ a + b } -> std::convertible_to< T >;
{ a - b } -> std::convertible_to< T >;
}
requires(!range_container< Container >) std
Definition: impl.h:81

arithmetic related concepts

◆ alternative_of

template<typename T , typename Variant >
concept emlabcpp::alternative_of
Initial value:
= []< typename... Ts >( std::variant< Ts... >* ) {
return ( std::same_as< T, Ts > || ... );
}( static_cast< Variant* >( nullptr ) )

Thanks for the solution goes to PJBoy@libera.


◆ are_same_v

template<typename... Ts>
constexpr bool emlabcpp::are_same_v = are_same< Ts... >::value
constexpr

◆ args

Args const& emlabcpp::args
Initial value:
{
min_max< T > res{ head }
T res
Definition: algorithm.h:505

◆ arithmetic

template<typename T >
concept emlabcpp::arithmetic = std::integral< T > || std::floating_point< T >

◆ arithmetic_assignment

template<typename T >
concept emlabcpp::arithmetic_assignment
Initial value:
= requires( T a, T b ) {
{ a += b };
{ a -= b };
{ a /= b };
{ a *= b };
}

◆ arithmetic_like

template<typename T >
concept emlabcpp::arithmetic_like = arithmetic_operators< T > && arithmetic_assignment< T >

◆ arithmetic_operators

template<typename T >
concept emlabcpp::arithmetic_operators = additive_operators< T > && multiplicative_operators< T >

◆ bounded_constant

template<std::size_t N>
constexpr auto emlabcpp::bounded_constant = bounded< std::size_t, N, N >{}
constexpr

Simple type alias for bounded index constants.

◆ bounded_derived

template<typename T >
concept emlabcpp::bounded_derived = requires( T val ) { detail::bounded_derived_test( val ); }

Concept that matchestype deriving from bounded.

◆ container

template<typename T >
concept emlabcpp::container = range_container< T > || gettable_container< T > || data_container< T >

◆ container_invocable

template<typename UnaryCallable , typename Container >
concept emlabcpp::container_invocable
Initial value:
=
requires( Container cont, UnaryCallable f ) { f( *cont.begin() ); } ||
requires( Container cont ) { std::tuple_size< std::decay_t< Container > >::value == 0; } ||
requires( Container cont, UnaryCallable f ) {
f( std::get< 0 >( cont ) );
}
UnaryCallable
Definition: types.h:54
UnaryCallable && f
Definition: algorithm.h:161

invocable related concepts

◆ data_container

template<typename T >
concept emlabcpp::data_container
Initial value:
=
(
requires( T a ) { data( a ); } || requires( T a ) { std::data( a ); } ) &&
(
requires( T a ) { size( a ); } || requires( T a ) { std::size( a ); } )
constexpr pointer data() noexcept
Returns pointer to first item of the storage.
Definition: static_storage.h:108

◆ data_container_with

template<typename T , typename ValueType >
concept emlabcpp::data_container_with
Initial value:
=
data_container< T > && std::same_as< typename T::value_type, ValueType >

◆ data_container_with_iter

template<typename T , typename DataIterator >
concept emlabcpp::data_container_with_iter
Initial value:
=
data_container< T > && std::convertible_to< data_iterator_of_t< T >, DataIterator >

◆ decomposable

template<typename T >
concept emlabcpp::decomposable
Initial value:
= std::is_class_v< std::decay_t< T > > && !gettable_container< T > &&
( detail::decompose_count< T >() >= 0 )

◆ decomposable_0

template<typename T >
concept emlabcpp::decomposable_0 = decomposable< T > && ( detail::decompose_count< T >() == 0 )

◆ default_epsilon

constexpr float emlabcpp::default_epsilon = 1.19e-07f
constexpr

◆ element_of

template<typename T , typename Tuple >
concept emlabcpp::element_of
Initial value:
= []< typename... Ts >( std::tuple< Ts... >* ) {
return ( std::same_as< T, Ts > || ... );
}( static_cast< Tuple* >( nullptr ) )

◆ f

auto emlabcpp::f
Initial value:
{
std::apply(
[&f]< typename... Items >( Items&&... items ) {
( f( std::forward< Items >( items ) ), ... );
},
std::forward< Container >( cont ) )

◆ gettable_container

template<typename T >
concept emlabcpp::gettable_container
Initial value:
= requires( T a ) {
{ std::tuple_size< std::decay_t< T > >::value } -> std::convertible_to< std::size_t >;
}

container related concepts

◆ has_static_size_v

template<typename T >
constexpr bool emlabcpp::has_static_size_v = static_sized< T >
constexpr

has_static_size<T>::value is true in case type T have size deduceable at compile time

◆ invocable_returning

template<typename UnaryCallable , typename ReturnValue , typename... Args>
concept emlabcpp::invocable_returning
Initial value:
= requires( UnaryCallable f, Args... args ) {
{ f( args... ) } -> std::same_as< ReturnValue >;
}
Args const & args
Definition: min_max.h:83

◆ is_std_array_v

template<typename T >
constexpr bool emlabcpp::is_std_array_v = is_std_array< T >::value
constexpr

◆ is_std_tuple_v

template<typename T >
constexpr bool emlabcpp::is_std_tuple_v = is_std_tuple< T >::value
constexpr

◆ is_std_vector_v

template<typename T >
constexpr bool emlabcpp::is_std_vector_v = is_std_vector< T >::value
constexpr

◆ is_string_buffer_v

template<typename T >
concept emlabcpp::is_string_buffer_v = bits::is_string_buffer< T >::value

◆ is_view_v

template<typename T >
constexpr bool emlabcpp::is_view_v = is_view< T >::value
constexpr

◆ matrix_like

template<typename M >
concept emlabcpp::matrix_like
Initial value:
= requires( M m, std::size_t i, std::size_t j ) {
{ M::rows } -> std::convertible_to< std::size_t >;
{ M::cols } -> std::convertible_to< std::size_t >;
{ m[i][j] } -> std::convertible_to< typename M::value_type >;
}
requires(M::rows==1 &&M::cols==1) const expr matrix< M
Definition: matrix.h:361

◆ multiplicative_operators

template<typename T >
concept emlabcpp::multiplicative_operators
Initial value:
= requires( T a, T b ) {
{ a / b } -> std::convertible_to< T >;
{ a* b } -> std::convertible_to< T >;
}

◆ N

emlabcpp::N
Initial value:
{
static constexpr std::size_t capacity = N
N
Definition: static_storage.h:97

◆ neutral_quat

constexpr quaternion emlabcpp::neutral_quat { 0.f, 0.f, 0.f, 1.f }
constexpr

◆ nothrow_add_assign

template<typename Derived >
concept emlabcpp::nothrow_add_assign
Initial value:
= requires( Derived d ) {
{ d += 1 } noexcept;
}

◆ nothrow_dereference

template<typename Derived >
concept emlabcpp::nothrow_dereference
Initial value:
= requires( Derived d ) {
{ *d } noexcept;
}

◆ nothrow_equality_compare

template<typename Derived >
concept emlabcpp::nothrow_equality_compare
Initial value:
= requires( Derived d ) {
{ d == d } noexcept;
}

◆ nothrow_sub_assign

template<typename Derived >
concept emlabcpp::nothrow_sub_assign
Initial value:
= requires( Derived d ) {
{ d -= 1 } noexcept;
}

◆ nothrow_threeway_compare

template<typename Derived >
concept emlabcpp::nothrow_threeway_compare
Initial value:
= requires( Derived d ) {
{ d <=> d } noexcept;
}

◆ ostreamable

template<typename T >
concept emlabcpp::ostreamable
Initial value:
= requires( std::ostream& os, T item ) {
{ os << item } -> std::convertible_to< std::ostream& >;
}

◆ ostreamlike

template<typename T >
concept emlabcpp::ostreamlike
Initial value:
= !std::is_array_v< T > && requires( T val ) {
requires detail::directly_streamable_for< T, uint8_t >;
requires detail::directly_streamable_for< T, uint16_t >;
requires detail::directly_streamable_for< T, uint32_t >;
requires detail::directly_streamable_for< T, int8_t >;
requires detail::directly_streamable_for< T, int16_t >;
requires detail::directly_streamable_for< T, int32_t >;
requires detail::directly_streamable_for< T, float >;
requires detail::directly_streamable_for< T, double >;
requires detail::directly_streamable_for< T, bool >;
requires detail::directly_streamable_for< T, void const* >;
requires detail::directly_streamable_for< T, std::nullptr_t >;
}

◆ pi

constexpr angle emlabcpp::pi = angle{ 3.14159265358979323846f }
constexpr

Constants of units that are relevant for us.

◆ quantity_derived

template<typename T >
concept emlabcpp::quantity_derived = requires( T val ) { detail::quantity_derived_test( val ); }

Concept satisfies any type T that inherits from any form of quantity<U>.

◆ range_container

template<typename T >
concept emlabcpp::range_container
Initial value:
=
( (
requires( T a ) { begin( a ); } || requires( T a ) { std::begin( a ); } ) &&
(
requires( T a ) { end( a ); } || requires( T a ) { std::end( a ); } ) ) ||
std::is_bounded_array_v< T >

so, std::ranges::range is meh because it expects return of begin() being input_output_iterator, which has to be def.constructible

◆ range_container_with

template<typename T , typename ValueType >
concept emlabcpp::range_container_with
Initial value:
=
range_container< T > && std::same_as< typename T::value_type, ValueType >

◆ range_container_with_iter

template<typename T , typename Iterator >
concept emlabcpp::range_container_with_iter
Initial value:
=
range_container< T > && std::convertible_to< iterator_of_t< T >, Iterator >

◆ referenceable_container

template<typename T >
concept emlabcpp::referenceable_container
Initial value:
=
is_view< T >::value || ( range_container< T > && !std::is_rvalue_reference_v< T > )

◆ res

return emlabcpp::res {}

◆ some

template<typename T , typename U >
concept emlabcpp::some = std::same_as< std::remove_cv_t< T >, U >

◆ static_size_v

template<typename T >
constexpr std::size_t emlabcpp::static_size_v = static_size< T >::value
constexpr

Marked deprecated on 19.4.2021.

◆ static_sized

template<typename T >
concept emlabcpp::static_sized
Initial value:
= requires( T a ) {
{ std::tuple_size< std::decay_t< T > >::value } -> std::convertible_to< std::size_t >;
}

◆ trivial_for_static_storage

template<typename T >
concept emlabcpp::trivial_for_static_storage
Initial value:
=
std::is_trivially_default_constructible_v< T > && std::is_trivially_destructible_v< T >

◆ tuple_has_type_v

template<typename T , typename... Us>
constexpr bool emlabcpp::tuple_has_type_v = tuple_has_type< T, Us... >::value
constexpr

◆ UnaryCallable

emlabcpp::UnaryCallable
Initial value:
{
using type = decltype( std::declval< UnaryCallable >()(
std::get< 0 >( std::declval< Container >() ) ) )

◆ vec_point_derived

template<typename T >
concept emlabcpp::vec_point_derived = requires( T val ) { detail::vec_point_derived_test( val ); }

◆ with_push_back

template<typename T >
concept emlabcpp::with_push_back
Initial value:
=
requires( T a, typename T::value_type b ) { a.push_back( std::move( b ) ); }
std::variant< int64_t, float, bool, string_buffer > value_type
Definition: base.h:51

◆ with_signature

template<typename T , typename Signature >
concept emlabcpp::with_signature = std::same_as< typename signature_of< T >::signature, Signature >

◆ with_value_type

template<typename T >
concept emlabcpp::with_value_type = requires { typename T::value_type; }

◆ x_axis

constexpr vector< 3 > emlabcpp::x_axis { 1, 0, 0 }
constexpr

instances of constants in the code for X/Y/Z axis

◆ y_axis

constexpr vector< 3 > emlabcpp::y_axis { 0, 1, 0 }
constexpr

◆ z_axis

constexpr vector< 3 > emlabcpp::z_axis { 0, 0, 1 }
constexpr