Mundy: Multibody Nonlocal Dynamics Version of the Day
Loading...
Searching...
No Matches
mundy Namespace Reference

Namespaces

namespace  convex
namespace  geom
namespace  mesh
namespace  Ownership
 Literal class enums! These are clearer and easier to work with than bools or explicit enums.

Classes

class  AABB
class  aggregate
 An aggregate: A bag of compile-time tagged types In other words, a compile-time unordered map of arbitrary types indexed by tag type. More...
struct  aggregate_has
 Check if an aggregate type has a value with the given Tag usage aggregate_has_v<Tag, AggType>. More...
struct  aggregate_tag
 The I'th aggregate tag. More...
struct  aggregate_tag< I, aggregate< Ts... > >
struct  all_have_tags
 Check if all types in a pack define an alias named tag_type. More...
struct  all_tags_unique
 Check if all tag_type values in a tagged value pack are unique. More...
class  AMatrix
 Class for an NxM (num rows x num columns) matrix with arithmetic entries. More...
class  AQuaternion
 AQuaternion class with floating point entries (an integer-valued quaternion doesn't make much sense). More...
class  Array
 A simplistic array type with a fixed size and type. More...
class  AScalar
 Class for an owning or viewing arithmetic scalar. More...
class  AVector
 Class for an Nx1 vector with arithmetic entries. More...
class  BallJoint
 A ball-and-socket joint between two points. More...
class  Circle3D
class  Circle3DCircle3DObjective
struct  contains_tag
 Check if a tagged value pack contains a value with the given Tag. More...
struct  contains_tag< Tag, First, Rest... >
struct  contains_type
 Check if a type is in a variadic list of types. More...
struct  count_type
 Count how many times a type appears in a variadic list of types. More...
class  Ellipsoid
struct  Euclidean
 The distance types. More...
class  FeneSpring
 A hookean spring between two points with a max length and spring constant. More...
class  FreeSpaceMetric
 Non-periodic (open-boundary) metric. All operations are identities. More...
struct  has_tag_type
 Check if a type defines an alias named tag_type. More...
struct  has_tag_type< T, std::void_t< typename T::tag_type > >
class  HookeanSpring
 A hookean spring between two points with a rest length and spring constant. More...
class  host_ptr
 A reference-counted shared handle to a host-resident T whose handle is trivially copyable onto a device. More...
struct  impl_is_ellipsoid
 (Implementation) Type trait to determine if a type is am Ellipsoid
struct  impl_is_ellipsoid< Ellipsoid< Scalar, PointType, OrientationType > >
struct  impl_is_line
 (Implementation) Type trait to determine if a type is a Line
struct  impl_is_line< Line< Scalar, PointType > >
struct  impl_is_ring
 (Implementation) Type trait to determine if a type is a Ring
struct  impl_is_ring< Ring< Scalar, PointType, QuaternionType > >
struct  impl_is_spherocylinder
 (Implementation) Type trait to determine if a type is a Spherocylinder
struct  impl_is_spherocylinder< Spherocylinder< Scalar, PointType, QuaternionType > >
struct  impl_is_spherocylinder_segment
 (Implementation) Type trait to determine if a type is a SpherocylinderSegment
struct  impl_is_spherocylinder_segment< SpherocylinderSegment< Scalar, PointType > >
struct  impl_is_v_segment
 (Implementation) Type trait to determine if a type is a VSegment
struct  impl_is_v_segment< VSegment< Scalar, PointType > >
struct  imple_is_line_segment
 (Implementation) Type trait to determine if a type is a LineSegment
struct  imple_is_line_segment< LineSegment< Scalar, StartPointType, EndPointType > >
struct  index_finder
 Find the index in the variadic list of types that matches the given type. More...
struct  index_finder< T >
struct  index_finder< T, First, Rest... >
struct  index_of_tag
 Find the index of Tag inside a pack of tagged components. More...
struct  is_aabb
 Type trait to determine if a type is an AABB.
struct  is_aabb_impl
 (Implementation) Type trait to determine if a type is an AABB
struct  is_aabb_impl< AABB< Scalar, MinPointType, MaxPointType > >
struct  is_ball_joint
 Type trait to determine if a type is a BallJoint. More...
struct  is_ball_joint< BallJoint< Scalar, LineSegmentType, OwnershipType > >
struct  is_ball_joint< const BallJoint< Scalar, LineSegmentType, OwnershipType > >
struct  is_char_array
struct  is_char_array< char[N]>
struct  is_char_array< const char[N]>
struct  is_circle3d
 Type trait to determine if a type is a Circle3d.
struct  is_circle3d_impl
 (Implementation) Type trait to determine if a type is a Circle3d
struct  is_circle3d_impl< Circle3D< Scalar, PointType, QuaternionType > >
struct  is_ellipsoid
 Type trait to determine if a type is an Ellipsoid.
struct  is_fene_spring
 Type trait to determine if a type is a FeneSpring. More...
struct  is_fene_spring< const FeneSpring< Scalar, LineSegmentType, OwnershipType > >
struct  is_fene_spring< FeneSpring< Scalar, LineSegmentType, OwnershipType > >
struct  is_finite
 Trait: does a primitive type have finite spatial extent? More...
struct  is_finite< APoint< Scalar, Accessor > >
 APoint (and therefore Point) represents a finite position in space. More...
struct  is_finite< const APoint< Scalar, Accessor > >
struct  is_finite< T, std::void_t< decltype(std::remove_cv_t< T >::is_finite)> >
struct  is_free_space_metric
 True when T is any instantiation of FreeSpaceMetric. More...
struct  is_free_space_metric< FreeSpaceMetric< Scalar > >
struct  is_hookean_spring
 Type trait to determine if a type is a HookeanSpring. More...
struct  is_hookean_spring< const HookeanSpring< Scalar, LineSegmentType, OwnershipType > >
struct  is_hookean_spring< HookeanSpring< Scalar, LineSegmentType, OwnershipType > >
struct  is_line
 Type trait to determine if a type is a Line.
struct  is_line_segment
 Type trait to determine if a type is a LineSegment.
struct  is_matrix
 Type trait to determine if a type is an AMatrix.
struct  is_matrix_impl
 (Implementation) Type trait to determine if a type is an AMatrix
struct  is_matrix_impl< AMatrix< T, N, M, Accessor > >
struct  is_obb
struct  is_obb_impl
struct  is_obb_impl< OBB< Scalar, P, Q, H > >
struct  is_orthorhombic_metric
 True when T is any instantiation of OrthorhombicMetric. More...
struct  is_orthorhombic_metric< OrthorhombicMetric< PeriodicAxes, Scalar > >
struct  is_our_string_literal
struct  is_our_string_literal< StringLiteral< N > >
struct  is_periodic_metric
 True when T is any periodic metric (orthorhombic or triclinic). More...
struct  is_point
 Type trait to determine if a type is a Point.
struct  is_point_impl
 (Implementation) Type trait to determine if a type is an AABB
struct  is_point_impl< APoint< Scalar, Accessor > >
struct  is_quaternion
 Type trait to determine if a type is an AQuaternion.
struct  is_quaternion_impl
 (Implementation) Type trait to determine if a type is an AQuaternion
struct  is_quaternion_impl< AQuaternion< T, Accessor > >
struct  is_reference_wrapper
 Detect if a type is mundy::reference_wrapper<...>.
struct  is_ring
 Type trait to determine if a type is a Ring.
struct  is_scalar
 Type trait to determine if a type is an AScalar. More...
struct  is_scalar_impl
 (Implementation) Type trait to determine if a type is an AScalar
struct  is_scalar_impl< AScalar< T, Accessor > >
struct  is_scalar_wrapper
struct  is_scalar_wrapper_impl
struct  is_sphere
 Type trait to determine if a type is a Sphere.
struct  is_sphere_impl
 (Implementation) Type trait to determine if a type is a Sphere
struct  is_sphere_impl< Sphere< Scalar, PointType > >
struct  is_spherocylinder
 Type trait to determine if a type is a Spherocylinder.
struct  is_spherocylinder_segment
 Type trait to determine if a type is a SpherocylinderSegment.
struct  is_string_literal
struct  is_string_literal_sink
struct  is_string_literal_sink< StringLiteralSink< N > >
struct  is_string_sink
struct  is_string_sink< StringSink< Chunks... > >
struct  is_torsional_spring
 Type trait to determine if a type is a TorsionalSpring. More...
struct  is_torsional_spring< const TorsionalSpring< Scalar, VSegmentType, OwnershipType > >
struct  is_torsional_spring< TorsionalSpring< Scalar, VSegmentType, OwnershipType > >
struct  is_triclinic_metric
 True when T is any instantiation of TriclinicMetric. More...
struct  is_triclinic_metric< TriclinicMetric< PeriodicAxes, Scalar > >
struct  is_v_segment
 Type trait to determine if a type is a VSegment.
struct  is_vector
 Type trait to determine if a type is an AVector.
struct  is_vector_impl
 (Implementation) Type trait to determine if a type is a vector
struct  is_vector_impl< AVector< T, N, Accessor > >
class  Line
class  LineSegment
class  MaskedView
 Get a masked accessor into a contiguous accessor. More...
class  metric
 Runtime-polymorphic metric (stk::topology-style value class). More...
class  NgpPoolT
 NgpPoolT is a Kokkos-compatible pool of default constructible objects. More...
class  NgpViewT
 NgpViewT is an enhanced DualView with a slightly expanded interface. More...
class  OBB
 Oriented Bounding Box: a center, a unit-quaternion orientation, and per-axis half-extents. More...
class  OrthorhombicMetric
 Axis-aligned periodic metric parameterised by a compile-time axis bitmask. More...
struct  passive_scalar
 Trait: underlying passive (non-AD) type of T. For arithmetic T: passive_scalar_t<T> == T. For AD types exposing T::value_type: passive_scalar_t<T> == typename T::value_type. More...
struct  passive_scalar< T >
class  PointEllipsoidObjective
class  reference_wrapper
 A Kokkos-compatible wrapper around a reference. More...
class  Ring
class  runtime_aggregate
 A runtime_aggregate: A bag of runtime tagged variants or, In other words, an unordered map of variants indexed by tag string. More...
struct  SharedNormalSigned
struct  SharedNormalSignedFiniteDiff
 Tag selecting the finite-difference-gradient variant of the shared-normal signed distance. More...
class  ShiftedView
 Get a shifted accessor into a contiguous accessor. More...
struct  SinkStart
class  Sphere
class  Spherocylinder
class  SpherocylinderSegment
class  storage
 Own or view a value using a simple normalized storage policy. More...
class  StridedView
 Get a strided accessor into a contiguous accessor. More...
struct  StringLiteral
 Literal class type that wraps a constant expression string. More...
struct  StringLiteralSink
 Sink that still represents a compile-time string. More...
struct  StringSink
 Sink that stores streamed chunks until a string is actually needed. More...
class  tagged
 A small helper type for tying a Tag to an underlying value. More...
class  TorsionalSpring
 A hookean spring between two points with a rest angle and spring constant. More...
class  TransposedView
 An accessor that represents the transpose of a row-major (NxM) matrix represented by a contiguous accessor. More...
class  TriclinicMetric
 General periodic metric for a tilted unit cell. More...
struct  tuple
 A simple std::tuple-like class that can be used in device code with similar sementics to std::tuple (e.g., get<N>(), get<T>(), tuple_cat, etc.). All elements must be copyable but not necessarily moveable or default constructible. The tuple itself is copyable, moveable, and default constructible if all of its elements are copyable, moveable, and default constructible (respectively). More...
struct  tuple_element
 An element of a tuple. More...
struct  tuple_element< I, tuple< Es... > >
struct  tuple_size
 The size of a tuple. More...
struct  tuple_size< tuple< Es... > >
struct  type_at_index
 Get the I'th type in a variadic list of types. More...
struct  type_at_index< 0, Head, Tail... >
struct  type_at_index< I, Head, Tail... >
struct  variant
class  variant_aggregate
 A variant_aggregate: A bag of compile-time tagged variants. In other words, a compile-time map of variants indexed by tag type. More...
struct  variant_aggregate_has
 Check whether a variant_aggregate type has a value with the given Tag. Usage: variant_aggregate_has_v<Tag, VarAggType>. More...
struct  variant_aggregate_tag
 The I'th variant_aggregate tag. More...
struct  variant_aggregate_tag< I, variant_aggregate< VariantType, Tags... > >
struct  variant_size
struct  variant_size< variant< Alts... > >
class  VSegment

Concepts

concept  AnyStringSink
concept  ChunkedStringSink
concept  CompileTimeStringSink
concept  DevicePrintableThrowMessage
concept  FinitePrimitive
 Concept: satisfied by primitives with finite spatial extent (is_finite == true).
concept  HasCallOperator
 A concept that checks if Accessor has a () operator regardless of constness.
concept  HasConstAccessOperator
 A concept that checks if Accessor has a const [] operator.
concept  HasConstStoredAccessOperator
 A concept that checks if a stored accessor provides const access to T.
concept  HasCopyConstructor
 A concept that checks if Accessor has a copy constructor.
concept  HasDefaultConstructor
 A concept that checks if an Accessor is default constructible.
concept  HasInitializerListConstructor
 A concept that checks if an Accessor is constructible from an initializer list of type T.
concept  HasMoveConstructor
 A concept that checks if Accessor has a move constructor.
concept  HasNArgConstructor
 A concept that checks if an Accessor is constructible from N arguments of type T.
concept  HasNonConstAccessOperator
 A concept that checks if Accessor has a non-const [] operator.
concept  HasNonConstStoredAccessOperator
 A concept that checks if a stored accessor provides non-const access to T.
concept  HasSubscriptOperator
 A concept that checks if Accessor has a [] operator regardless of constness.
concept  LiteralStringSink
concept  StoredAccessor
 A concept that checks if Accessor is wrapped in storage.
concept  ValidAABBType
 Concept to determine if a type is a valid AABB type.
concept  ValidAccessor
 A concept that checks if an type is a valid accessor, aka it has a const [] operator or a non-const [] operator.
concept  ValidBallJointType
 Concept to check if a type is a valid BallJoint type.
concept  ValidCircle3DType
 Concept to determine if a type is a valid Circle3D type.
concept  ValidEllipsoidType
 Concept to check if a type is an Ellipsoid.
concept  ValidFeneSpringType
 Concept to check if a type is a valid FeneSpring type.
concept  ValidHookeanSpringType
 Concept to check if a type is a valid HookeanSpring type.
concept  ValidLineSegmentType
 Concept to check if a type is a valid LineSegment type.
concept  ValidLineType
 Concept to check if a type is a valid Line type.
concept  ValidMatrix3Type
 A temporary concept to check if a type is a valid Matrix3 type TODO(palmerb4): Extend this concept to contain all shared setters and getters for our quaternions.
concept  ValidMatrixType
 A temporary concept to check if a type is a valid AMatrix type TODO(palmerb4): Extend this concept to contain all shared setters and getters for our quaternions.
concept  ValidOBBType
concept  ValidPointType
 Concept to check if a type has the necessary properties to be a valid Point type As a predicate to creating a new point type, specialize is_point for the new type.
concept  ValidQuaternionType
 A temporary concept to check if a type is a valid AQuaternion type TODO(palmerb4): Extend this concept to contain all shared setters and getters for our quaternions.
concept  ValidRingType
 Concept to check if a type is a valid Ring type.
concept  ValidScalarType
 Concept satisfied by any type that behaves as a mathematical scalar.
concept  ValidScalarWrapperType
concept  ValidSphereType
 Concept to check if a type is a valid Sphere type.
concept  ValidSpherocylinderSegmentType
 Concept to check if a type is a valid SpherocylinderSegment type.
concept  ValidSpherocylinderType
 Concept to check if a type is a valid Spherocylinder type.
concept  ValidTorsionalSpringType
 Concept to check if a type is a valid TorsionalSpring type.
concept  ValidVector3Type
 A temporary concept to check if a type is a valid AVector3 type TODO(palmerb4): Extend this concept to contain all shared setters and getters for our vectors.
concept  ValidVectorType
 A temporary concept to check if a type is a valid AVector type TODO(palmerb4): Extend this concept to contain all shared setters and getters for our vectors.
concept  ValidVSegmentType
 Concept to check if a type is a valid VSegment type.

Typedefs

template<class DataType, typename SizeType = size_t>
using NgpPool = NgpPoolT<DataType, typename Kokkos::DefaultExecutionSpace::memory_space, SizeType>
 Our default NgpPool type for use in Mundy.
template<class DataType, class... Properties>
using NgpView = NgpViewT<DataType, Properties..., typename Kokkos::DefaultExecutionSpace::memory_space>
 Our default NgpView type for use in Mundy.
template<size_t I, class T>
using tuple_element_t = typename tuple_element<I, T>::type
template<typename... input_t>
using tuple_cat_t = decltype(tuple_cat(std::declval<input_t>()...))
 The type of the concatenation of two tuples.
template<size_t I, class... Ts>
using type_at_index_t = typename type_at_index<I, Ts...>::type
template<typename Accessor>
using accessor_underlying_type_t = impl::accessor_underlying_type_t<Accessor>
 A type alias for the underlying accessor type for raw or stored accessors.
template<typename T>
using passive_scalar_t = typename passive_scalar<T>::type
template<typename T, size_t N, size_t M>
using Matrix = AMatrix<T, N, M, Array<T, N * M>>
 Shorthand name for AMatrix with default accessor.
template<typename T, ValidAccessor< T > Accessor = Array<T, 1>>
using ScalarWrapper = AScalar<T, Accessor>
template<typename T, size_t N>
using Vector = AVector<T, N, Array<T, N>>
 Type alias for a vector with the default accessor (Array<T, N>) This prevents the need to write AVector3d<> instead of just Vector3d.
template<typename Scalar, ValidAccessor< Scalar > Accessor = Array<Scalar, 3>>
using APoint = AVector3<Scalar, Accessor>
 A point in 3D space.
template<typename Scalar>
using Point = APoint<Scalar>

Functions

template<typename Tag, typename T>
constexpr auto apply_tag (T &&value)
 Helper function to attach a tag to a type.
template<typename Arg>
void do_not_optimize_away (Arg &&arg)
 Makes sure none of the given arguments are optimized away by the compiler.
template<typename T, typename... Args>
host_ptr< T > make_host_ptr (Args &&... args)
 Construct a host_ptr<T> owning a fresh T, forwarding args to its constructor. Mirrors make_shared.
template<typename T>
void swap (host_ptr< T > &lhs, host_ptr< T > &rhs) noexcept
 Non-member swap.
template<class T>
 reference_wrapper (T &) -> reference_wrapper< T >
template<class T>
constexpr auto ref (T &&t) noexcept -> reference_wrapper< std::remove_reference_t< T > >
 Make a mutable reference wrapper.
template<class T>
constexpr reference_wrapper< T > ref (reference_wrapper< T > t) noexcept
template<class T>
constexpr auto cref (T &&t) noexcept -> reference_wrapper< const std::remove_reference_t< T > >
 Make a const reference wrapper.
template<class T>
constexpr reference_wrapper< const T > cref (reference_wrapper< T > t) noexcept
template<class T>
constexpr reference_wrapper< const T > cref (reference_wrapper< const T > t) noexcept
openrand::Philox make_philox (size_t seed, size_t counter)
template<class T>
 storage (T &&) -> storage< T >
template<class T>
constexpr auto store (T &&value) noexcept(noexcept(storage< impl::store_input_type_t< T > >(std::forward< T >(value)))) -> storage< impl::store_input_type_t< T > >
 Create a storage object from a forwarding reference.
template<size_t N>
constexpr bool operator== (const StringLiteral< N > &lhs, const StringLiteral< N > &rhs)
 Non-member equality operator for comparing two StringLiterals.
template<size_t N>
std::ostream & operator<< (std::ostream &os, const StringLiteral< N > &str)
 Non-member << operator for printing a StringLiteral.
template<size_t N>
constexpr StringLiteral< Nmake_string_literal (const char(&str)[N])
 Helper function for creating a StringLiteral.
constexpr SinkStart sink ()
 Start a new sink pipeline.
template<impl::RuntimeSinkChunk T>
constexpr auto operator<< (SinkStart, T &&rhs)
template<size_t N>
constexpr auto operator<< (SinkStart, const char(&rhs)[N])
template<size_t N>
constexpr auto operator<< (SinkStart, const StringLiteral< N > &rhs)
template<size_t N>
std::ostream & operator<< (std::ostream &os, const StringLiteralSink< N > &sink_to_print)
template<typename... Chunks>
std::ostream & operator<< (std::ostream &os, const StringSink< Chunks... > &sink_to_print)
template<size_t AssertionStringSize, size_t FileStringSize, size_t LineStringSize>
std::string get_throw_require_host_string (const StringLiteral< AssertionStringSize > &assertion_string, const std::string &message_to_print, const StringLiteral< FileStringSize > &file_string=make_string_literal("/home/runner/work/MuNDy/MuNDy/mundy/core/utils/src/mundy_utils/throw_assert.hpp"), const StringLiteral< LineStringSize > &line_string=make_string_literal(MUNDY_LINE_STRING))
template<size_t AssertionStringSize, size_t MessageStringSize, size_t FileStringSize, size_t LineStringSize>
std::string get_throw_require_host_string (const StringLiteral< AssertionStringSize > &assertion_string, const char(&message_to_print)[MessageStringSize], const StringLiteral< FileStringSize > &file_string=make_string_literal("/home/runner/work/MuNDy/MuNDy/mundy/core/utils/src/mundy_utils/throw_assert.hpp"), const StringLiteral< LineStringSize > &line_string=make_string_literal(MUNDY_LINE_STRING))
template<size_t AssertionStringSize, size_t MessageStringSize, size_t FileStringSize, size_t LineStringSize>
std::string get_throw_require_host_string (const StringLiteral< AssertionStringSize > &assertion_string, const StringLiteral< MessageStringSize > &message_to_print, const StringLiteral< FileStringSize > &file_string=make_string_literal("/home/runner/work/MuNDy/MuNDy/mundy/core/utils/src/mundy_utils/throw_assert.hpp"), const StringLiteral< LineStringSize > &line_string=make_string_literal(MUNDY_LINE_STRING))
template<size_t AssertionStringSize, AnyStringSink MessageStringType, size_t FileStringSize, size_t LineStringSize>
std::string get_throw_require_host_string (const StringLiteral< AssertionStringSize > &assertion_string, const MessageStringType &message_to_print, const StringLiteral< FileStringSize > &file_string=make_string_literal("/home/runner/work/MuNDy/MuNDy/mundy/core/utils/src/mundy_utils/throw_assert.hpp"), const StringLiteral< LineStringSize > &line_string=make_string_literal(MUNDY_LINE_STRING))
template<size_t AssertionStringSize, size_t MessageStringSize, size_t FileStringSize, size_t LineStringSize>
constexpr auto get_throw_require_device_string (const StringLiteral< AssertionStringSize > &assertion_string, const char(&message_to_print)[MessageStringSize], const StringLiteral< FileStringSize > &file_string=make_string_literal("/home/runner/work/MuNDy/MuNDy/mundy/core/utils/src/mundy_utils/throw_assert.hpp"), const StringLiteral< LineStringSize > &line_string=make_string_literal(MUNDY_LINE_STRING))
template<size_t AssertionStringSize, size_t MessageStringSize, size_t FileStringSize, size_t LineStringSize>
constexpr auto get_throw_require_device_string (const StringLiteral< AssertionStringSize > &assertion_string, const StringLiteral< MessageStringSize > &message_to_print, const StringLiteral< FileStringSize > &file_string=make_string_literal("/home/runner/work/MuNDy/MuNDy/mundy/core/utils/src/mundy_utils/throw_assert.hpp"), const StringLiteral< LineStringSize > &line_string=make_string_literal(MUNDY_LINE_STRING))
template<size_t AssertionStringSize, CompileTimeStringSink MessageStringType, size_t FileStringSize, size_t LineStringSize>
constexpr auto get_throw_require_device_string (const StringLiteral< AssertionStringSize > &assertion_string, const MessageStringType &message_to_print, const StringLiteral< FileStringSize > &file_string=make_string_literal("/home/runner/work/MuNDy/MuNDy/mundy/core/utils/src/mundy_utils/throw_assert.hpp"), const StringLiteral< LineStringSize > &line_string=make_string_literal(MUNDY_LINE_STRING))
template<typename ExceptionType, typename MessageStringType, size_t AssertionStringSize, size_t FileStringSize, size_t LineStringSize>
constexpr void throw_require (const bool assertion_value, const StringLiteral< AssertionStringSize > &assertion_string, const MessageStringType &message_to_print, const StringLiteral< FileStringSize > &file_string=make_string_literal("/home/runner/work/MuNDy/MuNDy/mundy/core/utils/src/mundy_utils/throw_assert.hpp"), const StringLiteral< LineStringSize > &line_string=make_string_literal(MUNDY_LINE_STRING))
template<typename MessageStringType, size_t AssertionStringSize, size_t FileStringSize, size_t LineStringSize>
constexpr void abort_require (const bool assertion_value, const StringLiteral< AssertionStringSize > &assertion_string, const MessageStringType &message_to_print, const StringLiteral< FileStringSize > &file_string=make_string_literal("/home/runner/work/MuNDy/MuNDy/mundy/core/utils/src/mundy_utils/throw_assert.hpp"), const StringLiteral< LineStringSize > &line_string=make_string_literal(MUNDY_LINE_STRING))
template<size_t Idx, class... Args>
constexpr auto & get (tuple< Args... > &vals)
 Get the I'th element of a tuple.
template<size_t Idx, class... Args>
constexpr const auto & get (const tuple< Args... > &vals)
template<class T, class... Args>
constexpr auto & get (tuple< Args... > &vals)
 Get the element of a tuple with the given type T (errors if T is not unique).
template<class T, class... Args>
constexpr const auto & get (const tuple< Args... > &vals)
template<class... FirstElements, class... SecondElements>
constexpr auto tuple_cat (const tuple< FirstElements... > &first, const tuple< SecondElements... > &second)
 Concatenate two tuples into a single tuple containing all elements of both.
template<class... Elements>
constexpr auto make_tuple (Elements... vals)
 Make a tuple from a list of values.
template<typename Func, typename T, size_t N>
constexpr auto apply (Func &&func, const Array< T, N > &array)
 Apply a function to each element of an array.
template<typename T, size_t N>
std::ostream & operator<< (std::ostream &os, const Array< T, N > &a)
 Write the array to an output stream.
template<typename Backend, class LinearOpDT, class LinearOpM, class LinearOpD>
auto make_quadratic_form (LinearOpDT &&DT, LinearOpM &&M, LinearOpD &&D)
template<typename Backend, typename LinearOp, typename QVector, convex::space::ValidConvexSpace ConvexSpace>
auto make_cqpp (LinearOp &&A, QVector &&q, ConvexSpace &&space)
template<typename Backend, typename LinearOpDT, typename LinearOpM, typename LinearOpD, typename QVector, convex::space::ValidConvexSpace ConvexSpace>
auto make_cqpp (LinearOpDT &&DT, LinearOpM &&M, LinearOpD &&D, QVector &&q, ConvexSpace &&space)
template<typename Backend, typename LinearOpDT, typename LinearOpM, typename LinearOpD, typename QVector, convex::space::ValidConvexSpace ConvexSpace, typename FVector, typename UVector>
auto make_cqpp (LinearOpDT &&DT, LinearOpM &&M, LinearOpD &&D, QVector &&q, FVector &&f, UVector &&u, ConvexSpace &&space)
template<typename Backend, typename LinearOp, typename QVector, convex::space::ValidConvexSpace ConvexSpace, typename Workspace>
auto make_cqpp (LinearOp &&A, QVector &&q, ConvexSpace &&space, Workspace &&workspace)
template<typename Backend, typename LinearOp, typename QVector>
auto make_lcp (LinearOp &&A, QVector &&q)
template<typename Backend, typename LinearOpDT, typename LinearOpM, typename LinearOpD, typename QVector>
auto make_lcp (LinearOpDT &&DT, LinearOpM &&M, LinearOpD &&D, QVector &&q)
template<typename Backend, typename LinearOpDT, typename LinearOpM, typename LinearOpD, typename QVector, typename FVector, typename UVector>
auto make_lcp (LinearOpDT &&DT, LinearOpM &&M, LinearOpD &&D, QVector &&q, FVector &&f, UVector &&u)
template<typename Backend, typename LinearOp, typename QVector, typename Workspace>
auto make_lcp (LinearOp &&A, QVector &&q, Workspace &&workspace)
template<typename Backend, typename LinearOpA, typename QVector, typename LinearOpL, typename FVector, convex::space::ValidConvexSpace ConvexSpace>
auto make_mixed_cqpp (LinearOpA &&A, QVector &&q, LinearOpL &&L, FVector &&f_b, ConvexSpace &&space)
template<typename Backend, typename LinearOpA, typename QVector, typename LinearOpL, typename FVector, convex::space::ValidConvexSpace ConvexSpace, typename AWorkspace, typename LWorkspace>
auto make_mixed_cqpp (LinearOpA &&A, QVector &&q, LinearOpL &&L, FVector &&f_b, ConvexSpace &&space, AWorkspace &&a_workspace, LWorkspace &&l_workspace)
template<typename Backend, typename LinearOpDT, typename LinearOpM, typename LinearOpD, typename QVector, typename LinearOpL, typename FVector, convex::space::ValidConvexSpace ConvexSpace>
auto make_mixed_cqpp (LinearOpDT &&DT, LinearOpM &&M, LinearOpD &&D, QVector &&q, LinearOpL &&L, FVector &&f_b, ConvexSpace &&space)
template<typename Backend, typename LinearOpDT, typename LinearOpM, typename LinearOpD, typename QVector, typename LinearOpB, typename LinearOpS, typename LinearOpBT, typename BVector, convex::space::ValidConvexSpace ConvexSpace>
auto make_mixed_cqpp (LinearOpDT &&DT, LinearOpM &&M, LinearOpD &&D, QVector &&q, LinearOpB &&B, LinearOpS &&S, LinearOpBT &&BT, BVector &&b, ConvexSpace &&space)
template<class StepPolicy, class ResidualPolicy, class Scalar>
auto make_pgd_solution_strategy (StepPolicy &&step_policy, ResidualPolicy &&residual_policy, const convex::PGDConfig< Scalar > &cfg={})
template<class Scalar>
auto make_pgd_solution_strategy (const convex::PGDConfig< Scalar > &cfg={})
template<class XVector, class GradVector, class XTmpVector, class GradTmpVector>
auto make_pgd_state (XVector &&x, GradVector &&grad, XTmpVector &&x_tmp, GradTmpVector &&grad_tmp)
template<class Problem, class Strategy, class State>
auto solve_cqpp (const Problem &prob, const Strategy &strat, State &state)
 Solve a constrained quadratic programming problem (CQPP).
template<class Problem, class Strategy>
auto solve_mixed_cqpp (const Problem &prob, const Strategy &strat, typename Strategy::state_t &state) -> typename Strategy::result_t
 Solve a mixed constrained convex quadratic programming problem (MCQPP).
template<class Problem, class Strategy, class State>
auto solve_lcp (const Problem &prob, const Strategy &strat, State &state)
 Solve a linear complementarity problem (LCP) using a constrained quadratic programming solver.
template<typename Scalar = double>
size_t hilbert_3d (size_t s, size_t i, std::vector< mundy::Vector3< Scalar > > &position_array, mundy::Vector3< Scalar > current_position, mundy::Vector3< Scalar > dr1, mundy::Vector3< Scalar > dr2, mundy::Vector3< Scalar > dr3)
 Functions for generating and using 3D Hilbert space-filling curves.
template<typename Scalar = double>
std::tuple< std::vector< mundy::Vector3< Scalar > >, std::vector< mundy::Vector3< Scalar > > > create_hilbert_positions_and_directors (size_t num_points, mundy::Vector3< Scalar > orientation=mundy::Vector3< Scalar >(1.0, 0.0, 0.0), Scalar side_length=1.0)
 Create a 3D Hilbert curve with a given number of links.
template<typename T, ValidAccessor< T > Accessor, typename OutputType = std::conditional_t<std::is_integral_v<T>, double, T>>
auto cholesky (const AMatrix3< T, Accessor > &A) -> Matrix3< OutputType >
 Get the lower triangular matrix of the Cholesky decomposition of a symmetric positive definite matrix.
template<typename T, ValidAccessor< T > Accessor, typename OutputType = std::conditional_t<std::is_integral_v<T>, float, T>>
auto cholesky_f (const AMatrix3< T, Accessor > &A) -> Matrix3< OutputType >
template<size_t max_size, size_t N, typename CostFunctionType>
double find_min_using_approximate_derivatives (const CostFunctionType &cost_func, Vector< double, N > &x, const double min_alowable_cost=-Kokkos::Experimental::infinity_v< double >, const double min_objective_delta=1e-7, const double derivative_eps=1e-7)
template<size_t max_size, size_t N, typename FDFType>
double find_min_with_fdf (const FDFType &fdf, Vector< double, N > &x, const double min_alowable_cost=-Kokkos::Experimental::infinity_v< double >, const double min_objective_delta=1e-7)
 L-BFGS minimization using a caller-supplied analytical gradient.
template<size_t max_size, size_t N, typename CostFunctionType, typename DerivativeFunctionType>
double find_min_with_derivatives (const CostFunctionType &cost_func, const DerivativeFunctionType &der_func, Vector< double, N > &x, const double min_alowable_cost=-Kokkos::Experimental::infinity_v< double >, const double min_objective_delta=1e-7)
template<typename T>
constexpr T get_zero_tolerance ()
 Function to get the zero tolerance for a type. That is, the smallest value that we will consider non-zero. We use approximately 10 * std::numeric_limits<T>::epsilon() as the default tolerance for floats and doubles and 0 for integer types. To make this code GPU-compatable, we'll directly evaluate the epsilon instead of using std::numeric_limits.
template<typename T>
constexpr T get_relaxed_zero_tolerance ()
 Function to get the relaxed zero tolerance for a type. That is, the smallest value that we will consider non-zero. Our choice of relaxed tolerance is based on personal preference, not on a hard standard and is mostly used during testing. To make this code GPU-compatable, we'll directly evaluate the epsilon instead of using std::numeric_limits.
template<typename T1, typename T2>
constexpr auto get_comparison_tolerance ()
 A helper function for getting the tolerance to use when comparing two different types.
template<typename T1, typename T2>
constexpr auto get_comparison_tolerance_promote_ints ()
 A helper function for getting the tolerance to use when comparing two different types. int - int -> double float - int -> float double - int -> double.
template<typename T1, typename T2>
constexpr auto get_relaxed_comparison_tolerance ()
 A helper function for getting the relaxed tolerance to use when comparing two different types. This class chooses the tolerance based on the smaller of the two types.
template<typename T1, typename T2>
constexpr auto get_relaxed_comparison_tolerance_promote_ints ()
 A helper function for getting the relaxed tolerance to use when comparing two different types.
template<ValidVector3Type Vector3Type1, ValidVector3Type Vector3Type2>
bool zmorton_less (const Vector3Type1 &p, const Vector3Type2 &q)
template<ValidPointType PointType>
AABB< typename PointType::value_type > compute_aabb (const PointType &point)
 AABB of a point: a degenerate box with equal min and max corners.
template<ValidPointType PointType, typename Metric>
AABB< typename PointType::value_type > compute_aabb (const PointType &point, const Metric &)
template<ValidLineSegmentType LineSegmentType>
AABB< typename LineSegmentType::value_type > compute_aabb (const LineSegmentType &line_segment)
 AABB of a line segment: component-wise min/max of the two endpoints.
template<ValidLineSegmentType LineSegmentType, typename Metric>
AABB< typename LineSegmentType::value_type > compute_aabb (const LineSegmentType &line_segment, const Metric &metric)
template<ValidSphereType SphereType>
AABB< typename SphereType::value_type > compute_aabb (const SphereType &sphere)
 AABB of a sphere: center padded by radius in every coordinate direction.
template<ValidSphereType SphereType, typename Metric>
AABB< typename SphereType::value_type > compute_aabb (const SphereType &sphere, const Metric &)
template<ValidEllipsoidType EllipsoidType>
AABB< typename EllipsoidType::value_type > compute_aabb (const EllipsoidType &ellipsoid)
 AABB of an ellipsoid.
template<ValidEllipsoidType EllipsoidType, typename Metric>
AABB< typename EllipsoidType::value_type > compute_aabb (const EllipsoidType &ellipsoid, const Metric &)
template<ValidSpherocylinderType SpherocylinderType>
AABB< typename SpherocylinderType::value_type > compute_aabb (const SpherocylinderType &spherocylinder)
 AABB of a spherocylinder (capsule).
template<ValidSpherocylinderType SpherocylinderType, typename Metric>
AABB< typename SpherocylinderType::value_type > compute_aabb (const SpherocylinderType &spherocylinder, const Metric &)
template<ValidSpherocylinderSegmentType SegmentType>
AABB< typename SegmentType::value_type > compute_aabb (const SegmentType &segment)
 AABB of a spherocylinder segment: endpoint AABB padded by radius.
template<ValidSpherocylinderSegmentType SegmentType, typename Metric>
AABB< typename SegmentType::value_type > compute_aabb (const SegmentType &segment, const Metric &metric)
template<ValidPointType PointType>
PointType::value_type compute_bounding_radius (const PointType &point)
 Bounding radius of a point: zero.
template<ValidPointType PointType, typename Metric>
PointType::value_type compute_bounding_radius (const PointType &point, const Metric &)
template<ValidLineSegmentType LineSegmentType>
LineSegmentType::value_type compute_bounding_radius (const LineSegmentType &line_segment)
 Bounding radius of a line segment: half the segment length.
template<ValidLineSegmentType LineSegmentType, typename Metric>
LineSegmentType::value_type compute_bounding_radius (const LineSegmentType &line_segment, const Metric &metric)
template<ValidSphereType SphereType>
SphereType::value_type compute_bounding_radius (const SphereType &sphere)
 Bounding radius of a sphere: its radius.
template<ValidSphereType SphereType, typename Metric>
SphereType::value_type compute_bounding_radius (const SphereType &sphere, const Metric &)
template<ValidEllipsoidType EllipsoidType>
EllipsoidType::value_type compute_bounding_radius (const EllipsoidType &ellipsoid)
 Bounding radius of an ellipsoid: the largest of the three semi-axis radii.
template<ValidEllipsoidType EllipsoidType, typename Metric>
EllipsoidType::value_type compute_bounding_radius (const EllipsoidType &ellipsoid, const Metric &)
template<ValidSpherocylinderType SpherocylinderType>
SpherocylinderType::value_type compute_bounding_radius (const SpherocylinderType &spherocylinder)
 Bounding radius of a spherocylinder (capsule): half the centerline length plus radius.
template<ValidSpherocylinderType SpherocylinderType, typename Metric>
SpherocylinderType::value_type compute_bounding_radius (const SpherocylinderType &spherocylinder, const Metric &)
template<ValidSpherocylinderSegmentType SegmentType>
SegmentType::value_type compute_bounding_radius (const SegmentType &segment)
 Bounding radius of a spherocylinder segment: half the segment length plus radius.
template<ValidSpherocylinderSegmentType SegmentType, typename Metric>
SegmentType::value_type compute_bounding_radius (const SegmentType &segment, const Metric &metric)
template<ValidPointType PointType>
OBB< typename PointType::value_type > compute_obb (const PointType &point)
 OBB of a point: identity orientation, zero half-extents.
template<ValidPointType PointType, typename Metric>
OBB< typename PointType::value_type > compute_obb (const PointType &point, const Metric &)
template<ValidSphereType SphereType>
OBB< typename SphereType::value_type > compute_obb (const SphereType &sphere)
 OBB of a sphere: identity orientation, uniform half-extents equal to the radius.
template<ValidSphereType SphereType, typename Metric>
OBB< typename SphereType::value_type > compute_obb (const SphereType &sphere, const Metric &)
template<ValidAABBType AABBType>
OBB< typename AABBType::value_type > compute_obb (const AABBType &aabb)
 OBB of an AABB: identity orientation, half-extents = (max - min) / 2.
template<ValidAABBType AABBType, typename Metric>
OBB< typename AABBType::value_type > compute_obb (const AABBType &aabb, const Metric &)
template<ValidEllipsoidType EllipsoidType>
OBB< typename EllipsoidType::value_type > compute_obb (const EllipsoidType &ellipsoid)
 OBB of an ellipsoid: orientation from the stored quaternion, half-extents from the radii.
template<ValidEllipsoidType EllipsoidType, typename Metric>
OBB< typename EllipsoidType::value_type > compute_obb (const EllipsoidType &ellipsoid, const Metric &)
template<ValidSpherocylinderType SpherocylinderType>
OBB< typename SpherocylinderType::value_type > compute_obb (const SpherocylinderType &sc)
 OBB of a spherocylinder (capsule).
template<ValidSpherocylinderType SpherocylinderType, typename Metric>
OBB< typename SpherocylinderType::value_type > compute_obb (const SpherocylinderType &sc, const Metric &)
template<ValidSpherocylinderSegmentType SegmentType>
OBB< typename SegmentType::value_type > compute_obb (const SegmentType &seg)
 OBB of a spherocylinder segment.
template<ValidSpherocylinderSegmentType SegmentType, typename Metric>
OBB< typename SegmentType::value_type > compute_obb (const SegmentType &seg, const Metric &metric)
template<ValidLineSegmentType LineSegmentType>
OBB< typename LineSegmentType::value_type > compute_obb (const LineSegmentType &ls)
 OBB of a line segment (zero radius): oriented along the segment with zero radial extents.
template<ValidLineSegmentType LineSegmentType, typename Metric>
OBB< typename LineSegmentType::value_type > compute_obb (const LineSegmentType &ls, const Metric &metric)
template<typename Scalar, typename RNG>
Point< Scalargenerate_random_point (const AABB< Scalar > &box, RNG &rng)
 Generate a random point within a given bounding box.
template<typename Scalar, typename RNG>
Point< Scalargenerate_random_unit_vector (RNG &rng)
 Generate a random unit vector (uniformly distributed on the unit sphere).
template<typename Scalar, typename RNG>
Quaternion< Scalargenerate_random_unit_quaternion (RNG &rng)
 Generate a random unit quaternion mapping the z-axis to a random unit vector via parallel transport.
template<typename Scalar, typename RNG>
Line< Scalargenerate_random_line (const AABB< Scalar > &box, RNG &rng)
 Generate a random line with a center point within a given bounding box and a random direction.
template<typename Scalar, typename RNG>
LineSegment< Scalargenerate_random_line_segment (const AABB< Scalar > &box, RNG &rng)
 Generate a random line segment with endpoints within a given bounding box.
template<typename Scalar, typename RNG>
LineSegment< Scalargenerate_random_line_segment (const AABB< Scalar > &box, Scalar min_length, Scalar max_length, RNG &rng)
 Generate a random line segment with center in the given bounding box, random length within the given bounds, and random orientation.
template<typename Scalar, typename RNG>
VSegment< Scalargenerate_random_vsegment (const AABB< Scalar > &box, RNG &rng)
 Generate a random v-segment with endpoints and middle point within a given bounding box.
template<typename Scalar, typename RNG>
VSegment< Scalargenerate_random_vsegment (const AABB< Scalar > &box, Scalar min_length, Scalar max_length, RNG &rng)
 Generate a random v-segment with center in the given bounding box, random edge lengths within the given bounds, and random edge orientations.
template<typename Scalar, typename RNG>
Circle3D< Scalargenerate_random_circle3D (const AABB< Scalar > &box, Scalar min_radius, Scalar max_radius, RNG &rng)
 Generate a random circle3D with center point within a given bounding box, random radius, and random orientation.
template<typename Scalar, typename RNG>
AABB< Scalargenerate_random_aabb (const AABB< Scalar > &box, RNG &rng)
 Generate a random AABB within a given bounding box with both points inside the box.
template<typename Scalar, typename RNG>
AABB< Scalargenerate_random_aabb (const AABB< Scalar > &box, const Vector3< Scalar > &min_sizes, const Vector3< Scalar > &max_sizes, RNG &rng)
 Generate a random AABB with random size and center point inside the box.
template<typename Scalar, typename RNG>
Sphere< Scalargenerate_random_sphere (const AABB< Scalar > &box, Scalar min_radius, Scalar max_radius, RNG &rng)
 Generate a random sphere with center point within a given bounding box and random radius.
template<typename Scalar, typename RNG>
Spherocylinder< Scalargenerate_random_spherocylinder (const AABB< Scalar > &box, Scalar min_radius, Scalar max_radius, RNG &rng)
 Generate a random spherocylinder with endpoints within a given bounding box and random radius.
template<typename Scalar, typename RNG>
Spherocylinder< Scalargenerate_random_spherocylinder (const AABB< Scalar > &box, Scalar min_radius, Scalar max_radius, Scalar min_length, Scalar max_length, RNG &rng)
 Generate a random spherocylinder with center point within a given bounding box, random radius, random length, and random orientation.
template<typename Scalar, typename RNG>
SpherocylinderSegment< Scalargenerate_random_spherocylinder_segment (const AABB< Scalar > &box, Scalar min_radius, Scalar max_radius, RNG &rng)
 Generate a random spherocylinder segment with endpoints within a given bounding box and random radius.
template<typename Scalar, typename RNG>
SpherocylinderSegment< Scalargenerate_random_spherocylinder_segment (const AABB< Scalar > &box, Scalar min_radius, Scalar max_radius, Scalar min_length, Scalar max_length, RNG &rng)
 Generate a random spherocylinder segment with center point within a given bounding box, random radius, random length, and random orientation.
template<typename Scalar, typename RNG>
Ring< Scalargenerate_random_ring (const AABB< Scalar > &box, Scalar min_major_radius, Scalar max_major_radius, Scalar min_minor_radius, Scalar max_minor_radius, RNG &rng)
 Generate a random ring with center point within a given bounding box, random major and minor radii, and random orientation.
template<typename Scalar, typename RNG>
Ellipsoid< Scalargenerate_random_ellipsoid (const AABB< Scalar > &box, const Vector3< Scalar > &min_radii, const Vector3< Scalar > &max_radii, RNG &rng)
 Generate a random ellipsoid with center point within a given bounding box, random semi-axis radii, and random orientation.
Pointer casts (share ownership, retype the pointer — mirror std::shared_ptr's casts)
template<typename U, typename T>
host_ptr< U > static_pointer_cast (const host_ptr< T > &ptr) noexcept
template<typename U, typename T>
host_ptr< U > dynamic_pointer_cast (const host_ptr< T > &ptr) noexcept
template<typename U, typename T>
host_ptr< U > const_pointer_cast (const host_ptr< T > &ptr) noexcept
template<typename U, typename T>
host_ptr< U > reinterpret_pointer_cast (const host_ptr< T > &ptr) noexcept
Comparisons (by the pointed-to address, like std::shared_ptr)
template<typename T>
bool operator== (const host_ptr< T > &lhs, const host_ptr< T > &rhs) noexcept
template<typename T>
std::strong_ordering operator<=> (const host_ptr< T > &lhs, const host_ptr< T > &rhs) noexcept
template<typename T>
bool operator== (const host_ptr< T > &ptr, std::nullptr_t) noexcept
template<typename T>
std::strong_ordering operator<=> (const host_ptr< T > &ptr, std::nullptr_t) noexcept
MaskedView views
template<typename T, size_t N, Kokkos::Array< bool, N > mask, ValidAccessor< T > Accessor>
constexpr auto get_masked_view (Accessor &&accessor)
 A helper function to create a MaskedView<T, N, Accessor> based on a given accessor.
template<typename T, size_t N, Kokkos::Array< bool, N > mask, ValidAccessor< T > Accessor>
constexpr auto get_owning_masked_accessor (Accessor &&accessor)
Write to output stream
template<typename T, size_t N, size_t M, ValidAccessor< T > Accessor>
std::ostream & operator<< (std::ostream &os, const AMatrix< T, N, M, Accessor > &mat)
 Write the matrix to an output stream.
template<typename T, ValidAccessor< T > Accessor>
std::ostream & operator<< (std::ostream &os, const AQuaternion< T, Accessor > &quat)
 Write the quaternion to an output stream.
template<typename T, size_t N, ValidAccessor< T > Accessor>
std::ostream & operator<< (std::ostream &os, const AVector< T, N, Accessor > &vec)
 Write the vector to an output stream.
Non-member comparison functions
template<size_t N, size_t M, typename U, typename T, ValidAccessor< U > Accessor1, ValidAccessor< T > Accessor2>
constexpr bool is_close (const AMatrix< U, N, M, Accessor1 > &mat1, const AMatrix< T, N, M, Accessor2 > &mat2, const decltype(get_comparison_tolerance< T, U >())&tol=get_comparison_tolerance< T, U >())
 AMatrix-matrix equality (element-wise within a tolerance).
template<size_t N, size_t M, typename U, typename T, ValidAccessor< U > Accessor1, ValidAccessor< T > Accessor2>
constexpr bool is_approx_close (const AMatrix< U, N, M, Accessor1 > &mat1, const AMatrix< T, N, M, Accessor2 > &mat2, const decltype(get_relaxed_comparison_tolerance< T, U >())&tol=get_relaxed_comparison_tolerance< T, U >())
 AMatrix-matrix equality (element-wise within a relaxed tolerance).
template<typename U, typename T, ValidAccessor< U > Accessor1, ValidAccessor< T > Accessor2>
constexpr bool is_close (const AQuaternion< U, Accessor1 > &quat1, const AQuaternion< T, Accessor2 > &quat2, const decltype(get_comparison_tolerance< T, U >())&tol=get_comparison_tolerance< T, U >())
 AQuaternion-quaternion equality (element-wise within a tolerance).
template<typename U, typename T, ValidAccessor< U > Accessor1, ValidAccessor< T > Accessor2>
constexpr bool is_approx_close (const AQuaternion< U, Accessor1 > &quat1, const AQuaternion< T, Accessor2 > &quat2, const decltype(get_relaxed_comparison_tolerance< T, U >())&tol=get_relaxed_comparison_tolerance< T, U >())
 AQuaternion-quaternion equality (element-wise within a relaxed tolerance).
template<typename U, typename T>
constexpr bool is_close (const U &scalar1, const T &scalar2, const decltype(get_comparison_tolerance< T, U >())&tol=get_comparison_tolerance< T, U >())
 Scalar-scalar equality (within a tolerance).
template<typename U, typename T>
constexpr bool is_approx_close (const U &scalar1, const T &scalar2, const decltype(get_relaxed_comparison_tolerance< T, U >())&tol=get_relaxed_comparison_tolerance< T, U >())
 Scalar-scalar equality (within a relaxed tolerance).
template<size_t N, typename U, typename T, ValidAccessor< U > Accessor1, ValidAccessor< T > Accessor2>
constexpr bool is_close (const AVector< U, N, Accessor1 > &vec1, const AVector< T, N, Accessor2 > &vec2, const decltype(get_comparison_tolerance< T, U >())&tol=get_comparison_tolerance< T, U >())
 AVector-vector equality (element-wise within a tolerance).
template<size_t N, typename U, typename T, ValidAccessor< U > Accessor1, ValidAccessor< T > Accessor2>
constexpr bool is_approx_close (const AVector< U, N, Accessor1 > &vec1, const AVector< T, N, Accessor2 > &vec2, const decltype(get_relaxed_comparison_tolerance< T, U >())&tol=get_relaxed_comparison_tolerance< T, U >())
 AVector-vector equality (element-wise within a relaxed tolerance).
Non-member addition and subtraction operators
template<size_t N, size_t M, typename U, typename T, ValidAccessor< T > Accessor>
constexpr auto operator+ (const U &scalar, const AMatrix< T, N, M, Accessor > &mat) -> AMatrix< std::common_type_t< T, U >, N, M >
 Scalar-matrix addition.
template<size_t N, size_t M, typename U, typename T, ValidAccessor< T > Accessor>
constexpr auto operator- (const U &scalar, const AMatrix< T, N, M, Accessor > &mat) -> AMatrix< std::common_type_t< T, U >, N, M >
 Scalar-matrix subtraction.
template<size_t N, typename U, typename T, ValidAccessor< T > Accessor>
constexpr auto operator+ (const U &scalar, const AVector< T, N, Accessor > &vec) -> AVector< std::common_type_t< T, U >, N >
 Scalar-vector addition.
template<size_t N, typename U, typename T, ValidAccessor< T > Accessor>
constexpr auto operator- (const U &scalar, const AVector< T, N, Accessor > &vec) -> AVector< std::common_type_t< T, U >, N >
 Scalar-vector subtraction.
Non-member multiplication and division operators
template<size_t N, size_t M, typename U, typename T, ValidAccessor< T > Accessor>
constexpr auto operator* (const U &scalar, const AMatrix< T, N, M, Accessor > &mat) -> AMatrix< std::common_type_t< T, U >, N, M >
 Scalar-matrix multiplication.
template<size_t N, size_t M, typename U, typename T, ValidAccessor< T > Accessor1, ValidAccessor< U > Accessor2>
constexpr auto operator* (const AVector< U, N, Accessor1 > &vec, const AMatrix< T, N, M, Accessor2 > &mat) -> Vector< std::common_type_t< T, U >, M >
 Vector matrix multiplication (v^T M).
template<typename U, typename T, ValidAccessor< T > Accessor>
constexpr auto operator* (const U &scalar, const AQuaternion< T, Accessor > &quat) -> AQuaternion< std::common_type_t< T, U > >
 Scalar-quaternion multiplication.
template<typename U, typename T, ValidAccessor< U > Accessor1, ValidAccessor< T > Accessor2>
constexpr auto operator* (const AVector3< U, Accessor1 > &vec, const AQuaternion< T, Accessor2 > &quat) -> Vector3< std::common_type_t< T, U > >
 Vector-quaternion multiplication (same as v^T * R = transpose(R^T * v)).
template<typename U, typename T, ValidAccessor< U > Accessor1, ValidAccessor< T > Accessor2>
constexpr auto operator* (const AMatrix3< U, Accessor1 > &mat, const AQuaternion< T, Accessor2 > &quat)
 Matrix-quaternion multiplication (same as R * M).
template<size_t N, typename U, typename T, ValidAccessor< T > Accessor>
constexpr auto operator* (const U &scalar, const AVector< T, N, Accessor > &vec) -> AVector< std::common_type_t< T, U >, N >
 Scalar-vector multiplication.
Basic arithmetic reduction operations
template<size_t N, size_t M, typename T, ValidAccessor< T > Accessor>
constexpr auto determinant (const AMatrix< T, N, M, Accessor > &mat)
 AMatrix determinant.
template<size_t N, size_t M, typename T, ValidAccessor< T > Accessor>
constexpr auto trace (const AMatrix< T, N, M, Accessor > &mat)
 AMatrix trace.
template<size_t N, size_t M, typename T, ValidAccessor< T > Accessor>
constexpr auto sum (const AMatrix< T, N, M, Accessor > &mat)
 Sum of all elements.
template<size_t N, size_t M, typename T, ValidAccessor< T > Accessor>
constexpr auto product (const AMatrix< T, N, M, Accessor > &mat)
 Product of all elements.
template<size_t N, size_t M, typename T, ValidAccessor< T > Accessor>
constexpr auto min (const AMatrix< T, N, M, Accessor > &mat)
 Minimum element of the matrix.
template<size_t N, size_t M, typename T, ValidAccessor< T > Accessor>
constexpr auto max (const AMatrix< T, N, M, Accessor > &mat)
 Maximum element of the matrix.
template<size_t N, size_t M, typename T, ValidAccessor< T > Accessor, typename OutputType = std::conditional_t<std::is_integral_v<T>, double, T>>
constexpr OutputType mean (const AMatrix< T, N, M, Accessor > &mat)
 Mean of all elements (returns a double if T is an integral type, otherwise returns T).
template<size_t N, size_t M, typename T, ValidAccessor< T > Accessor, typename OutputType = std::conditional_t<std::is_integral_v<T>, float, T>>
constexpr OutputType mean_f (const AMatrix< T, N, M, Accessor > &mat)
 Mean of all elements (returns a float if T is an integral type, otherwise returns T).
template<size_t N, size_t M, typename T, ValidAccessor< T > Accessor, typename OutputType = std::conditional_t<std::is_integral_v<T>, double, T>>
constexpr OutputType variance (const AMatrix< T, N, M, Accessor > &mat)
 Variance of all elements (returns a double if T is an integral type, otherwise returns T).
template<size_t N, size_t M, typename T, ValidAccessor< T > Accessor, typename OutputType = std::conditional_t<std::is_integral_v<T>, float, T>>
constexpr OutputType variance_f (const AMatrix< T, N, M, Accessor > &mat)
 Variance of all elements (returns a float if T is an integral type, otherwise returns T).
template<size_t N, size_t M, typename T, ValidAccessor< T > Accessor, typename OutputType = std::conditional_t<std::is_integral_v<T>, double, T>>
constexpr OutputType stddev (const AMatrix< T, N, M, Accessor > &mat)
 Standard deviation of all elements (returns a double if T is an integral type, otherwise returns T).
template<size_t N, size_t M, typename T, ValidAccessor< T > Accessor, typename OutputType = std::conditional_t<std::is_integral_v<T>, float, T>>
constexpr OutputType stddev_f (const AMatrix< T, N, M, Accessor > &mat)
 Standard deviation of all elements (returns a float if T is an integral type, otherwise returns T).
template<size_t N, typename T, ValidAccessor< T > Accessor>
constexpr auto sum (const AVector< T, N, Accessor > &vec)
 Sum of all elements.
template<size_t N, typename T, ValidAccessor< T > Accessor>
constexpr auto product (const AVector< T, N, Accessor > &vec)
 Product of all elements.
template<size_t N, typename T, ValidAccessor< T > Accessor>
constexpr auto min (const AVector< T, N, Accessor > &vec)
 Minimum element.
template<size_t N, typename T, ValidAccessor< T > Accessor>
constexpr auto max (const AVector< T, N, Accessor > &vec)
 Maximum element.
template<size_t N, typename T, ValidAccessor< T > Accessor, typename OutputType = std::conditional_t<std::is_integral_v<T>, double, T>>
constexpr OutputType mean (const AVector< T, N, Accessor > &vec)
 Mean of all elements (returns a double if T is an integral type, otherwise returns T).
template<size_t N, typename T, ValidAccessor< T > Accessor, typename OutputType = std::conditional_t<std::is_integral_v<T>, float, T>>
constexpr OutputType mean_f (const AVector< T, N, Accessor > &vec)
 Mean of all elements (returns a float if T is an integral type, otherwise returns T).
template<size_t N, typename T, ValidAccessor< T > Accessor, typename OutputType = std::conditional_t<std::is_integral_v<T>, double, T>>
constexpr OutputType variance (const AVector< T, N, Accessor > &vec)
 Variance of all elements (returns a double if T is an integral type, otherwise returns T).
template<size_t N, typename T, ValidAccessor< T > Accessor, typename OutputType = std::conditional_t<std::is_integral_v<T>, float, T>>
constexpr OutputType variance_f (const AVector< T, N, Accessor > &vec)
 Variance of all elements (returns a float if T is an integral type, otherwise returns T).
template<size_t N, typename T, ValidAccessor< T > Accessor, typename OutputType = std::conditional_t<std::is_integral_v<T>, double, T>>
constexpr OutputType stddev (const AVector< T, N, Accessor > &vec)
 Standard deviation of all elements (returns a double if T is an integral type, otherwise returns T).
template<size_t N, typename T, ValidAccessor< T > Accessor, typename OutputType = std::conditional_t<std::is_integral_v<T>, float, T>>
constexpr OutputType stddev_f (const AVector< T, N, Accessor > &vec)
 Standard deviation of all elements (returns a float if T is an integral type, otherwise returns T).
Special matrix operations
template<ValidMatrixType MatrixType>
constexpr auto copy (const MatrixType &m)
 Get a deep copy of the given matrix.
template<typename U, ValidMatrixType MatrixType>
constexpr auto cast (const MatrixType &m)
 Cast a matrix to a different arithmetic type.
template<size_t N, size_t M, typename T, ValidAccessor< T > Accessor>
constexpr AMatrix< T, M, Ntranspose (const AMatrix< T, N, M, Accessor > &mat)
 AMatrix transpose.
template<size_t N, typename T, ValidAccessor< T > Accessor>
AMatrix< T, N, N > constexpr cofactors (const AMatrix< T, N, N, Accessor > &mat)
 AMatrix cofactors.
template<size_t N, typename T, ValidAccessor< T > Accessor>
AMatrix< T, N, N > constexpr adjugate (const AMatrix< T, N, N, Accessor > &mat)
 AMatrix adjugate.
template<size_t N, typename T, ValidAccessor< T > Accessor, typename OutputType = std::conditional_t<std::is_integral_v<T>, double, T>>
AMatrix< OutputType, N, N > constexpr inverse (const AMatrix< T, N, N, Accessor > &mat)
template<size_t N, typename T, ValidAccessor< T > Accessor, typename OutputElementType = std::conditional_t<std::is_integral_v<T>, float, T>>
constexpr auto inverse_f (const AMatrix< T, N, N, Accessor > &mat)
 AMatrix inverse (returns a float if T is an integral type, otherwise returns T).
template<size_t N, size_t M, typename U, typename T, ValidAccessor< U > Accessor1, ValidAccessor< T > Accessor2>
constexpr auto frobenius_inner_product (const AMatrix< U, N, M, Accessor1 > &a, const AMatrix< T, N, M, Accessor2 > &b)
 AMatrix Frobenius inner product.
template<size_t N, size_t M, typename U, typename T, ValidAccessor< U > Accessor1, ValidAccessor< T > Accessor2>
constexpr auto elementwise_mul (const AMatrix< U, N, M, Accessor1 > &a, const AMatrix< T, N, M, Accessor2 > &b)
 Element-wise product.
template<size_t N, size_t M, typename U, typename T, ValidAccessor< U > Accessor1, ValidAccessor< T > Accessor2>
constexpr auto elementwise_div (const AMatrix< U, N, M, Accessor1 > &a, const AMatrix< T, N, M, Accessor2 > &b)
 Element-wise product.
template<typename Func, size_t N, size_t M, typename T, ValidAccessor< T > Accessor>
constexpr auto apply (Func &&func, const AMatrix< T, N, M, Accessor > &mat)
 Apply a function to each element of the matrix.
template<typename Func, size_t N, size_t M, typename T, ValidAccessor< T > Accessor>
constexpr auto apply_row (Func &&func, const AMatrix< T, N, M, Accessor > &mat)
 Apply a function to each row of the matrix.
template<typename Func, size_t N, size_t M, typename T, ValidAccessor< T > Accessor>
constexpr auto apply_column (Func &&func, const AMatrix< T, N, M, Accessor > &mat)
 Apply a function to each column of the matrix.
Special vector operations with matrices
template<size_t N, size_t M, typename U, typename T, ValidAccessor< U > Accessor1, ValidAccessor< T > Accessor2>
constexpr auto outer_product (const AVector< U, N, Accessor1 > &a, const AVector< T, M, Accessor2 > &b)
 Outer product of two vectors.
AMatrix norms
template<size_t N, size_t M, typename T, ValidAccessor< T > Accessor>
constexpr auto frobenius_norm (const AMatrix< T, N, M, Accessor > &mat)
 AMatrix Frobenius norm.
template<size_t N, size_t M, typename T, ValidAccessor< T > Accessor>
constexpr auto inf_norm (const AMatrix< T, N, M, Accessor > &mat)
 AMatrix infinity norm.
template<size_t N, size_t M, typename T, ValidAccessor< T > Accessor>
constexpr auto one_norm (const AMatrix< T, N, M, Accessor > &mat)
 AMatrix 1-norm (maximum absolute column sum).
template<size_t N, size_t M, typename T, ValidAccessor< T > Accessor>
constexpr auto two_norm (const AMatrix< T, N, M, Accessor > &mat)
 AMatrix 2-norm.
atomic_load/store. Atomic memory management operations.
template<size_t N, size_t M, typename T, ValidAccessor< T > A>
AMatrix< T, N, Matomic_load (AMatrix< T, N, M, A > *const m)
 Atomic m_copy = m.
template<size_t N, size_t M, typename T1, ValidAccessor< T1 > A, typename T2>
void atomic_store (AMatrix< T1, N, M, A > *const m, const T2 &s)
 Atomic m[i, j] = s.
template<size_t N, size_t M, typename T1, ValidAccessor< T1 > A1, typename T2, ValidAccessor< T2 > A2>
void atomic_store (AMatrix< T1, N, M, A1 > *const m1, const AMatrix< T2, N, M, A2 > &m2)
 Atomic m1[i, j] = m2[i, j].
template<size_t N, typename T, ValidAccessor< T > A>
AVector< T, Natomic_load (AVector< T, N, A > *const v)
 Atomic v_copy = v.
template<size_t N, typename T1, ValidAccessor< T1 > A, typename T2>
void atomic_store (AVector< T1, N, A > *const v, const T2 &s)
 Atomic v[i] = s.
template<size_t N, typename T1, ValidAccessor< T1 > A1, typename T2, ValidAccessor< T2 > A2>
void atomic_store (AVector< T1, N, A1 > *const v1, const AVector< T2, N, A2 > &v2)
 Atomic v1[i] = v2[i].
AMatrix3<T, Accessor> views
template<typename T, ValidAccessor< T > Accessor>
constexpr auto get_matrix3_view (Accessor &&data)
 A helper function to create a AMatrix3<T, Accessor> based on a given (valid) accessor.
template<typename T, ValidAccessor< T > Accessor>
constexpr auto get_owning_matrix3 (Accessor &&data)
Special quaternion operations
template<ValidQuaternionType QuaternionType>
constexpr auto copy (const QuaternionType &q)
 Get a deep copy of the given quaternion.
template<typename U, ValidQuaternionType QuaternionType>
constexpr auto cast (const QuaternionType &q)
 Cast a quaternion to a different arithmetic type.
template<typename U, typename T, ValidAccessor< U > Accessor1, ValidAccessor< T > Accessor2>
constexpr auto dot (const AQuaternion< U, Accessor1 > &q1, const AQuaternion< T, Accessor2 > &q2)
 Get the dot product of two quaternions.
template<typename T, ValidAccessor< T > Accessor>
constexpr AQuaternion< std::remove_const_t< T > > conjugate (const AQuaternion< T, Accessor > &quat)
 Get the conjugate of a quaternion.
template<typename T, ValidAccessor< T > Accessor>
constexpr AQuaternion< std::remove_const_t< T > > inverse (const AQuaternion< T, Accessor > &quat)
 Get the inverse of a quaternion.
template<typename T, ValidAccessor< T > Accessor>
constexpr auto norm_squared (const AQuaternion< T, Accessor > &quat)
 Get the squared norm of a quaternion.
template<typename T, ValidAccessor< T > Accessor>
constexpr AQuaternion< std::remove_const_t< T > > normalize (const AQuaternion< T, Accessor > &quat)
 Get the normalized quaternion.
template<typename U, typename T, typename V, ValidAccessor< U > Accessor1, ValidAccessor< T > Accessor2>
constexpr auto slerp (const AQuaternion< U, Accessor1 > &q1, const AQuaternion< T, Accessor2 > &q2, const V t) -> AQuaternion< std::common_type_t< U, T, V > >
 Perform spherical linear interpolation between two quaternions.
template<ValidQuaternionType QuaternionType, ValidVectorType VectorType>
constexpr void rotate_quaternion (QuaternionType &quat, const VectorType &omega, const typename QuaternionType::value_type &dt)
 Rotate a quaternion by an angular velocity omega dt.
Non-member constructors and converters
template<typename T, typename U, ValidAccessor< T > Accessor>
constexpr auto axis_angle_to_quaternion (const AVector3< T, Accessor > &axis, const U &angle) -> AQuaternion< std::common_type_t< T, U > >
 Get the quaternion from an axis-angle representation.
template<typename T, ValidAccessor< T > Accessor>
constexpr AQuaternion< T > rotation_matrix_to_quaternion (const AMatrix3< T, Accessor > &rot_mat)
 Get the quaternion from a rotation matrix.
template<typename T, ValidAccessor< T > Accessor>
constexpr Matrix3< std::remove_const_t< T > > quaternion_to_rotation_matrix (const AQuaternion< T, Accessor > &quat)
 Get the rotation matrix from a quaternion.
template<typename T>
constexpr AQuaternion< std::remove_const_t< T > > euler_to_quat (const T roll, const T pitch, const T yaw)
 Get the quaternion from Euler angles https://en.wikipedia.org/wiki/Rotation_formalisms_in_three_dimensions#Euler_angles_%E2%86%94_quaternion.
template<typename U, typename T, ValidAccessor< U > Accessor1, ValidAccessor< T > Accessor2>
constexpr auto quat_from_parallel_transport (const AVector3< U, Accessor1 > &v_from, const AVector3< T, Accessor2 > &v_to) -> AQuaternion< decltype(U() *T())>
 Get the quaternion that perform parallel transport from vector v1 to vector v2.
AQuaternion<T, Accessor> views
template<typename T, typename Accessor>
constexpr auto get_quaternion_view (Accessor &&data)
 A helper function to create a AQuaternion<T, Accessor> based on a given accessor.
template<typename T, typename Accessor>
constexpr auto get_owning_quaternion (Accessor &&data)
Output stream
template<typename T, ValidAccessor< T > Accessor>
std::ostream & operator<< (std::ostream &os, const AScalar< T, Accessor > &s)
Comparison
template<typename U, typename T, ValidAccessor< U > Accessor1, ValidAccessor< T > Accessor2>
constexpr bool is_close (const AScalar< U, Accessor1 > &a, const AScalar< T, Accessor2 > &b, const decltype(get_comparison_tolerance< T, U >())&tol=get_comparison_tolerance< T, U >())
template<typename U, typename T, ValidAccessor< U > Accessor1, ValidAccessor< T > Accessor2>
constexpr bool is_approx_close (const AScalar< U, Accessor1 > &a, const AScalar< T, Accessor2 > &b, const decltype(get_relaxed_comparison_tolerance< T, U >())&tol=get_relaxed_comparison_tolerance< T, U >())
Non-member arithmetic: arithmetic op AScalar
template<typename U, typename T, ValidAccessor< T > Accessor>
constexpr auto operator+ (const U &scalar, const AScalar< T, Accessor > &s)
template<typename U, typename T, ValidAccessor< T > Accessor>
constexpr auto operator- (const U &scalar, const AScalar< T, Accessor > &s)
template<typename U, typename T, ValidAccessor< T > Accessor>
constexpr auto operator* (const U &scalar, const AScalar< T, Accessor > &s)
template<typename U, typename T, ValidAccessor< T > Accessor>
constexpr auto operator/ (const U &scalar, const AScalar< T, Accessor > &s)
 arithmetic / AScalar — promotes integral/integral to double
Non-member arithmetic: AScalar op AVector / AVector op AScalar
template<size_t N, typename T, typename U, ValidAccessor< T > Accessor1, ValidAccessor< U > Accessor2>
constexpr auto operator* (const AVector< T, N, Accessor1 > &vec, const AScalar< U, Accessor2 > &s) -> AVector< std::common_type_t< T, U >, N >
 AVector * AScalar.
template<size_t N, typename U, typename T, ValidAccessor< U > Accessor1, ValidAccessor< T > Accessor2>
constexpr auto operator* (const AScalar< U, Accessor1 > &s, const AVector< T, N, Accessor2 > &vec) -> AVector< std::common_type_t< T, U >, N >
 AScalar * AVector (commutative).
template<size_t N, typename T, typename U, ValidAccessor< T > Accessor1, ValidAccessor< U > Accessor2>
constexpr auto operator/ (const AVector< T, N, Accessor1 > &vec, const AScalar< U, Accessor2 > &s)
 AVector / AScalar — delegates to AVector::operator/, preserving its integer-promotion behaviour.
Non-member arithmetic: AScalar op AMatrix / AMatrix op AScalar
template<size_t N, size_t M, typename T, typename U, ValidAccessor< T > Accessor1, ValidAccessor< U > Accessor2>
constexpr auto operator* (const AMatrix< T, N, M, Accessor1 > &mat, const AScalar< U, Accessor2 > &s) -> AMatrix< std::common_type_t< T, U >, N, M >
 AMatrix * AScalar.
template<size_t N, size_t M, typename U, typename T, ValidAccessor< U > Accessor1, ValidAccessor< T > Accessor2>
constexpr auto operator* (const AScalar< U, Accessor1 > &s, const AMatrix< T, N, M, Accessor2 > &mat) -> AMatrix< std::common_type_t< T, U >, N, M >
 AScalar * AMatrix (commutative).
template<size_t N, size_t M, typename T, typename U, ValidAccessor< T > Accessor1, ValidAccessor< U > Accessor2>
constexpr auto operator/ (const AMatrix< T, N, M, Accessor1 > &mat, const AScalar< U, Accessor2 > &s)
 AMatrix / AScalar — delegates to AMatrix::operator/, preserving its integer-promotion behaviour.
Utility free functions
template<typename T, ValidAccessor< T > Accessor>
constexpr auto abs (const AScalar< T, Accessor > &s)
 Absolute value of a scalar.
template<ValidScalarType ScalarType>
constexpr auto copy (const ScalarType &s)
 Deep copy (mirrors the AVector free function).
template<typename U, ValidScalarType ScalarType>
constexpr auto cast (const ScalarType &s)
 Cast a scalar to a different arithmetic type.
Atomic memory operations on raw scalars
template<typename T>
atomic_load (T *const s)
 Atomic load: s_copy = *s.
template<typename T, typename U>
void atomic_store (T *const s, const U &value)
 Atomic store: *s = value.
template<typename T, typename U>
void atomic_add (T *const s, const U &value)
 Atomic *s += value.
template<typename T, typename Acc, typename U>
void atomic_add (AScalar< T, Acc > *const s, const U &value)
 Atomic *s += value — AScalar overload: operates on the underlying scalar, bypassing AScalar's operator+ (which returns a different storage type incompatible with CAS loops).
template<typename T, typename U>
void atomic_sub (T *const s, const U &value)
 Atomic *s -= value.
template<typename T, typename Acc, typename U>
void atomic_sub (AScalar< T, Acc > *const s, const U &value)
 Atomic *s -= value — AScalar overload.
template<typename T, typename U>
void atomic_mul (T *const s, const U &value)
 Atomic *s *= value.
template<typename T, typename Acc, typename U>
void atomic_mul (AScalar< T, Acc > *const s, const U &value)
 Atomic *s *= value — AScalar overload.
template<typename T, typename U>
void atomic_div (T *const s, const U &value)
 Atomic *s /= value.
template<typename T, typename Acc, typename U>
void atomic_div (AScalar< T, Acc > *const s, const U &value)
 Atomic *s /= value — AScalar overload.
template<typename T, typename U>
atomic_fetch_add (T *const s, const U &value)
 Atomic *s += value; returns old *s.
template<typename T, typename U>
atomic_fetch_sub (T *const s, const U &value)
 Atomic *s -= value; returns old *s.
template<typename T, typename U>
atomic_fetch_mul (T *const s, const U &value)
 Atomic *s *= value; returns old *s.
template<typename T, typename U>
atomic_fetch_div (T *const s, const U &value)
 Atomic *s /= value; returns old *s.
template<typename T, typename U>
atomic_add_fetch (T *const s, const U &value)
 Atomic *s += value; returns new *s.
template<typename T, typename U>
atomic_sub_fetch (T *const s, const U &value)
 Atomic *s -= value; returns new *s.
template<typename T, typename U>
atomic_mul_fetch (T *const s, const U &value)
 Atomic *s *= value; returns new *s.
template<typename T, typename U>
atomic_div_fetch (T *const s, const U &value)
 Atomic *s /= value; returns new *s.
View and owning helpers
template<typename T, ValidAccessor< T > Accessor>
constexpr auto get_scalar_view (Accessor &&data)
 Create a non-owning AScalar view over an existing accessor.
template<typename T, ValidAccessor< T > Accessor>
constexpr auto get_owning_scalar (Accessor &&data)
 Create an owning AScalar by moving the accessor.
ShiftedView views
template<typename T, size_t shift, ValidAccessor< T > Accessor>
constexpr auto get_shifted_view (Accessor &&data)
 A helper function to create a ShiftedView<T, N, Accessor> based on a given accessor.
template<typename T, size_t shift, ValidAccessor< T > Accessor>
constexpr auto get_owning_shifted_accessor (Accessor &&data)
StridedView views
template<typename T, size_t stride, ValidAccessor< T > Accessor>
constexpr auto get_strided_view (Accessor &&data)
 A helper function to create a StridedView<T, stride, Accessor> based on a given accessor.
template<typename T, size_t stride, ValidAccessor< T > Accessor>
constexpr auto get_owning_strided_accessor (Accessor &&data)
TransposedView views
template<typename T, size_t N, size_t M, ValidAccessor< T > Accessor>
constexpr auto get_transposed_view (Accessor &&data)
 A helper function to create a TransposedView<T, N, Accessor> based on a given accessor.
template<typename T, size_t N, size_t M, ValidAccessor< T > Accessor>
constexpr auto get_owning_transposed_accessor (Accessor &&data)
Special vector operations
template<ValidVectorType VectorType>
constexpr auto copy (const VectorType &v)
 Get a deep copy of the given vector.
template<typename U, ValidVectorType VectorType>
constexpr auto cast (const VectorType &v)
 Cast a vector to a different arithmetic type.
template<size_t N, typename U, typename T, ValidAccessor< U > Accessor1, ValidAccessor< T > Accessor2>
constexpr auto dot (const AVector< U, N, Accessor1 > &a, const AVector< T, N, Accessor2 > &b) -> std::common_type_t< T, U >
 Dot product of two vectors.
template<size_t N, typename U, typename T, ValidAccessor< U > Accessor1, ValidAccessor< T > Accessor2>
constexpr auto elementwise_mul (const AVector< U, N, Accessor1 > &a, const AVector< T, N, Accessor2 > &b)
 Element-wise product.
template<size_t N, typename U, typename T, ValidAccessor< U > Accessor1, ValidAccessor< T > Accessor2>
constexpr auto elementwise_div (const AVector< U, N, Accessor1 > &a, const AVector< T, N, Accessor2 > &b)
 Element-wise division.
template<typename Func, size_t N, typename T, ValidAccessor< T > Accessor>
constexpr auto apply (Func &&func, const AVector< T, N, Accessor > &vec)
 Apply a function to each element of the vector.
AVector norms
template<size_t N, typename T, ValidAccessor< T > Accessor>
constexpr auto abs (const AVector< T, N, Accessor > &vec)
 AVector component-wise absolute value.
template<size_t N, typename T, ValidAccessor< T > Accessor>
constexpr auto inf_norm (const AVector< T, N, Accessor > &vec)
 AVector infinity norm.
template<size_t N, typename T, ValidAccessor< T > Accessor>
constexpr auto one_norm (const AVector< T, N, Accessor > &vec)
 AVector 1-norm.
template<size_t N, typename T, ValidAccessor< T > Accessor, typename OutputType = std::conditional_t<std::is_integral_v<T>, double, T>>
constexpr OutputType two_norm (const AVector< T, N, Accessor > &vec)
 AVector 2-norm (Returns a double if T is an integral type, otherwise returns T).
template<size_t N, typename T, ValidAccessor< T > Accessor, typename OutputType = std::conditional_t<std::is_integral_v<T>, float, T>>
constexpr OutputType two_norm_f (const AVector< T, N, Accessor > &vec)
 AVector 2-norm (Returns a float if T is an integral type, otherwise returns T).
template<size_t N, typename T, ValidAccessor< T > Accessor>
constexpr auto two_norm_squared (const AVector< T, N, Accessor > &vec)
 AVector squared 2-norm.
template<size_t N, typename T, ValidAccessor< T > Accessor, typename OutputType = std::conditional_t<std::is_integral_v<T>, double, T>>
constexpr OutputType norm (const AVector< T, N, Accessor > &vec)
 Default vector norm (2-norm, returns a double if T is an integral type, otherwise returns T).
template<size_t N, typename T, ValidAccessor< T > Accessor, typename OutputType = std::conditional_t<std::is_integral_v<T>, float, T>>
constexpr OutputType norm_f (const AVector< T, N, Accessor > &vec)
 Default vector norm (2-norm, returns a float if T is an integral type, otherwise returns T).
template<size_t N, typename T, ValidAccessor< T > Accessor>
constexpr auto norm_squared (const AVector< T, N, Accessor > &vec)
 Default vector norm squared (2-norm).
template<size_t N, typename U, typename T, ValidAccessor< U > Accessor1, ValidAccessor< T > Accessor2, typename OutputType = std::conditional_t<std::is_integral_v<std::common_type_t<U, T>>, double, std::common_type_t<U, T>>>
constexpr OutputType minor_angle (const AVector< U, N, Accessor1 > &a, const AVector< T, N, Accessor2 > &b)
 Minor angle between two vectors (returns a double if common_type_t<U, T> is integral, otherwise common_type_t<U, T>).
template<size_t N, typename U, typename T, ValidAccessor< U > Accessor1, ValidAccessor< T > Accessor2, typename OutputType = std::conditional_t<std::is_integral_v<std::common_type_t<U, T>>, float, std::common_type_t<U, T>>>
constexpr OutputType minor_angle_f (const AVector< U, N, Accessor1 > &a, const AVector< T, N, Accessor2 > &b)
 Minor angle between two vectors (returns a float if common_type_t<U, T> is integral, otherwise common_type_t<U, T>).
template<size_t N, typename U, typename T, ValidAccessor< U > Accessor1, ValidAccessor< T > Accessor2, typename OutputType = std::conditional_t<std::is_integral_v<std::common_type_t<U, T>>, double, std::common_type_t<U, T>>>
constexpr OutputType major_angle (const AVector< U, N, Accessor1 > &a, const AVector< T, N, Accessor2 > &b)
 Major angle between two vectors (returns a double if common_type_t<U, T> is integral, otherwise common_type_t<U, T>).
template<size_t N, typename U, typename T, ValidAccessor< U > Accessor1, ValidAccessor< T > Accessor2, typename OutputType = std::conditional_t<std::is_integral_v<std::common_type_t<U, T>>, float, std::common_type_t<U, T>>>
constexpr OutputType major_angle_f (const AVector< U, N, Accessor1 > &a, const AVector< T, N, Accessor2 > &b)
 Major angle between two vectors (returns a float if common_type_t<U, T> is integral, otherwise common_type_t<U, T>).
AVector views
size_t ValidAccessor< T > Accessor constexpr auto get_vector_view (Accessor &&data)
template<typename T, size_t N, ValidAccessor< T > Accessor>
constexpr auto get_owning_vector (Accessor &&data)
Special vector3 operations
template<typename U, typename T, ValidAccessor< U > Accessor1, ValidAccessor< T > Accessor2>
constexpr auto cross (const AVector3< U, Accessor1 > &a, const AVector3< T, Accessor2 > &b) -> AVector3< std::common_type_t< T, U > >
 Cross product.
AVector3<T, Accessor> views
template<typename T, ValidAccessor< T > Accessor>
constexpr auto get_vector3_view (Accessor &&data)
 A helper function to create a AVector3<T, Accessor> based on a given accessor.
template<typename T, ValidAccessor< T > Accessor>
constexpr auto get_owning_vector3 (Accessor &&data)
Free space distance calculations
template<ValidCircle3DType Circle3DType1, ValidCircle3DType Circle3DType2>
Circle3DType1::value_type distance (const Circle3DType1 &circle3d1, const Circle3DType2 &circle3d2)
template<ValidCircle3DType Circle3DType1, ValidCircle3DType Circle3DType2>
Circle3DType1::value_type distance (const Euclidean distance_type, const Circle3DType1 &circle3d1, const Circle3DType2 &circle3d2)
template<ValidCircle3DType Circle3DType1, ValidCircle3DType Circle3DType2>
Circle3DType1::value_type distance (const Euclidean distance_type, const Circle3DType1 &circle3d1, const Circle3DType2 &circle3d2, Point< typename Circle3DType1::value_type > &closest_point1, Point< typename Circle3DType1::value_type > &closest_point2, mundy::Vector3< typename Circle3DType1::value_type > &shared_normal1, mundy::Vector3< typename Circle3DType1::value_type > &shared_normal2)
template<ValidEllipsoidType EllipsoidType1, ValidEllipsoidType EllipsoidType2>
EllipsoidType1::value_type distance (const EllipsoidType1 &ellipsoid1, const EllipsoidType2 &ellipsoid2)
 Ellipsoid–ellipsoid shared-normal signed separation distance.
template<ValidEllipsoidType EllipsoidType1, ValidEllipsoidType EllipsoidType2>
EllipsoidType1::value_type distance (const SharedNormalSigned tag, const EllipsoidType1 &ellipsoid1, const EllipsoidType2 &ellipsoid2)
 2-arg overload — convenience wrapper for the 6-arg FDF implementation.
template<ValidEllipsoidType EllipsoidType1, ValidEllipsoidType EllipsoidType2>
EllipsoidType1::value_type distance (const SharedNormalSigned, const EllipsoidType1 &ellipsoid1, const EllipsoidType2 &ellipsoid2, Point< typename EllipsoidType1::value_type > &closest_point1, Point< typename EllipsoidType1::value_type > &closest_point2, mundy::Vector3< typename EllipsoidType1::value_type > &shared_normal1, mundy::Vector3< typename EllipsoidType1::value_type > &shared_normal2)
 Full 6-arg distance using the combined FDF L-BFGS minimiser.
template<ValidEllipsoidType EllipsoidType1, ValidEllipsoidType EllipsoidType2>
EllipsoidType1::value_type distance (const SharedNormalSignedFiniteDiff tag, const EllipsoidType1 &ellipsoid1, const EllipsoidType2 &ellipsoid2)
 Finite-difference-gradient variant — retained for benchmarking only.
template<ValidEllipsoidType EllipsoidType1, ValidEllipsoidType EllipsoidType2>
EllipsoidType1::value_type distance (const SharedNormalSignedFiniteDiff, const EllipsoidType1 &ellipsoid1, const EllipsoidType2 &ellipsoid2, Point< typename EllipsoidType1::value_type > &closest_point1, Point< typename EllipsoidType1::value_type > &closest_point2, mundy::Vector3< typename EllipsoidType1::value_type > &shared_normal1, mundy::Vector3< typename EllipsoidType1::value_type > &shared_normal2)
template<ValidLineType LineType1, ValidLineType LineType2>
LineType1::value_type distance (const LineType1 &line1, const LineType2 &line2)
 Compute the distance between two lines (defaults to SharedNormalSigned distance).
template<ValidLineType LineType1, ValidLineType LineType2>
LineType1::value_type distance (const SharedNormalSigned distance_type, const LineType1 &line1, const LineType2 &line2)
 Compute the distance between two lines.
template<ValidLineType LineType1, ValidLineType LineType2>
LineType1::value_type distance (const Euclidean distance_type, const LineType1 &line1, const LineType2 &line2)
 Compute the distance between two lines.
template<ValidLineType LineType1, ValidLineType LineType2>
LineType1::value_type distance (const LineType1 &line1, const LineType2 &line2, Point< typename LineType1::value_type > &closest_point1, Point< typename LineType1::value_type > &closest_point2, typename LineType1::value_type &arch_length1, typename LineType1::value_type &arch_length2, mundy::Vector3< typename LineType1::value_type > &sep)
 Compute the distance between two lines (defaults to SharedNormalSigned distance).
template<ValidLineType LineType1, ValidLineType LineType2>
LineType1::value_type distance (const SharedNormalSigned distance_type, const LineType1 &line1, const LineType2 &line2, Point< typename LineType1::value_type > &closest_point1, Point< typename LineType1::value_type > &closest_point2, typename LineType1::value_type &arch_length1, typename LineType1::value_type &arch_length2, mundy::Vector3< typename LineType1::value_type > &sep)
 Compute the distance between two lines.
template<ValidLineSegmentType LineSegmentType1, ValidLineSegmentType LineSegmentType2>
LineSegmentType1::value_type distance (const LineSegmentType1 &line_segment1, const LineSegmentType2 &line_segment2)
 Compute the distance between two line segments.
template<ValidLineSegmentType LineSegmentType1, ValidLineSegmentType LineSegmentType2>
LineSegmentType1::value_type distance (const Euclidean distance_type, const LineSegmentType1 &line_segment1, const LineSegmentType2 &line_segment2)
 Compute the euclidean separation distance between two line segments.
template<ValidLineSegmentType LineSegmentType1, ValidLineSegmentType LineSegmentType2>
LineSegmentType1::value_type distance (const SharedNormalSigned distance_type, const LineSegmentType1 &line_segment1, const LineSegmentType2 &line_segment2)
 Compute the euclidean separation distance between two line segments.
template<ValidLineSegmentType LineSegmentType1, ValidLineSegmentType LineSegmentType2>
LineSegmentType1::value_type distance (const LineSegmentType1 &line_segment1, const LineSegmentType2 &line_segment2, Point< typename LineSegmentType1::value_type > &closest_point1, Point< typename LineSegmentType1::value_type > &closest_point2, typename LineSegmentType1::value_type &arch_length1, typename LineSegmentType1::value_type &arch_length2, mundy::Vector3< typename LineSegmentType1::value_type > &sep)
 Compute the distance between two line segments.
template<ValidLineSegmentType LineSegmentType1, ValidLineSegmentType LineSegmentType2>
LineSegmentType1::value_type distance (const SharedNormalSigned distance_type, const LineSegmentType1 &line_segment1, const LineSegmentType2 &line_segment2, Point< typename LineSegmentType1::value_type > &closest_point1, Point< typename LineSegmentType1::value_type > &closest_point2, typename LineSegmentType1::value_type &arch_length1, typename LineSegmentType1::value_type &arch_length2, mundy::Vector3< typename LineSegmentType1::value_type > &sep)
 Compute the shared normal signed separation distance between two line segments.
template<ValidLineSegmentType LineSegmentType1, ValidLineSegmentType LineSegmentType2>
LineSegmentType1::value_type distance (const Euclidean distance_type, const LineSegmentType1 &line_segment1, const LineSegmentType2 &line_segment2, Point< typename LineSegmentType1::value_type > &closest_point1, Point< typename LineSegmentType1::value_type > &closest_point2, typename LineSegmentType1::value_type &arch_length1, typename LineSegmentType1::value_type &arch_length2, mundy::Vector3< typename LineSegmentType1::value_type > &sep)
 Compute the euclidean distance between two line segments.
template<ValidLineSegmentType LineSegmentType, ValidSphereType SphereType>
LineSegmentType::value_type distance (const LineSegmentType &line_segment, const SphereType &sphere)
 Compute the distance between a line segment and a sphere.
template<ValidLineSegmentType LineSegmentType, ValidSphereType SphereType>
LineSegmentType::value_type distance (const SharedNormalSigned distance_type, const LineSegmentType &line_segment, const SphereType &sphere)
 Compute the shared normal signed separation distance between a line segment and a sphere.
template<ValidLineSegmentType LineSegmentType, ValidSphereType SphereType>
LineSegmentType::value_type distance (const LineSegmentType &line_segment, const SphereType &sphere, Point< typename LineSegmentType::value_type > &closest_point, typename LineSegmentType::value_type &arch_length, mundy::Vector3< typename LineSegmentType::value_type > &sep)
 Compute the distance between a line segment and a sphere.
template<ValidLineSegmentType LineSegmentType, ValidSphereType SphereType>
LineSegmentType::value_type distance (const SharedNormalSigned distance_type, const LineSegmentType &line_segment, const SphereType &sphere, Point< typename LineSegmentType::value_type > &closest_point, typename LineSegmentType::value_type &arch_length, mundy::Vector3< typename LineSegmentType::value_type > &sep)
 Compute the shared normal signed separation distance between a line segment and a sphere.
template<ValidLineType LineType, ValidSphereType SphereType>
LineType::value_type distance (const LineType &line, const SphereType &sphere)
 Compute the distance between a line and a sphere.
template<ValidLineType LineType, ValidSphereType SphereType>
LineType::value_type distance (const SharedNormalSigned distance_type, const LineType &line, const SphereType &sphere)
 Compute the shared normal signed separation distance between a line and a sphere.
template<ValidLineType LineType, ValidSphereType SphereType>
LineType::value_type distance (const LineType &line, const SphereType &sphere, Point< typename LineType::value_type > &closest_point, typename LineType::value_type &arch_length, mundy::Vector3< typename LineType::value_type > &sep)
 Compute the distance between a line and a sphere.
template<ValidLineType LineType, ValidSphereType SphereType>
LineType::value_type distance (const SharedNormalSigned distance_type, const LineType &line, const SphereType &sphere, Point< typename LineType::value_type > &closest_point, typename LineType::value_type &arch_length, mundy::Vector3< typename LineType::value_type > &sep)
 Compute the shared normal signed separation distance between a line and a sphere.
template<ValidPointType PointType, ValidEllipsoidType EllipsoidType>
PointType::value_type distance (const PointType &point, const EllipsoidType &ellipsoid)
template<ValidPointType PointType, ValidEllipsoidType EllipsoidType>
PointType::value_type distance (const SharedNormalSigned distance_type, const PointType &point, const EllipsoidType &ellipsoid)
template<ValidPointType PointType, ValidEllipsoidType EllipsoidType>
PointType::value_type distance (const SharedNormalSigned distance_type, const PointType &point, const EllipsoidType &ellipsoid, Point< typename PointType::value_type > &closest_point, mundy::Vector3< typename PointType::value_type > &ellipsoid_normal)
template<ValidPointType PointType, ValidLineType LineType>
PointType::value_type distance (const PointType &point, const LineType &line)
 Compute the shared normal signed separation distance between a point and a line.
template<ValidPointType PointType, ValidLineType LineType>
PointType::value_type distance (const SharedNormalSigned distance_type, const PointType &point, const LineType &line)
 Compute the shared normal signed separation distance between a point and a line.
template<ValidPointType PointType, ValidLineType LineType>
PointType::value_type distance (const PointType &point, const LineType &line, Point< typename PointType::value_type > &closest_point, typename PointType::value_type &arch_length, mundy::Vector3< typename PointType::value_type > &sep)
 Compute the euclidean distance between a point and a line.
template<ValidPointType PointType, ValidLineType LineType>
PointType::value_type distance (const SharedNormalSigned distance_type, const PointType &point, const LineType &line, Point< typename PointType::value_type > &closest_point, typename PointType::value_type &arch_length, mundy::Vector3< typename PointType::value_type > &sep)
 Compute the shared normal signed separation distance between a point and a line.
template<ValidPointType PointType, ValidLineSegmentType LineSegmentType>
PointType::value_type distance (const PointType &point, const LineSegmentType &line_segment)
 Compute the shared normal signed separation distance between a point and a line segment.
template<ValidPointType PointType, ValidLineSegmentType LineSegmentType>
PointType::value_type distance (const SharedNormalSigned distance_type, const PointType &point, const LineSegmentType &line_segment)
 Compute the shared normal signed separation distance between a point and a line segment.
template<ValidPointType PointType, ValidLineSegmentType LineSegmentType>
PointType::value_type distance (const PointType &point, const LineSegmentType &line_segment, Point< typename PointType::value_type > &closest_point, typename PointType::value_type &arch_length, mundy::Vector3< typename PointType::value_type > &sep)
 Compute the euclidean distance between a point and a line segment.
template<ValidPointType PointType, ValidLineSegmentType LineSegmentType>
PointType::value_type distance (const SharedNormalSigned distance_type, const PointType &point, const LineSegmentType &line_segment, Point< typename PointType::value_type > &closest_point, typename PointType::value_type &arch_length, mundy::Vector3< typename PointType::value_type > &sep)
 Compute the shared normal signed separation distance between a point and a line segment.
template<ValidPointType PointType1, ValidPointType PointType2>
PointType1::value_type distance (const SharedNormalSigned distance_type, const PointType1 &point1, const PointType2 &point2)
 Compute the shared normal signed separation distance between two points.
template<ValidPointType PointType1, ValidPointType PointType2>
PointType1::value_type distance (const SharedNormalSigned distance_type, const PointType1 &point1, const PointType2 &point2, mundy::Vector3< typename PointType1::value_type > &sep)
 Compute the shared normal signed separation distance between two points.
template<ValidPointType PointType1, ValidPointType PointType2>
PointType1::value_type distance (const Euclidean distance_type, const PointType1 &point1, const PointType2 &point2)
 Compute the euclidean distance between two points.
template<ValidPointType PointType1, ValidPointType PointType2>
PointType1::value_type distance (const Euclidean distance_type, const PointType1 &point1, const PointType2 &point2, mundy::Vector3< typename PointType1::value_type > &sep)
 Compute the euclidean distance between two points.
template<ValidPointType PointType1, ValidPointType PointType2>
PointType1::value_type distance (const PointType1 &point1, const PointType2 &point2)
 Compute the shared normal signed separation distance between two points.
template<ValidPointType PointType1, ValidPointType PointType2>
PointType1::value_type distance (const PointType1 &point1, const PointType2 &point2, mundy::Vector3< typename PointType1::value_type > &sep)
 Compute the euclidean distance between two points.
template<ValidPointType PointType, ValidSphereType SphereType>
PointType::value_type distance (const PointType &point, const SphereType &sphere)
 Compute the shared normal signed separation distance between a point and a sphere.
template<ValidPointType PointType, ValidSphereType SphereType>
PointType::value_type distance (const SharedNormalSigned distance_type, const PointType &point, const SphereType &sphere)
 Compute the shared normal signed separation distance between a point and a sphere.
template<ValidPointType PointType, ValidSphereType SphereType>
PointType::value_type distance (const PointType &point, const SphereType &sphere, mundy::Vector3< typename PointType::value_type > &sep)
 Compute the distance between a point and a sphere.
template<ValidSphereType SphereType1, ValidSphereType SphereType2>
SphereType1::value_type distance (const SphereType1 &sphere1, const SphereType2 &sphere2)
 Compute the shared normal signed separation distance between two spheres.
template<ValidSphereType SphereType1, ValidSphereType SphereType2>
SphereType1::value_type distance (const SharedNormalSigned distance_type, const SphereType1 &sphere1, const SphereType2 &sphere2)
 Compute the shared normal signed separation distance between two spheres.
template<ValidSphereType SphereType1, ValidSphereType SphereType2>
SphereType1::value_type distance (const SphereType1 &sphere1, const SphereType2 &sphere2, mundy::Vector3< typename SphereType1::value_type > &sep)
 Compute the distance between two spheres.
Non-member metric constructors
template<unsigned PeriodicAxes = AXIS_XYZ, typename Scalar>
constexpr OrthorhombicMetric< PeriodicAxes, Scalarmake_orthorhombic_metric (const Vector3< Scalar > &cell_widths)
 Orthorhombic metric from axis-aligned cell widths.
template<unsigned PeriodicAxes = AXIS_XYZ, typename Scalar>
constexpr OrthorhombicMetric< PeriodicAxes, Scalarmake_orthorhombic_metric (const Vector3< Scalar > &domain_min, const Vector3< Scalar > &domain_max)
 Orthorhombic metric from domain corners.
template<unsigned PeriodicAxes = AXIS_XYZ, typename Scalar>
constexpr TriclinicMetric< PeriodicAxes, Scalarmake_triclinic_metric (const Matrix3< Scalar > &h)
 Triclinic metric from a cell matrix.
template<unsigned PeriodicAxes = AXIS_XYZ, typename Scalar>
constexpr TriclinicMetric< PeriodicAxes, Scalarmake_triclinic_metric (const Vector3< Scalar > &cell_widths)
 Triclinic metric from axis-aligned cell widths (diagonal h).
reference_point protocol
template<typename Object>
auto reference_point (const Object &obj)
 Returns the canonical reference point for an object.
Wrapping utilities
template<typename Integer, typename Object, typename Metric>
auto shift_image (const Object &obj, const Vector3< Integer > &lattice_vector, const Metric &metric)
 Translate an object by an integer number of lattice images.
template<typename Object, typename Metric>
auto wrap_rigid (const Object &obj, const Metric &metric)
 Translate an object so its reference point lies in the primary cell.
template<typename Object, typename Metric>
void wrap_rigid_inplace (Object &obj, const Metric &metric)
 In-place variant of wrap_rigid.
template<FinitePrimitive Object, typename Metric>
auto wrap_points (const Object &obj, const Metric &metric)
 Wrap each geometric point of an object independently into the primary cell.
template<FinitePrimitive Object, typename Metric>
void wrap_points_inplace (Object &obj, const Metric &metric)
 In-place variant of wrap_points.
template<FinitePrimitive Object, ValidPointType PointT, typename Metric>
auto unwrap_points_to_ref (const Object &obj, const Metric &metric, const PointT &ref_point)
 Move each point to the periodic image closest to ref_point.
template<FinitePrimitive Object, ValidPointType PointT, typename Metric>
void unwrap_points_to_ref_inplace (Object &obj, const Metric &metric, const PointT &ref_point)
 In-place variant of unwrap_points_to_ref.
template<ValidPointType PointT, typename Metric>
Vector3< intimage_index (const PointT &p, const Metric &metric)
 The integer periodic image of a point: the lattice cell k such that the point lies in cell k.
template<typename Integer, typename Metric>
Vector3< typename Metric::value_type > lattice_displacement (const Vector3< Integer > &n, const Metric &metric)
 The Cartesian displacement of an integer lattice combination n, i.e. Σ nᵢ·aáµ¢ over the lattice vectors.
Non-member functions for ValidAABBType objects
template<ValidAABBType T1, ValidAABBType T2>
constexpr bool is_close (const T1 &a1, const T2 &a2, typename T1::value_type tol=get_comparison_tolerance< typename T1::value_type, typename T2::value_type >())
 Element-wise approximate equality (within a tolerance).
template<ValidAABBType T1, ValidAABBType T2>
constexpr bool is_approx_close (const T1 &a1, const T2 &a2, typename T1::value_type tol=get_relaxed_comparison_tolerance< typename T1::value_type, typename T2::value_type >())
 Element-wise approximate equality (within a relaxed tolerance).
template<ValidAABBType AABBType>
std::ostream & operator<< (std::ostream &os, const AABBType &aabb)
template<ValidAABBType AABBType1, ValidAABBType AABBType2>
constexpr bool intersects (const AABBType1 &aabb1, const AABBType2 &aabb2)
 Check if two AABBs intersect.
Point visitation
template<ValidAABBType T, typename Functor>
void for_each_point (const T &aabb, Functor &&f)
 Visit each geometric point of an AABB (min_corner, max_corner).
template<ValidAABBType T, typename Functor>
void for_each_point_mutable (T &aabb, Functor &&f)
 Visit and mutate each geometric point of an AABB.
template<ValidCircle3DType T, typename Functor>
void for_each_point (const T &c, Functor &&f)
 Visit the geometric point of a Circle3D (its center).
template<ValidCircle3DType T, typename Functor>
void for_each_point_mutable (T &c, Functor &&f)
 Visit and mutate the geometric point of a Circle3D.
template<ValidEllipsoidType T, typename Functor>
void for_each_point (const T &e, Functor &&f)
 Visit the geometric point of an Ellipsoid (its center).
template<ValidEllipsoidType T, typename Functor>
void for_each_point_mutable (T &e, Functor &&f)
 Visit and mutate the geometric point of an Ellipsoid.
template<ValidLineType T, typename Functor>
void for_each_point (const T &l, Functor &&f)
 Visit the geometric anchor point of a Line (its center). The direction is a vector, not a position, and is not visited.
template<ValidLineType T, typename Functor>
void for_each_point_mutable (T &l, Functor &&f)
 Visit and mutate the geometric anchor point of a Line. The direction is a vector, not a position, and is not mutated.
template<ValidLineSegmentType T, typename Functor>
void for_each_point (const T &ls, Functor &&f)
 Visit each geometric point of a LineSegment (start, end).
template<ValidLineSegmentType T, typename Functor>
void for_each_point_mutable (T &ls, Functor &&f)
 Visit and mutate each geometric point of a LineSegment.
template<ValidOBBType T, typename Functor>
void for_each_point (const T &obb, Functor &&f)
template<ValidOBBType T, typename Functor>
void for_each_point_mutable (T &obb, Functor &&f)
template<ValidPointType PointT, typename Functor>
void for_each_point (const PointT &pt, Functor &&f)
 Visit each geometric point of a Point (the point itself).
template<ValidPointType PointT, typename Functor>
void for_each_point_mutable (PointT &pt, Functor &&f)
 Visit and mutate each geometric point of a Point.
template<ValidRingType T, typename Functor>
void for_each_point (const T &r, Functor &&f)
 Visit the geometric point of a Ring (its center).
template<ValidRingType T, typename Functor>
void for_each_point_mutable (T &r, Functor &&f)
 Visit and mutate the geometric point of a Ring.
template<ValidSphereType T, typename Functor>
void for_each_point (const T &s, Functor &&f)
 Visit the geometric point of a Sphere (its center).
template<ValidSphereType T, typename Functor>
void for_each_point_mutable (T &s, Functor &&f)
 Visit and mutate the geometric point of a Sphere.
template<ValidSpherocylinderType T, typename Functor>
void for_each_point (const T &sc, Functor &&f)
 Visit the geometric point of a Spherocylinder (its center).
template<ValidSpherocylinderType T, typename Functor>
void for_each_point_mutable (T &sc, Functor &&f)
 Visit and mutate the geometric point of a Spherocylinder.
template<ValidSpherocylinderSegmentType T, typename Functor>
void for_each_point (const T &scs, Functor &&f)
 Visit each geometric point of a SpherocylinderSegment (start, end).
template<ValidSpherocylinderSegmentType T, typename Functor>
void for_each_point_mutable (T &scs, Functor &&f)
 Visit and mutate each geometric point of a SpherocylinderSegment.
template<ValidVSegmentType T, typename Functor>
void for_each_point (const T &vs, Functor &&f)
 Visit each geometric point of a VSegment (start, middle, end).
template<ValidVSegmentType T, typename Functor>
void for_each_point_mutable (T &vs, Functor &&f)
 Visit and mutate each geometric point of a VSegment.
Non-member functions for ValidCircle3DType objects
template<ValidCircle3DType T1, ValidCircle3DType T2>
constexpr bool is_close (const T1 &c1, const T2 &c2, typename T1::value_type tol=get_comparison_tolerance< typename T1::value_type, typename T2::value_type >())
 Element-wise approximate equality (within a tolerance).
template<ValidCircle3DType T1, ValidCircle3DType T2>
constexpr bool is_approx_close (const T1 &c1, const T2 &c2, typename T1::value_type tol=get_relaxed_comparison_tolerance< typename T1::value_type, typename T2::value_type >())
 Element-wise approximate equality (within a relaxed tolerance).
template<ValidCircle3DType Circle3DType>
std::ostream & operator<< (std::ostream &os, const Circle3DType &circle3d)
 OStream operator.
Non-member functions for ValidSphereType objects
template<ValidEllipsoidType T1, ValidEllipsoidType T2>
constexpr bool is_close (const T1 &e1, const T2 &e2, typename T1::value_type tol=get_comparison_tolerance< typename T1::value_type, typename T2::value_type >())
 Element-wise approximate equality (within a tolerance).
template<ValidEllipsoidType T1, ValidEllipsoidType T2>
constexpr bool is_approx_close (const T1 &e1, const T2 &e2, typename T1::value_type tol=get_relaxed_comparison_tolerance< typename T1::value_type, typename T2::value_type >())
 Element-wise approximate equality (within a relaxed tolerance).
template<ValidEllipsoidType EllipsoidType>
std::ostream & operator<< (std::ostream &os, const EllipsoidType &ellipsoid)
 OStream operator.
template<ValidEllipsoidType EllipsoidType>
constexpr Point< typename EllipsoidType::value_type > map_body_frame_normal_to_ellipsoid (const Vector3< typename EllipsoidType::value_type > &body_frame_nhat, const EllipsoidType &ellipsoid)
template<typename Scalar, ValidAccessor< Scalar > Accessor1, ValidEllipsoidType EllipsoidType>
constexpr Vector3< Scalarmap_surface_normal_to_foot_point_on_ellipsoid (const AVector3< Scalar, Accessor1 > &lab_frame_ellipsoid_nhat, const EllipsoidType &ellipsoid)
template<ValidSphereType T1, ValidSphereType T2>
constexpr bool is_close (const T1 &s1, const T2 &s2, typename T1::value_type tol=get_comparison_tolerance< typename T1::value_type, typename T2::value_type >())
 Element-wise approximate equality (within a tolerance).
template<ValidSphereType T1, ValidSphereType T2>
constexpr bool is_approx_close (const T1 &s1, const T2 &s2, typename T1::value_type tol=get_relaxed_comparison_tolerance< typename T1::value_type, typename T2::value_type >())
 Element-wise approximate equality (within a relaxed tolerance).
template<ValidSphereType SphereType>
std::ostream & operator<< (std::ostream &os, const SphereType &sphere)
 OStream operator.
Non-member functions for ValidLineType objects
template<ValidLineType T1, ValidLineType T2>
constexpr bool is_close (const T1 &l1, const T2 &l2, typename T1::value_type tol=get_comparison_tolerance< typename T1::value_type, typename T2::value_type >())
 Element-wise approximate equality (within a tolerance).
template<ValidLineType T1, ValidLineType T2>
constexpr bool is_approx_close (const T1 &l1, const T2 &l2, typename T1::value_type tol=get_relaxed_comparison_tolerance< typename T1::value_type, typename T2::value_type >())
 Element-wise approximate equality (within a relaxed tolerance).
template<ValidLineType LineType>
std::ostream & operator<< (std::ostream &os, const LineType &line)
 Output stream operator.
Non-member functions for ValidLineSegmentType objects
template<ValidLineSegmentType T1, ValidLineSegmentType T2>
constexpr bool is_close (const T1 &ls1, const T2 &ls2, typename T1::value_type tol=get_comparison_tolerance< typename T1::value_type, typename T2::value_type >())
 Element-wise approximate equality (within a tolerance).
template<ValidLineSegmentType T1, ValidLineSegmentType T2>
constexpr bool is_approx_close (const T1 &ls1, const T2 &ls2, typename T1::value_type tol=get_relaxed_comparison_tolerance< typename T1::value_type, typename T2::value_type >())
 Element-wise approximate equality (within a relaxed tolerance).
template<ValidLineSegmentType LineSegmentType>
std::ostream & operator<< (std::ostream &os, const LineSegmentType &line_segment)
 OStream operator.
Approximate equality
template<ValidOBBType T1, ValidOBBType T2>
constexpr bool is_close (const T1 &a, const T2 &b, typename T1::value_type tol=get_comparison_tolerance< typename T1::value_type, typename T2::value_type >())
template<ValidOBBType T1, ValidOBBType T2>
constexpr bool is_approx_close (const T1 &a, const T2 &b, typename T1::value_type tol=get_relaxed_comparison_tolerance< typename T1::value_type, typename T2::value_type >())
Intersection test
template<ValidOBBType OBBType1, ValidOBBType OBBType2>
constexpr bool intersects (const OBBType1 &a, const OBBType2 &b)
 Test whether two OBBs overlap using the Separating Axis Theorem (SAT).
Stream output
template<ValidOBBType T>
std::ostream & operator<< (std::ostream &os, const T &obb)
Non-member functions for ValidRingType objects
template<ValidRingType T1, ValidRingType T2>
constexpr bool is_close (const T1 &r1, const T2 &r2, typename T1::value_type tol=get_comparison_tolerance< typename T1::value_type, typename T2::value_type >())
 Element-wise approximate equality (within a tolerance).
template<ValidRingType T1, ValidRingType T2>
constexpr bool is_approx_close (const T1 &r1, const T2 &r2, typename T1::value_type tol=get_relaxed_comparison_tolerance< typename T1::value_type, typename T2::value_type >())
 Element-wise approximate equality (within a relaxed tolerance).
template<ValidRingType RingType>
std::ostream & operator<< (std::ostream &os, const RingType &ring)
 OStream operator.
Non-member functions for ValidSpherocylinderType objects
template<ValidSpherocylinderType T1, ValidSpherocylinderType T2>
constexpr bool is_close (const T1 &sc1, const T2 &sc2, typename T1::value_type tol=get_comparison_tolerance< typename T1::value_type, typename T2::value_type >())
 Element-wise approximate equality (within a tolerance).
template<ValidSpherocylinderType T1, ValidSpherocylinderType T2>
constexpr bool is_approx_close (const T1 &sc1, const T2 &sc2, typename T1::value_type tol=get_relaxed_comparison_tolerance< typename T1::value_type, typename T2::value_type >())
 Element-wise approximate equality (within a relaxed tolerance).
template<ValidSpherocylinderType SpherocylinderType>
std::ostream & operator<< (std::ostream &os, const SpherocylinderType &spherocylinder)
 OStream operator.
Non-member functions for ValidSpherocylinderSegmentType objects
template<ValidSpherocylinderSegmentType T1, ValidSpherocylinderSegmentType T2>
constexpr bool is_close (const T1 &scs1, const T2 &scs2, typename T1::value_type tol=get_comparison_tolerance< typename T1::value_type, typename T2::value_type >())
 Element-wise approximate equality (within a tolerance).
template<ValidSpherocylinderSegmentType T1, ValidSpherocylinderSegmentType T2>
constexpr bool is_approx_close (const T1 &scs1, const T2 &scs2, typename T1::value_type tol=get_relaxed_comparison_tolerance< typename T1::value_type, typename T2::value_type >())
 Element-wise approximate equality (within a relaxed tolerance).
template<ValidSpherocylinderSegmentType SpherocylinderSegmentType>
std::ostream & operator<< (std::ostream &os, const SpherocylinderSegmentType &spherocylinder_segment)
 OStream operator.
Non-member functions for ValidVSegmentType objects
template<ValidVSegmentType T1, ValidVSegmentType T2>
constexpr bool is_close (const T1 &vs1, const T2 &vs2, typename T1::value_type tol=get_comparison_tolerance< typename T1::value_type, typename T2::value_type >())
 Element-wise approximate equality (within a tolerance).
template<ValidVSegmentType T1, ValidVSegmentType T2>
constexpr bool is_approx_close (const T1 &vs1, const T2 &vs2, typename T1::value_type tol=get_relaxed_comparison_tolerance< typename T1::value_type, typename T2::value_type >())
 Element-wise approximate equality (within a relaxed tolerance).
template<ValidVSegmentType VSegmentType>
std::ostream & operator<< (std::ostream &os, const VSegmentType &v_segment)
 OStream operator.
Translate
template<ValidPointType PointT, ValidVector3Type Vector3T>
auto translate (const PointT &point, const Vector3T &disp)
 Translate a point by a given displacement vector.
template<ValidPointType PointT, ValidVector3Type Vector3T>
void translate_inplace (PointT &point, const Vector3T &disp)
 Translate a point by a given displacement vector (inplace).
template<ValidLineType LineT, ValidVector3Type Vector3T>
auto translate (const LineT &line, const Vector3T &disp)
 Translate a line by a given displacement vector.
template<ValidLineType LineT, ValidVector3Type Vector3T>
void translate_inplace (LineT &line, const Vector3T &disp)
 Translate a line by a given displacement vector (inplace).
template<ValidLineSegmentType LineSegmentT, ValidVector3Type Vector3T>
auto translate (const LineSegmentT &line_segment, const Vector3T &disp)
 Translate a line segment by a given displacement vector.
template<ValidLineSegmentType LineSegmentT, ValidVector3Type Vector3T>
void translate_inplace (LineSegmentT &line_segment, const Vector3T &disp)
 Translate a line segment by a given displacement vector (inplace).
template<ValidVSegmentType VSegmentT, ValidVector3Type Vector3T>
auto translate (const VSegmentT &v_segment, const Vector3T &disp)
 Translate a v-segment by a given displacement vector.
template<ValidVSegmentType VSegmentT, ValidVector3Type Vector3T>
void translate_inplace (VSegmentT &v_segment, const Vector3T &disp)
 Translate a v-segment by a given displacement vector (inplace).
template<ValidCircle3DType Circle3DT, ValidVector3Type Vector3T>
auto translate (const Circle3DT &circle, const Vector3T &disp)
 Translate a circle3D by a given displacement vector.
template<ValidCircle3DType Circle3DT, ValidVector3Type Vector3T>
void translate_inplace (Circle3DT &circle, const Vector3T &disp)
 Translate a circle3D by a given displacement vector (inplace).
template<ValidAABBType AABBT, ValidVector3Type Vector3T>
auto translate (const AABBT &aabb, const Vector3T &disp)
 Translate an AABB by a given displacement vector.
template<ValidAABBType AABBT, ValidVector3Type Vector3T>
void translate_inplace (AABBT &aabb, const Vector3T &disp)
 Translate an AABB by a given displacement vector (inplace).
template<ValidSphereType SphereT, ValidVector3Type Vector3T>
auto translate (const SphereT &sphere, const Vector3T &disp)
 Translate a sphere by a given displacement vector.
template<ValidSphereType SphereT, ValidVector3Type Vector3T>
void translate_inplace (SphereT &sphere, const Vector3T &disp)
 Translate a sphere by a given displacement vector (inplace).
template<ValidSpherocylinderType SpherocylinderT, ValidVector3Type Vector3T>
auto translate (const SpherocylinderT &spherocylinder, const Vector3T &disp)
 Translate a spherocylinder by a given displacement vector.
template<ValidSpherocylinderType SpherocylinderT, ValidVector3Type Vector3T>
void translate_inplace (SpherocylinderT &spherocylinder, const Vector3T &disp)
 Translate a spherocylinder by a given displacement vector (inplace).
template<ValidSpherocylinderSegmentType SpherocylinderSegmentT, ValidVector3Type Vector3T>
auto translate (const SpherocylinderSegmentT &spherocylinder_segment, const Vector3T &disp)
 Translate a spherocylinder segment by a given displacement vector.
template<ValidSpherocylinderSegmentType SpherocylinderSegmentT, ValidVector3Type Vector3T>
void translate_inplace (SpherocylinderSegmentT &spherocylinder_segment, const Vector3T &disp)
 Translate a spherocylinder segment by a given displacement vector (inplace).
template<ValidRingType RingT, ValidVector3Type Vector3T>
auto translate (const RingT &ring, const Vector3T &disp)
 Translate a ring by a given displacement vector.
template<ValidRingType RingT, ValidVector3Type Vector3T>
void translate_inplace (RingT &ring, const Vector3T &disp)
 Translate a ring by a given displacement vector (inplace).
template<ValidEllipsoidType EllipsoidT, ValidVector3Type Vector3T>
auto translate (const EllipsoidT &ellipsoid, const Vector3T &disp)
 Translate an ellipsoid by a given displacement vector.
template<ValidEllipsoidType EllipsoidT, ValidVector3Type Vector3T>
void translate_inplace (EllipsoidT &ellipsoid, const Vector3T &disp)
 Translate an ellipsoid by a given displacement vector (inplace).
Rotate (about the origin)
template<ValidPointType PointT, ValidQuaternionType QuaternionT>
Point< typename QuaternionT::value_type > rotate (const PointT &point, const QuaternionT &q)
 Rotate a point about the origin by a given quaternion.
template<ValidPointType PointT, ValidQuaternionType QuaternionT>
void rotate_inplace (PointT &point, const QuaternionT &q)
 Rotate a point about the origin by a given quaternion (inplace).
template<ValidLineType LineT, ValidQuaternionType QuaternionT>
Line< typename QuaternionT::value_type > rotate (const LineT &line, const QuaternionT &q)
 Rotate a line about the origin by a given quaternion.
template<ValidLineType LineT, ValidQuaternionType QuaternionT>
void rotate_inplace (LineT &line, const QuaternionT &q)
 Rotate a line about the origin by a given quaternion (inplace).
template<ValidLineSegmentType LineSegmentT, ValidQuaternionType QuaternionT>
LineSegment< typename QuaternionT::value_type > rotate (const LineSegmentT &line_segment, const QuaternionT &q)
 Rotate a line segment about the origin by a given quaternion.
template<ValidLineSegmentType LineSegmentT, ValidQuaternionType QuaternionT>
void rotate_inplace (LineSegmentT &line_segment, const QuaternionT &q)
 Rotate a line segment about the origin by a given quaternion (inplace).
template<ValidVSegmentType VSegmentT, ValidQuaternionType QuaternionT>
VSegment< typename QuaternionT::value_type > rotate (const VSegmentT &v_segment, const QuaternionT &q)
 Rotate a v-segment about the origin by a given quaternion.
template<ValidVSegmentType VSegmentT, ValidQuaternionType QuaternionT>
void rotate_inplace (VSegmentT &v_segment, const QuaternionT &q)
 Rotate a v-segment about the origin by a given quaternion (inplace).
template<ValidCircle3DType Circle3DT, ValidQuaternionType QuaternionT>
Circle3D< typename QuaternionT::value_type > rotate (const Circle3DT &circle, const QuaternionT &q)
 Rotate a circle3D about the origin by a given quaternion.
template<ValidCircle3DType Circle3DT, ValidQuaternionType QuaternionT>
void rotate_inplace (Circle3DT &circle, const QuaternionT &q)
 Rotate a circle3D about the origin by a given quaternion (inplace).
template<ValidAABBType AABBT, ValidQuaternionType QuaternionT>
AABB< typename QuaternionT::value_type > rotate (const AABBT &aabb, const QuaternionT &q)
 Rotate an AABB about the origin by a given quaternion.
template<ValidAABBType AABBT, ValidQuaternionType QuaternionT>
void rotate_inplace (AABBT &aabb, const QuaternionT &q)
 Rotate an AABB about the origin by a given quaternion (inplace).
template<ValidSphereType SphereT, ValidQuaternionType QuaternionT>
Sphere< typename QuaternionT::value_type > rotate (const SphereT &sphere, const QuaternionT &q)
 Rotate a sphere about the origin by a given quaternion.
template<ValidSphereType SphereT, ValidQuaternionType QuaternionT>
void rotate_inplace (SphereT &sphere, const QuaternionT &q)
 Rotate a sphere about the origin by a given quaternion (inplace).
template<ValidSpherocylinderType SpherocylinderT, ValidQuaternionType QuaternionT>
Spherocylinder< typename QuaternionT::value_type > rotate (const SpherocylinderT &spherocylinder, const QuaternionT &q)
 Rotate a spherocylinder about the origin by a given quaternion.
template<ValidSpherocylinderType SpherocylinderT, ValidQuaternionType QuaternionT>
void rotate_inplace (SpherocylinderT &spherocylinder, const QuaternionT &q)
 Rotate a spherocylinder about the origin by a given quaternion (inplace).
template<ValidSpherocylinderSegmentType SpherocylinderSegmentT, ValidQuaternionType QuaternionT>
SpherocylinderSegment< typename QuaternionT::value_type > rotate (const SpherocylinderSegmentT &spherocylinder_segment, const QuaternionT &q)
 Rotate a spherocylinder segment about the origin by a given quaternion.
template<ValidSpherocylinderSegmentType SpherocylinderSegmentT, ValidQuaternionType QuaternionT>
void rotate_inplace (SpherocylinderSegmentT &spherocylinder_segment, const QuaternionT &q)
 Rotate a spherocylinder segment about the origin by a given quaternion (inplace).
template<ValidRingType RingT, ValidQuaternionType QuaternionT>
Ring< typename QuaternionT::value_type > rotate (const RingT &ring, const QuaternionT &q)
 Rotate a ring about the origin by a given quaternion.
template<ValidRingType RingT, ValidQuaternionType QuaternionT>
void rotate_inplace (RingT &ring, const QuaternionT &q)
 Rotate a ring about the origin by a given quaternion (inplace).
template<ValidEllipsoidType EllipsoidT, ValidQuaternionType QuaternionT>
Ellipsoid< typename QuaternionT::value_type > rotate (const EllipsoidT &ellipsoid, const QuaternionT &q)
 Rotate an ellipsoid about the origin by a given quaternion.
template<ValidEllipsoidType EllipsoidT, ValidQuaternionType QuaternionT>
void rotate_inplace (EllipsoidT &ellipsoid, const QuaternionT &q)
 Rotate an ellipsoid about the origin by a given quaternion (inplace).

Variables

template<typename T>
static constexpr bool has_tag_type_v = has_tag_type<T>::value
template<typename... Ts>
static constexpr bool all_have_tags_v = all_have_tags<Ts...>::value
template<typename... Ts>
static constexpr bool all_tags_unique_v = all_tags_unique<Ts...>::value
template<typename Tag, typename... Ts>
static constexpr bool contains_tag_v = contains_tag<Tag, Ts...>::value
template<typename Tag, typename... Ts>
static constexpr size_t index_of_tag_v = index_of_tag<Tag, Ts...>::value
template<class T>
static constexpr bool is_reference_wrapper_v = is_reference_wrapper<T>::value
template<typename T>
constexpr bool is_char_array_v = is_char_array<std::remove_cvref_t<T>>::value
template<typename T>
constexpr bool is_string_literal_v = is_string_literal<std::remove_cvref_t<T>>::value
template<typename T>
constexpr bool is_our_string_literal_v = is_our_string_literal<std::remove_cvref_t<T>>::value
template<typename T>
constexpr bool is_string_literal_sink_v = is_string_literal_sink<std::remove_cvref_t<T>>::value
template<typename T>
constexpr bool is_string_sink_v = is_string_sink<std::remove_cvref_t<T>>::value
template<class T>
static constexpr size_t tuple_size_v = tuple_size<T>::value
template<class T, class... Ts>
static constexpr bool contains_type_v = contains_type<T, Ts...>::value
template<class T, class... Types>
static constexpr size_t count_type_v = count_type<T, Types...>::value
template<class T, class... Ts>
static constexpr size_t index_finder_v = index_finder<T, Ts...>::value
template<typename T>
constexpr auto mundy_infinity_v = Kokkos::Experimental::infinity_v<passive_scalar_t<T>>
template<typename T>
constexpr auto mundy_epsilon_v = Kokkos::Experimental::epsilon_v<passive_scalar_t<T>>
template<typename T>
constexpr auto mundy_norm_min_v = Kokkos::Experimental::norm_min_v<passive_scalar_t<T>>
template<typename TypeToCheck>
constexpr bool is_matrix_v = is_matrix<TypeToCheck>::value
template<typename TypeToCheck>
constexpr bool is_quaternion_v = is_quaternion<TypeToCheck>::value
template<typename TypeToCheck>
constexpr bool is_scalar_wrapper_v = is_scalar_v<TypeToCheck>
template<typename TypeToCheck>
constexpr bool is_vector_v = is_vector<TypeToCheck>::value
template<typename T>
constexpr bool is_aabb_v = is_aabb<T>::value
template<typename T>
constexpr bool is_circle3d_v = is_circle3d<T>::value
template<typename T>
constexpr bool is_ellipsoid_v = is_ellipsoid<T>::value
template<typename T>
constexpr bool is_line_v = is_line<T>::value
template<typename T>
constexpr bool is_line_segment_v = is_line_segment<T>::value
template<typename T>
constexpr bool is_obb_v = is_obb<T>::value
template<typename T>
constexpr bool is_point_v = is_point<T>::value
template<typename T>
constexpr bool is_ring_v = is_ring<T>::value
template<typename T>
constexpr bool is_sphere_v = is_sphere<T>::value
template<typename T>
constexpr bool is_spherocylinder_v = is_spherocylinder<T>::value
template<typename T>
constexpr bool is_spherocylinder_segment_v = is_spherocylinder_segment<T>::value
template<typename T>
constexpr bool is_finite_v = is_finite<T>::value
template<typename T>
constexpr bool is_v_segment_v = is_v_segment<T>::value
template<typename T>
constexpr bool is_ball_joint_v = is_ball_joint<T>::value
template<typename T>
constexpr bool is_fene_spring_v = is_fene_spring<T>::value
template<typename T>
constexpr bool is_hookean_spring_v = is_hookean_spring<T>::value
template<typename T>
constexpr bool is_torsional_spring_v = is_torsional_spring<T>::value
Axis bitmask constants
constexpr unsigned AXIS_X = 0b001u
 Bitmask selecting the X axis (or first lattice vector).
constexpr unsigned AXIS_Y = 0b010u
 Bitmask selecting the Y axis (or second lattice vector).
constexpr unsigned AXIS_Z = 0b100u
 Bitmask selecting the Z axis (or third lattice vector).
constexpr unsigned AXIS_XY = AXIS_X | AXIS_Y
constexpr unsigned AXIS_XZ = AXIS_X | AXIS_Z
constexpr unsigned AXIS_YZ = AXIS_Y | AXIS_Z
constexpr unsigned AXIS_XYZ = AXIS_X | AXIS_Y | AXIS_Z
Metric type traits

Compile-time predicates that classify concrete metric types. These traits are defined here alongside the metric classes so that any code working with metrics can branch on their structural properties without inspecting member names or relying on ad-hoc partial specialisations elsewhere.

Primary templates evaluate to false_type; explicit specialisations below opt each metric family in to the appropriate trait.

template<typename T>
constexpr bool is_free_space_metric_v = is_free_space_metric<T>::value
template<typename T>
constexpr bool is_orthorhombic_metric_v = is_orthorhombic_metric<T>::value
template<typename T>
constexpr bool is_triclinic_metric_v = is_triclinic_metric<T>::value
template<typename T>
constexpr bool is_periodic_metric_v = is_periodic_metric<T>::value

Non-member functions

template<size_t I, typename VarAggType>
using variant_aggregate_tag_t = variant_aggregate_tag<I, VarAggType>::type
template<size_t J, class VariantType>
using variant_alternative_t = typename VariantType::template alternative_t<J>
 Get the J'th alternative type TODO(palmerb4): Make independent of concrete variant instance.
template<typename Tag, typename VarAggType>
static constexpr bool variant_aggregate_has_v = variant_aggregate_has<Tag, VarAggType>::value
template<class T>
static constexpr size_t variant_size_v = variant_size<T>::value
template<typename VariantType>
auto make_runtime_aggregate ()
 Canonical way to construct a runtime_aggregate.
template<typename VariantType>
constexpr auto make_variant_aggregate ()
 Canonical way to construct a variant_aggregate.
template<typename Tag, typename VariantType, typename... Tags>
constexpr const VariantType & get (const variant_aggregate< VariantType, Tags... > &v_agg)
 Fetch the variant corresponding to the given Tag.
template<typename Tag, typename VariantType, typename... Tags>
constexpr VariantType & get (variant_aggregate< VariantType, Tags... > &v_agg)
 Fetch the variant corresponding to the given Tag.
template<size_t I, typename VariantType, typename... Tags>
constexpr const VariantType & get (const variant_aggregate< VariantType, Tags... > &v_agg)
 Fetch the variant at index I.
template<size_t I, typename VariantType, typename... Tags>
constexpr VariantType & get (variant_aggregate< VariantType, Tags... > &v_agg)
template<typename Tag, typename VariantType, typename... Tags>
constexpr bool has (const variant_aggregate< VariantType, Tags... > &)
 Check if a variant_aggregate has a variant with the given Tag.
template<typename... SelectedTags, typename VariantType, typename... Tags>
constexpr auto project (variant_aggregate< VariantType, Tags... > &v_agg)
 Project selected tags from a variant_aggregate into a new variant_aggregate. Copies the corresponding variants and preserves the requested tag order.
template<typename... SelectedTags, typename VariantType, typename... Tags>
constexpr auto project (const variant_aggregate< VariantType, Tags... > &v_agg)
 Project selected tags from a const variant_aggregate into a new variant_aggregate. Copies the corresponding variants and preserves the requested tag order.
template<class T, class... Alts>
constexpr size_t index_of ()
 Get the index of the given type.
template<class T, class... Alts>
constexpr bool holds_alternative (const variant< Alts... > &var)
 Check if a specific type is active.
template<class T, class... Alts>
constexpr T & get (variant< Alts... > &var)
 Get the value of the active type.
template<class T, class... Alts>
constexpr const T & get (const variant< Alts... > &var)
template<size_t ActiveIdx, class... Alts>
constexpr auto & get (variant< Alts... > &var)
 Get the value of the active type based on the active index.
template<size_t ActiveIdx, class... Alts>
constexpr const auto & get (const variant< Alts... > &var)
template<class Visitor, class... Alts>
constexpr decltype(auto) visit (Visitor &&visitor, variant< Alts... > &var)
 Visit the active value in the variant.
template<class Visitor, class... Alts>
constexpr decltype(auto) visit (Visitor &&visitor, const variant< Alts... > &var)

Non-member functions/helpers

template<size_t I, typename AggType>
using aggregate_tag_t = aggregate_tag<I, AggType>::type
template<typename Tag, typename AggType>
static constexpr bool aggregate_has_v = aggregate_has<Tag, AggType>::value
template<typename... Tags, typename... Ts>
constexpr auto project (aggregate< Ts... > &agg)
 Project selected tags from an aggregate into a new aggregate (copies their corresponding components).
template<typename... Tags, typename... Ts>
constexpr auto project (const aggregate< Ts... > &agg)
 Project selected tags from a const aggregate into a new aggregate (copies their corresponding components).
template<typename Tag, typename... Ts>
constexpr const auto & get (const aggregate< Ts... > &agg)
 Fetch the value corresponding to the given Tag.
template<typename Tag, typename... Ts>
constexpr auto & get (aggregate< Ts... > &agg)
 Fetch the value corresponding to the given Tag.
template<size_t I, typename... Ts>
constexpr const auto & get (const aggregate< Ts... > &agg)
 Fetch the value at index I.
template<size_t I, typename... Ts>
constexpr auto & get (aggregate< Ts... > &agg)
template<typename Tag, typename... Ts>
constexpr bool has (const aggregate< Ts... > &)
 Check if an aggregate have a value with the given Tag.
template<typename... Ts>
std::ostream & operator<< (std::ostream &os, const aggregate< Ts... > &agg)
 Overload the stream operator for aggregates.

Forward declare AQuaternion functions that also require AQuaternion to be defined

template<typename T>
using Quaternion = AQuaternion<T, Array<T, 4>>
 Type alias for a quaternion with the default accessor.
template<typename T, ValidAccessor< T > Accessor>
constexpr auto norm (const AQuaternion< T, Accessor > &quat)
 Get the norm of a quaternion.

AScalar type traits

template<typename T>
using Scalar = AScalar<T, Array<T, 1>>
 Owning scalar with the default Array<T,1> accessor.
template<typename TypeToCheck>
constexpr bool is_scalar_v = is_scalar<TypeToCheck>::value

Type specializations

Atomic v[i] += s (returns new v)

Atomic v[i] -= s (returns new v)

Atomic v[i] *= s (returns new v)

Atomic v[i] /= s (returns new v)

Atomic v1[i] += v2[i] (returns new v1)

Atomic v1[i] -= v2[i] (returns new v1)

Atomic v1[i] *= v2[i] (returns new v1)

Atomic v1[i] /= v2[i] (returns new v1)

 matrix1
 matrix3
 matrix5
 matrix1f
 float
 matrix3f
 matrix5f
 matrix1d
 double
 matrix3d
 matrix5d
 matrix1i
 int
 matrix3i
 matrix5i
 quaternionf
 vector1
 vector3
 vector5
 vector1d
 vector3d
 vector5d
 vector1f
 vector3f
 vector5f
 vector1i
 vector3i
 vector5i
 MUNDY_MATH_MATRIX_EXPAND_1_TO_6_2D (MUNDY_MATH_MATRIX_SIZE_SPECIALIZATION) MUNDY_MATH_MATRIX_EXPAND_1_TO_6_2D(MUNDY_MATH_MATRIX_TYPE_AND_SIZE_SPECIALIZATION_FLOAT_DOUBLE) MUNDY_MATH_MATRIX_SIZE_SPECIALIZATION_IMPL(Matrix1
 AMatrix specializations.
 MUNDY_MATH_MATRIX_SIZE_SPECIALIZATION_IMPL (Matrix2, matrix2, 2, 2) MUNDY_MATH_MATRIX_SIZE_SPECIALIZATION_IMPL(Matrix3
 MUNDY_MATH_MATRIX_SIZE_SPECIALIZATION_IMPL (Matrix4, matrix4, 4, 4) MUNDY_MATH_MATRIX_SIZE_SPECIALIZATION_IMPL(Matrix5
 MUNDY_MATH_MATRIX_SIZE_SPECIALIZATION_IMPL (Matrix6, matrix6, 6, 6) MUNDY_MATH_MATRIX_TYPE_AND_SIZE_SPECIALIZATION_IMPL(Matrix1f
 MUNDY_MATH_MATRIX_TYPE_AND_SIZE_SPECIALIZATION_IMPL (Matrix2f, matrix2f, float, 2, 2) MUNDY_MATH_MATRIX_TYPE_AND_SIZE_SPECIALIZATION_IMPL(Matrix3f
 MUNDY_MATH_MATRIX_TYPE_AND_SIZE_SPECIALIZATION_IMPL (Matrix4f, matrix4f, float, 4, 4) MUNDY_MATH_MATRIX_TYPE_AND_SIZE_SPECIALIZATION_IMPL(Matrix5f
 MUNDY_MATH_MATRIX_TYPE_AND_SIZE_SPECIALIZATION_IMPL (Matrix6f, matrix6f, float, 6, 6) MUNDY_MATH_MATRIX_TYPE_AND_SIZE_SPECIALIZATION_IMPL(Matrix1d
 MUNDY_MATH_MATRIX_TYPE_AND_SIZE_SPECIALIZATION_IMPL (Matrix2d, matrix2d, double, 2, 2) MUNDY_MATH_MATRIX_TYPE_AND_SIZE_SPECIALIZATION_IMPL(Matrix3d
 MUNDY_MATH_MATRIX_TYPE_AND_SIZE_SPECIALIZATION_IMPL (Matrix4d, matrix4d, double, 4, 4) MUNDY_MATH_MATRIX_TYPE_AND_SIZE_SPECIALIZATION_IMPL(Matrix5d
 MUNDY_MATH_MATRIX_TYPE_AND_SIZE_SPECIALIZATION_IMPL (Matrix6d, matrix6d, double, 6, 6) MUNDY_MATH_MATRIX_TYPE_AND_SIZE_SPECIALIZATION_IMPL(Matrix1i
 MUNDY_MATH_MATRIX_TYPE_AND_SIZE_SPECIALIZATION_IMPL (Matrix2i, matrix2i, int, 2, 2) MUNDY_MATH_MATRIX_TYPE_AND_SIZE_SPECIALIZATION_IMPL(Matrix3i
 MUNDY_MATH_MATRIX_TYPE_AND_SIZE_SPECIALIZATION_IMPL (Matrix4i, matrix4i, int, 4, 4) MUNDY_MATH_MATRIX_TYPE_AND_SIZE_SPECIALIZATION_IMPL(Matrix5i
 MUNDY_MATH_QUATERNION_TYPE_SPECIALIZATION (Quaterniond, quaterniond, double) MUNDY_MATH_QUATERNION_TYPE_SPECIALIZATION(Quaternionf
 MUNDY_MATH_VECTOR_SIZE_SPECIALIZATION (Vector2, vector2, 2) MUNDY_MATH_VECTOR_SIZE_SPECIALIZATION(Vector3
 MUNDY_MATH_VECTOR_SIZE_SPECIALIZATION (Vector4, vector4, 4) MUNDY_MATH_VECTOR_SIZE_SPECIALIZATION(Vector5
 MUNDY_MATH_VECTOR_SIZE_SPECIALIZATION (Vector6, vector6, 6) MUNDY_MATH_VECTOR_TYPE_AND_SIZE_SPECIALIZATION(Vector1d
 MUNDY_MATH_VECTOR_TYPE_AND_SIZE_SPECIALIZATION (Vector2d, vector2d, double, 2) MUNDY_MATH_VECTOR_TYPE_AND_SIZE_SPECIALIZATION(Vector3d
 MUNDY_MATH_VECTOR_TYPE_AND_SIZE_SPECIALIZATION (Vector4d, vector4d, double, 4) MUNDY_MATH_VECTOR_TYPE_AND_SIZE_SPECIALIZATION(Vector5d
 MUNDY_MATH_VECTOR_TYPE_AND_SIZE_SPECIALIZATION (Vector6d, vector6d, double, 6) MUNDY_MATH_VECTOR_TYPE_AND_SIZE_SPECIALIZATION(Vector1f
 MUNDY_MATH_VECTOR_TYPE_AND_SIZE_SPECIALIZATION (Vector2f, vector2f, float, 2) MUNDY_MATH_VECTOR_TYPE_AND_SIZE_SPECIALIZATION(Vector3f
 MUNDY_MATH_VECTOR_TYPE_AND_SIZE_SPECIALIZATION (Vector4f, vector4f, float, 4) MUNDY_MATH_VECTOR_TYPE_AND_SIZE_SPECIALIZATION(Vector5f
 MUNDY_MATH_VECTOR_TYPE_AND_SIZE_SPECIALIZATION (Vector6f, vector6f, float, 6) MUNDY_MATH_VECTOR_TYPE_AND_SIZE_SPECIALIZATION(Vector1i
 MUNDY_MATH_VECTOR_TYPE_AND_SIZE_SPECIALIZATION (Vector2i, vector2i, int, 2) MUNDY_MATH_VECTOR_TYPE_AND_SIZE_SPECIALIZATION(Vector3i
 MUNDY_MATH_VECTOR_TYPE_AND_SIZE_SPECIALIZATION (Vector4i, vector4i, int, 4) MUNDY_MATH_VECTOR_TYPE_AND_SIZE_SPECIALIZATION(Vector5i

AMatrix<T, Accessor> views

size_t N
size_t size_t M
size_t size_t ValidAccessor< T > Accessor constexpr auto get_matrix_view (Accessor &&data)
template<typename T, size_t N, size_t M, ValidAccessor< T > Accessor>
constexpr auto get_owning_matrix (Accessor &&data)

Typedef Documentation

◆ variant_aggregate_tag_t

template<size_t I, typename VarAggType>
using mundy::variant_aggregate_tag_t = variant_aggregate_tag<I, VarAggType>::type

◆ aggregate_tag_t

template<size_t I, typename AggType>
using mundy::aggregate_tag_t = aggregate_tag<I, AggType>::type

◆ NgpPool

template<class DataType, typename SizeType = size_t>
using mundy::NgpPool = NgpPoolT<DataType, typename Kokkos::DefaultExecutionSpace::memory_space, SizeType>

Unlike NgpPoolT, we follow stk::ngp conventions by using Kokkos::DefaultExecutionSpace as our chosen device space.

◆ NgpView

template<class DataType, class... Properties>
using mundy::NgpView = NgpViewT<DataType, Properties..., typename Kokkos::DefaultExecutionSpace::memory_space>

Unlike NgpViewT, we follow stk::ngp conventions by using Kokkos::DefaultExecutionSpace as our chosen device space.

◆ tuple_element_t

template<size_t I, class T>
using mundy::tuple_element_t = typename tuple_element<I, T>::type

◆ tuple_cat_t

template<typename... input_t>
using mundy::tuple_cat_t = decltype(tuple_cat(std::declval<input_t>()...))

◆ type_at_index_t

template<size_t I, class... Ts>
using mundy::type_at_index_t = typename type_at_index<I, Ts...>::type

◆ variant_alternative_t

template<size_t J, class VariantType>
using mundy::variant_alternative_t = typename VariantType::template alternative_t<J>

◆ accessor_underlying_type_t

template<typename Accessor>
using mundy::accessor_underlying_type_t = impl::accessor_underlying_type_t<Accessor>

◆ passive_scalar_t

template<typename T>
using mundy::passive_scalar_t = typename passive_scalar<T>::type

◆ Matrix

template<typename T, size_t N, size_t M>
using mundy::Matrix = AMatrix<T, N, M, Array<T, N * M>>

◆ Quaternion

template<typename T>
using mundy::Quaternion = AQuaternion<T, Array<T, 4>>

◆ Scalar

template<typename T>
using mundy::Scalar = AScalar<T, Array<T, 1>>

◆ ScalarWrapper

template<typename T, ValidAccessor< T > Accessor = Array<T, 1>>
using mundy::ScalarWrapper = AScalar<T, Accessor>

◆ Vector

template<typename T, size_t N>
using mundy::Vector = AVector<T, N, Array<T, N>>

Function Documentation

◆ apply_tag()

template<typename Tag, typename T>
auto mundy::apply_tag ( T && value)
constexpr

◆ make_runtime_aggregate()

template<typename VariantType>
auto mundy::make_runtime_aggregate ( )

◆ make_variant_aggregate()

template<typename VariantType>
auto mundy::make_variant_aggregate ( )
constexpr

◆ get() [1/16]

template<typename Tag, typename VariantType, typename... Tags>
const VariantType & mundy::get ( const variant_aggregate< VariantType, Tags... > & v_agg)
constexpr

◆ get() [2/16]

template<typename Tag, typename VariantType, typename... Tags>
VariantType & mundy::get ( variant_aggregate< VariantType, Tags... > & v_agg)
constexpr

◆ get() [3/16]

template<size_t I, typename VariantType, typename... Tags>
const VariantType & mundy::get ( const variant_aggregate< VariantType, Tags... > & v_agg)
constexpr

◆ get() [4/16]

template<size_t I, typename VariantType, typename... Tags>
VariantType & mundy::get ( variant_aggregate< VariantType, Tags... > & v_agg)
constexpr

◆ has() [1/2]

template<typename Tag, typename VariantType, typename... Tags>
bool mundy::has ( const variant_aggregate< VariantType, Tags... > & )
constexpr

◆ project() [1/4]

template<typename... SelectedTags, typename VariantType, typename... Tags>
auto mundy::project ( variant_aggregate< VariantType, Tags... > & v_agg)
constexpr

◆ project() [2/4]

template<typename... SelectedTags, typename VariantType, typename... Tags>
auto mundy::project ( const variant_aggregate< VariantType, Tags... > & v_agg)
constexpr

◆ project() [3/4]

template<typename... Tags, typename... Ts>
auto mundy::project ( aggregate< Ts... > & agg)
constexpr

◆ project() [4/4]

template<typename... Tags, typename... Ts>
auto mundy::project ( const aggregate< Ts... > & agg)
constexpr

◆ get() [5/16]

template<typename Tag, typename... Ts>
const auto & mundy::get ( const aggregate< Ts... > & agg)
constexpr

◆ get() [6/16]

template<typename Tag, typename... Ts>
auto & mundy::get ( aggregate< Ts... > & agg)
constexpr

◆ get() [7/16]

template<size_t I, typename... Ts>
const auto & mundy::get ( const aggregate< Ts... > & agg)
constexpr

◆ get() [8/16]

template<size_t I, typename... Ts>
auto & mundy::get ( aggregate< Ts... > & agg)
constexpr

◆ has() [2/2]

template<typename Tag, typename... Ts>
bool mundy::has ( const aggregate< Ts... > & )
constexpr

◆ operator<<() [1/12]

template<typename... Ts>
std::ostream & mundy::operator<< ( std::ostream & os,
const aggregate< Ts... > & agg )

◆ do_not_optimize_away()

template<typename Arg>
void mundy::do_not_optimize_away ( Arg && arg)
Template Parameters
ArgType of the argument that shouldn't be optimized away.
Parameters
argThe input that we mark as being used, even though we don't do anything with it.

◆ make_host_ptr()

template<typename T, typename... Args>
host_ptr< T > mundy::make_host_ptr ( Args &&... args)

◆ swap()

template<typename T>
void mundy::swap ( host_ptr< T > & lhs,
host_ptr< T > & rhs )
noexcept

◆ static_pointer_cast()

template<typename U, typename T>
host_ptr< U > mundy::static_pointer_cast ( const host_ptr< T > & ptr)
noexcept

◆ dynamic_pointer_cast()

template<typename U, typename T>
host_ptr< U > mundy::dynamic_pointer_cast ( const host_ptr< T > & ptr)
noexcept

◆ const_pointer_cast()

template<typename U, typename T>
host_ptr< U > mundy::const_pointer_cast ( const host_ptr< T > & ptr)
noexcept

◆ reinterpret_pointer_cast()

template<typename U, typename T>
host_ptr< U > mundy::reinterpret_pointer_cast ( const host_ptr< T > & ptr)
noexcept

◆ operator==() [1/3]

template<typename T>
bool mundy::operator== ( const host_ptr< T > & lhs,
const host_ptr< T > & rhs )
noexcept

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

template<typename T>
std::strong_ordering mundy::operator<=> ( const host_ptr< T > & lhs,
const host_ptr< T > & rhs )
noexcept

◆ operator==() [2/3]

template<typename T>
bool mundy::operator== ( const host_ptr< T > & ptr,
std::nullptr_t  )
noexcept

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

template<typename T>
std::strong_ordering mundy::operator<=> ( const host_ptr< T > & ptr,
std::nullptr_t  )
noexcept

◆ reference_wrapper()

template<class T>
mundy::reference_wrapper ( T & ) -> reference_wrapper< T >

◆ ref() [1/2]

template<class T>
auto mundy::ref ( T && t) -> reference_wrapper< std::remove_reference_t< T > >
constexprnoexcept

◆ ref() [2/2]

template<class T>
reference_wrapper< T > mundy::ref ( reference_wrapper< T > t)
constexprnoexcept

◆ cref() [1/3]

template<class T>
auto mundy::cref ( T && t) -> reference_wrapper< const std::remove_reference_t< T > >
constexprnoexcept

◆ cref() [2/3]

template<class T>
reference_wrapper< const T > mundy::cref ( reference_wrapper< T > t)
constexprnoexcept

◆ cref() [3/3]

template<class T>
reference_wrapper< const T > mundy::cref ( reference_wrapper< const T > t)
constexprnoexcept

◆ make_philox()

openrand::Philox mundy::make_philox ( size_t seed,
size_t counter )

◆ storage()

template<class T>
mundy::storage ( T && ) -> storage< T >

◆ store()

template<class T>
auto mundy::store ( T && value) -> storage< impl::store_input_type_t< T > >
constexprnoexcept

◆ operator==() [3/3]

template<size_t N>
bool mundy::operator== ( const StringLiteral< N > & lhs,
const StringLiteral< N > & rhs )
constexpr
Parameters
lhsThe left-hand side of the comparison
rhsThe right-hand side of the comparison

◆ operator<<() [2/12]

template<size_t N>
std::ostream & mundy::operator<< ( std::ostream & os,
const StringLiteral< N > & str )
Parameters
osThe output stream to print to
strThe StringLiteral to print

◆ make_string_literal()

template<size_t N>
StringLiteral< N > mundy::make_string_literal ( const char(&) str[N])
constexpr

This function is used to create a StringLiteral without having to specify the template parameters.

Parameters
strThe string literal to copy
Returns
A StringLiteral with the same content as the input string literal

◆ sink()

SinkStart mundy::sink ( )
constexpr

◆ operator<<() [3/12]

template<impl::RuntimeSinkChunk T>
auto mundy::operator<< ( SinkStart ,
T && rhs )
constexpr

◆ operator<<() [4/12]

template<size_t N>
auto mundy::operator<< ( SinkStart ,
const char(&) rhs[N] )
constexpr

◆ operator<<() [5/12]

template<size_t N>
auto mundy::operator<< ( SinkStart ,
const StringLiteral< N > & rhs )
constexpr

◆ operator<<() [6/12]

template<size_t N>
std::ostream & mundy::operator<< ( std::ostream & os,
const StringLiteralSink< N > & sink_to_print )

◆ operator<<() [7/12]

template<typename... Chunks>
std::ostream & mundy::operator<< ( std::ostream & os,
const StringSink< Chunks... > & sink_to_print )

◆ get_throw_require_host_string() [1/4]

template<size_t AssertionStringSize, size_t FileStringSize, size_t LineStringSize>
std::string mundy::get_throw_require_host_string ( const StringLiteral< AssertionStringSize > & assertion_string,
const std::string & message_to_print,
const StringLiteral< FileStringSize > & file_string = make_string_literal("/home/runner/work/MuNDy/MuNDy/mundy/core/utils/src/mundy_utils/throw_assert.hpp"),
const StringLiteral< LineStringSize > & line_string = make_string_literal(MUNDY_LINE_STRING) )

◆ get_throw_require_host_string() [2/4]

template<size_t AssertionStringSize, size_t MessageStringSize, size_t FileStringSize, size_t LineStringSize>
std::string mundy::get_throw_require_host_string ( const StringLiteral< AssertionStringSize > & assertion_string,
const char(&) message_to_print[MessageStringSize],
const StringLiteral< FileStringSize > & file_string = make_string_literal("/home/runner/work/MuNDy/MuNDy/mundy/core/utils/src/mundy_utils/throw_assert.hpp"),
const StringLiteral< LineStringSize > & line_string = make_string_literal(MUNDY_LINE_STRING) )

◆ get_throw_require_host_string() [3/4]

template<size_t AssertionStringSize, size_t MessageStringSize, size_t FileStringSize, size_t LineStringSize>
std::string mundy::get_throw_require_host_string ( const StringLiteral< AssertionStringSize > & assertion_string,
const StringLiteral< MessageStringSize > & message_to_print,
const StringLiteral< FileStringSize > & file_string = make_string_literal("/home/runner/work/MuNDy/MuNDy/mundy/core/utils/src/mundy_utils/throw_assert.hpp"),
const StringLiteral< LineStringSize > & line_string = make_string_literal(MUNDY_LINE_STRING) )

◆ get_throw_require_host_string() [4/4]

template<size_t AssertionStringSize, AnyStringSink MessageStringType, size_t FileStringSize, size_t LineStringSize>
std::string mundy::get_throw_require_host_string ( const StringLiteral< AssertionStringSize > & assertion_string,
const MessageStringType & message_to_print,
const StringLiteral< FileStringSize > & file_string = make_string_literal("/home/runner/work/MuNDy/MuNDy/mundy/core/utils/src/mundy_utils/throw_assert.hpp"),
const StringLiteral< LineStringSize > & line_string = make_string_literal(MUNDY_LINE_STRING) )

◆ get_throw_require_device_string() [1/3]

template<size_t AssertionStringSize, size_t MessageStringSize, size_t FileStringSize, size_t LineStringSize>
auto mundy::get_throw_require_device_string ( const StringLiteral< AssertionStringSize > & assertion_string,
const char(&) message_to_print[MessageStringSize],
const StringLiteral< FileStringSize > & file_string = make_string_literal("/home/runner/work/MuNDy/MuNDy/mundy/core/utils/src/mundy_utils/throw_assert.hpp"),
const StringLiteral< LineStringSize > & line_string = make_string_literal(MUNDY_LINE_STRING) )
constexpr

◆ get_throw_require_device_string() [2/3]

template<size_t AssertionStringSize, size_t MessageStringSize, size_t FileStringSize, size_t LineStringSize>
auto mundy::get_throw_require_device_string ( const StringLiteral< AssertionStringSize > & assertion_string,
const StringLiteral< MessageStringSize > & message_to_print,
const StringLiteral< FileStringSize > & file_string = make_string_literal("/home/runner/work/MuNDy/MuNDy/mundy/core/utils/src/mundy_utils/throw_assert.hpp"),
const StringLiteral< LineStringSize > & line_string = make_string_literal(MUNDY_LINE_STRING) )
constexpr

◆ get_throw_require_device_string() [3/3]

template<size_t AssertionStringSize, CompileTimeStringSink MessageStringType, size_t FileStringSize, size_t LineStringSize>
auto mundy::get_throw_require_device_string ( const StringLiteral< AssertionStringSize > & assertion_string,
const MessageStringType & message_to_print,
const StringLiteral< FileStringSize > & file_string = make_string_literal("/home/runner/work/MuNDy/MuNDy/mundy/core/utils/src/mundy_utils/throw_assert.hpp"),
const StringLiteral< LineStringSize > & line_string = make_string_literal(MUNDY_LINE_STRING) )
constexpr

◆ throw_require()

template<typename ExceptionType, typename MessageStringType, size_t AssertionStringSize, size_t FileStringSize, size_t LineStringSize>
void mundy::throw_require ( const bool assertion_value,
const StringLiteral< AssertionStringSize > & assertion_string,
const MessageStringType & message_to_print,
const StringLiteral< FileStringSize > & file_string = make_string_literal("/home/runner/work/MuNDy/MuNDy/mundy/core/utils/src/mundy_utils/throw_assert.hpp"),
const StringLiteral< LineStringSize > & line_string = make_string_literal(MUNDY_LINE_STRING) )
constexpr

◆ abort_require()

template<typename MessageStringType, size_t AssertionStringSize, size_t FileStringSize, size_t LineStringSize>
void mundy::abort_require ( const bool assertion_value,
const StringLiteral< AssertionStringSize > & assertion_string,
const MessageStringType & message_to_print,
const StringLiteral< FileStringSize > & file_string = make_string_literal("/home/runner/work/MuNDy/MuNDy/mundy/core/utils/src/mundy_utils/throw_assert.hpp"),
const StringLiteral< LineStringSize > & line_string = make_string_literal(MUNDY_LINE_STRING) )
constexpr

◆ get() [9/16]

template<size_t Idx, class... Args>
auto & mundy::get ( tuple< Args... > & vals)
constexpr

◆ get() [10/16]

template<size_t Idx, class... Args>
const auto & mundy::get ( const tuple< Args... > & vals)
constexpr

◆ get() [11/16]

template<class T, class... Args>
auto & mundy::get ( tuple< Args... > & vals)
constexpr

◆ get() [12/16]

template<class T, class... Args>
const auto & mundy::get ( const tuple< Args... > & vals)
constexpr

◆ tuple_cat()

template<class... FirstElements, class... SecondElements>
auto mundy::tuple_cat ( const tuple< FirstElements... > & first,
const tuple< SecondElements... > & second )
constexpr

◆ make_tuple()

template<class... Elements>
auto mundy::make_tuple ( Elements... vals)
constexpr

◆ index_of()

template<class T, class... Alts>
size_t mundy::index_of ( )
constexpr

◆ holds_alternative()

template<class T, class... Alts>
bool mundy::holds_alternative ( const variant< Alts... > & var)
constexpr

◆ get() [13/16]

template<class T, class... Alts>
T & mundy::get ( variant< Alts... > & var)
constexpr

◆ get() [14/16]

template<class T, class... Alts>
const T & mundy::get ( const variant< Alts... > & var)
constexpr

◆ get() [15/16]

template<size_t ActiveIdx, class... Alts>
auto & mundy::get ( variant< Alts... > & var)
constexpr

◆ get() [16/16]

template<size_t ActiveIdx, class... Alts>
const auto & mundy::get ( const variant< Alts... > & var)
constexpr

◆ visit() [1/2]

template<class Visitor, class... Alts>
decltype(auto) mundy::visit ( Visitor && visitor,
variant< Alts... > & var )
constexpr

◆ visit() [2/2]

template<class Visitor, class... Alts>
decltype(auto) mundy::visit ( Visitor && visitor,
const variant< Alts... > & var )
constexpr

◆ apply() [1/3]

template<typename Func, typename T, size_t N>
auto mundy::apply ( Func && func,
const Array< T, N > & array )
constexpr

◆ operator<<() [8/12]

template<typename T, size_t N>
std::ostream & mundy::operator<< ( std::ostream & os,
const Array< T, N > & a )

◆ make_quadratic_form()

template<typename Backend, class LinearOpDT, class LinearOpM, class LinearOpD>
auto mundy::make_quadratic_form ( LinearOpDT && DT,
LinearOpM && M,
LinearOpD && D )

◆ make_cqpp() [1/4]

template<typename Backend, typename LinearOp, typename QVector, convex::space::ValidConvexSpace ConvexSpace>
auto mundy::make_cqpp ( LinearOp && A,
QVector && q,
ConvexSpace && space )

◆ make_cqpp() [2/4]

template<typename Backend, typename LinearOpDT, typename LinearOpM, typename LinearOpD, typename QVector, convex::space::ValidConvexSpace ConvexSpace>
auto mundy::make_cqpp ( LinearOpDT && DT,
LinearOpM && M,
LinearOpD && D,
QVector && q,
ConvexSpace && space )

◆ make_cqpp() [3/4]

template<typename Backend, typename LinearOpDT, typename LinearOpM, typename LinearOpD, typename QVector, convex::space::ValidConvexSpace ConvexSpace, typename FVector, typename UVector>
auto mundy::make_cqpp ( LinearOpDT && DT,
LinearOpM && M,
LinearOpD && D,
QVector && q,
FVector && f,
UVector && u,
ConvexSpace && space )

◆ make_cqpp() [4/4]

template<typename Backend, typename LinearOp, typename QVector, convex::space::ValidConvexSpace ConvexSpace, typename Workspace>
auto mundy::make_cqpp ( LinearOp && A,
QVector && q,
ConvexSpace && space,
Workspace && workspace )

◆ make_lcp() [1/4]

template<typename Backend, typename LinearOp, typename QVector>
auto mundy::make_lcp ( LinearOp && A,
QVector && q )

◆ make_lcp() [2/4]

template<typename Backend, typename LinearOpDT, typename LinearOpM, typename LinearOpD, typename QVector>
auto mundy::make_lcp ( LinearOpDT && DT,
LinearOpM && M,
LinearOpD && D,
QVector && q )

◆ make_lcp() [3/4]

template<typename Backend, typename LinearOpDT, typename LinearOpM, typename LinearOpD, typename QVector, typename FVector, typename UVector>
auto mundy::make_lcp ( LinearOpDT && DT,
LinearOpM && M,
LinearOpD && D,
QVector && q,
FVector && f,
UVector && u )

◆ make_lcp() [4/4]

template<typename Backend, typename LinearOp, typename QVector, typename Workspace>
auto mundy::make_lcp ( LinearOp && A,
QVector && q,
Workspace && workspace )

◆ make_mixed_cqpp() [1/4]

template<typename Backend, typename LinearOpA, typename QVector, typename LinearOpL, typename FVector, convex::space::ValidConvexSpace ConvexSpace>
auto mundy::make_mixed_cqpp ( LinearOpA && A,
QVector && q,
LinearOpL && L,
FVector && f_b,
ConvexSpace && space )

◆ make_mixed_cqpp() [2/4]

template<typename Backend, typename LinearOpA, typename QVector, typename LinearOpL, typename FVector, convex::space::ValidConvexSpace ConvexSpace, typename AWorkspace, typename LWorkspace>
auto mundy::make_mixed_cqpp ( LinearOpA && A,
QVector && q,
LinearOpL && L,
FVector && f_b,
ConvexSpace && space,
AWorkspace && a_workspace,
LWorkspace && l_workspace )

◆ make_mixed_cqpp() [3/4]

template<typename Backend, typename LinearOpDT, typename LinearOpM, typename LinearOpD, typename QVector, typename LinearOpL, typename FVector, convex::space::ValidConvexSpace ConvexSpace>
auto mundy::make_mixed_cqpp ( LinearOpDT && DT,
LinearOpM && M,
LinearOpD && D,
QVector && q,
LinearOpL && L,
FVector && f_b,
ConvexSpace && space )

◆ make_mixed_cqpp() [4/4]

template<typename Backend, typename LinearOpDT, typename LinearOpM, typename LinearOpD, typename QVector, typename LinearOpB, typename LinearOpS, typename LinearOpBT, typename BVector, convex::space::ValidConvexSpace ConvexSpace>
auto mundy::make_mixed_cqpp ( LinearOpDT && DT,
LinearOpM && M,
LinearOpD && D,
QVector && q,
LinearOpB && B,
LinearOpS && S,
LinearOpBT && BT,
BVector && b,
ConvexSpace && space )

◆ make_pgd_solution_strategy() [1/2]

template<class StepPolicy, class ResidualPolicy, class Scalar>
auto mundy::make_pgd_solution_strategy ( StepPolicy && step_policy,
ResidualPolicy && residual_policy,
const convex::PGDConfig< Scalar > & cfg = {} )

◆ make_pgd_solution_strategy() [2/2]

template<class Scalar>
auto mundy::make_pgd_solution_strategy ( const convex::PGDConfig< Scalar > & cfg = {})

◆ make_pgd_state()

template<class XVector, class GradVector, class XTmpVector, class GradTmpVector>
auto mundy::make_pgd_state ( XVector && x,
GradVector && grad,
XTmpVector && x_tmp,
GradTmpVector && grad_tmp )

◆ solve_cqpp()

template<class Problem, class Strategy, class State>
auto mundy::solve_cqpp ( const Problem & prob,
const Strategy & strat,
State & state )
Parameters
probThe constrained quadratic programming problem to solve.
stratThe solution strategy to use.
stateThe state to use for the solution strategy, which will be modified during the solve.
Returns
The result of the solve (contents are defined by the strategy).

◆ solve_mixed_cqpp()

template<class Problem, class Strategy>
auto mundy::solve_mixed_cqpp ( const Problem & prob,
const Strategy & strat,
typename Strategy::state_t & state ) -> typename Strategy::result_t

This is for a mixed constrained convex quadratic programming problem such as: x^*, y^* = argmin_{x in Omega_x, y in R^m} q^T x + b^T y + 0.5 (Dx + By)^T M (Dx + By) + 0.5 y^T K^{-1} y where M and K^{-1} are symmetric positive definite matrices, D and B are linear operators, q and b are vectors, and Omega_x is a convex space.

This can be mapped onto a reduced CQPP in x alone via the Schur complement. Define: S^{-1} := B^T M B + K^{-1} (symmetric positive definite) H := D^T M D - D^T M B S B^T M D g := q - D^T M B S b Then the reduced CQPP is: x^* = argmin_{x in Omega_x} 0.5 x^T H x + g^T x y^* = -S^{-1}(b + B^T M D x^*)

In more general terms, the mixed problem exists because of an affine operator mapping x -> f: f = (I + L M) D x + f_b, where f_b = f(x = 0) and L is an spsd linear operator

In the less-general problem above: L = B S B^T and f_b = B S b. In this form, the reduced CQPP is: x^* = argmin_{x in Omega_x} 0.5 x^T H x + g^T x H := D^T M (D - L M D) g := q - D^T M f_b y^*, f^*, and u^* are all intermediates that may or may not be explicitly formed during the solution process depending on the structure of L. We refer to these variables as your "workspace" variables. They are updated by the linear operators during the solution process, and their final values are "committed" at the end of the solve to indicate that they are the correct values corresponding to the optimal x^*.

We may also have the simpler problem where D = I, in which case the reduced CQPP is: x^* = argmin_{x in Omega_x} 0.5 x^T H x + g^T x H := A (I - L A) g := q - A f_b

Just like the CQPP, we will either accept the simple case of (A, q, L, f_b) or the more general case of (DT, M, D, q, BT, S, B, b).

Parameters
probThe mixed constrained convex quadratic programming problem to solve.
stratThe solution strategy to use (for the reduced CQPP in x and the linear solve in y).
stateThe state to use for the solution strategy, which will be modified during the solve.
Returns
The result of the solve (contents are defined by the strategy).

◆ solve_lcp()

template<class Problem, class Strategy, class State>
auto mundy::solve_lcp ( const Problem & prob,
const Strategy & strat,
State & state )

This is for a linear complementarity problem of the form: 0 <= A x + q _|_ x >= 0 where A is a symmetric positive semi-definite matrix, q is a vector, and x is the solution vector.

This is equivalent to solving the following constrained quadratic programming problem: x^* = argmin 0.5 x^T A x + q^T x s.t x in R^n, x >= 0

Example 1:

// Problem setup
Matrix3d A{};
Vector3d q{};
Vector3d x{}, grad{}, x_tmp{}, grad_tmp{};
// Build the problem (no template args at callsite)
const auto lcp = make_mundy_math_lcp(A, q);
// Reuse the backend token from the problem
const auto backend = lcp.backend();
// Strategy + state
PGDConfig cfg{1000, 1e-6};
auto pgd = make_pgd_solution_strategy(cfg); // Use default step/residual strategies
// auto pgd = make_pgd_solution_strategy( //
MyStepStrat{}, MyResidualStrat{}, cfg); // Custom step/residual strategies
auto pgd_state = make_pgd_state(x, grad, x_tmp, grad_tmp);
// Solve (can reuse "lcp" and "pgd" across many states)
auto result = solve_lcp(lcp, pgd, pgd_state);
auto make_pgd_state(XVector &&x, GradVector &&grad, XTmpVector &&x_tmp, GradTmpVector &&grad_tmp)
Definition convex.hpp:2080
auto solve_lcp(const Problem &prob, const Strategy &strat, State &state)
Solve a linear complementarity problem (LCP) using a constrained quadratic programming solver.
Definition convex.hpp:2244
auto make_pgd_solution_strategy(StepPolicy &&step_policy, ResidualPolicy &&residual_policy, const convex::PGDConfig< Scalar > &cfg={})
Definition convex.hpp:2066

Example 2: Congruent LCP

// Problem setup
Matrix3d D{};
Matrix3d M{};
Vector3d q{};
Vector3d x{}, grad{}, x_tmp{}, grad_tmp{};
// Build quadratic-form operator and problem
auto A = make_quadratic_form<backend_t>(D.view_transpose(), M, D);
const auto lcp = make_mundy_math_lcp(A, q);
// Reuse the backend token from the problem
const auto backend = lcp.backend();
// Strategy + state
PGDConfig cfg{1000, 1e-6};
auto pgd = make_pgd_solution_strategy(backend, cfg);
auto pgd_state = make_pgd_state(backend, x, grad, x_tmp, grad_tmp);
// Solve (can reuse "lcp" and "pgd" across many states)
auto result = solve_lcp(lcp, pgd, pgd_state);
// Workspace (f/u) now lives on the linear operator in the problem
const auto& ws = lcp.workspace();
MUNDY_THROW_ASSERT(ws.is_committed(), std::logic_error, "workspace must be committed after convergence");
size_t size_t M
Definition Matrix.hpp:1392
auto make_quadratic_form(LinearOpDT &&DT, LinearOpM &&M, LinearOpD &&D)
Definition convex.hpp:1899
Backend for Mundy math within a kernel.
Definition convex.hpp:1037
#define MUNDY_THROW_ASSERT(assertion_to_test, exception_to_throw, message_to_print)
Throw an exception if the given assertion is false.
Definition throw_assert.hpp:223
Parameters
probThe linear complementarity problem to solve.
stratThe solution strategy to use.
stateThe state to use for the solution strategy, which will be modified during the solve.
Returns
The result of the solve (contents are defined by the strategy).

◆ hilbert_3d()

template<typename Scalar = double>
size_t mundy::hilbert_3d ( size_t s,
size_t i,
std::vector< mundy::Vector3< Scalar > > & position_array,
mundy::Vector3< Scalar > current_position,
mundy::Vector3< Scalar > dr1,
mundy::Vector3< Scalar > dr2,
mundy::Vector3< Scalar > dr3 )

This defines functions for converting between 3D coordinates and a 1D index along the curve.

Recursive function to create a 3D hilbert curve given a number of lattice points per side

Parameters
[in]sThe index of the element.

The non-reference passing of the current_position, dr1, dr2, and dr3 is intentional. This is because the we do some math when passing the values to the next recursive call.

◆ create_hilbert_positions_and_directors()

template<typename Scalar = double>
std::tuple< std::vector< mundy::Vector3< Scalar > >, std::vector< mundy::Vector3< Scalar > > > mundy::create_hilbert_positions_and_directors ( size_t num_points,
mundy::Vector3< Scalar > orientation = mundy::Vector3<Scalar>(1.0, 0.0, 0.0),
Scalar side_length = 1.0 )

◆ get_masked_view()

template<typename T, size_t N, Kokkos::Array< bool, N > mask, ValidAccessor< T > Accessor>
auto mundy::get_masked_view ( Accessor && accessor)
constexpr
Parameters
[in]accessorThe accessor accessor.

In practice, this function is syntactic sugar to avoid having to specify the template parameters when creating a MaskedView<T, stride, Accessor> from a accessor accessor. Instead of writing

Get a masked accessor into a contiguous accessor.
Definition MaskedView.hpp:48

you can write

auto masked_accessor = get_masked_view<T, N, mask>(accessor);
constexpr auto get_masked_view(Accessor &&accessor)
A helper function to create a MaskedView<T, N, Accessor> based on a given accessor.
Definition MaskedView.hpp:142

◆ get_owning_masked_accessor()

template<typename T, size_t N, Kokkos::Array< bool, N > mask, ValidAccessor< T > Accessor>
auto mundy::get_owning_masked_accessor ( Accessor && accessor)
constexpr

◆ operator<<() [9/12]

template<typename T, size_t N, size_t M, ValidAccessor< T > Accessor>
std::ostream & mundy::operator<< ( std::ostream & os,
const AMatrix< T, N, M, Accessor > & mat )
Parameters
[in]osThe output stream.
[in]matThe matrix.

◆ is_close() [1/15]

template<size_t N, size_t M, typename U, typename T, ValidAccessor< U > Accessor1, ValidAccessor< T > Accessor2>
bool mundy::is_close ( const AMatrix< U, N, M, Accessor1 > & mat1,
const AMatrix< T, N, M, Accessor2 > & mat2,
const decltype(get_comparison_tolerance< T, U >())& tol = get_comparison_tolerance<T, U>() )
constexpr
Parameters
[in]mat1The first matrix.
[in]mat2The second matrix.
[in]tolThe tolerance (default is determined by the given type).

◆ is_approx_close() [1/15]

template<size_t N, size_t M, typename U, typename T, ValidAccessor< U > Accessor1, ValidAccessor< T > Accessor2>
bool mundy::is_approx_close ( const AMatrix< U, N, M, Accessor1 > & mat1,
const AMatrix< T, N, M, Accessor2 > & mat2,
const decltype(get_relaxed_comparison_tolerance< T, U >())& tol = get_relaxed_comparison_tolerance<T, U>() )
constexpr
Parameters
[in]mat1The first matrix.
[in]mat2The second matrix.
[in]tolThe tolerance (default is determined by the given type).

◆ operator+() [1/3]

template<size_t N, size_t M, typename U, typename T, ValidAccessor< T > Accessor>
auto mundy::operator+ ( const U & scalar,
const AMatrix< T, N, M, Accessor > & mat ) -> AMatrix< std::common_type_t< T, U >, N, M >
constexpr
Parameters
[in]scalarThe scalar.
[in]matThe matrix.

◆ operator-() [1/3]

template<size_t N, size_t M, typename U, typename T, ValidAccessor< T > Accessor>
auto mundy::operator- ( const U & scalar,
const AMatrix< T, N, M, Accessor > & mat ) -> AMatrix< std::common_type_t< T, U >, N, M >
constexpr
Parameters
[in]scalarThe scalar.
[in]matThe matrix.

◆ operator*() [1/11]

template<size_t N, size_t M, typename U, typename T, ValidAccessor< T > Accessor>
auto mundy::operator* ( const U & scalar,
const AMatrix< T, N, M, Accessor > & mat ) -> AMatrix< std::common_type_t< T, U >, N, M >
constexpr
Parameters
[in]scalarThe scalar.
[in]matThe matrix.

◆ operator*() [2/11]

template<size_t N, size_t M, typename U, typename T, ValidAccessor< T > Accessor1, ValidAccessor< U > Accessor2>
auto mundy::operator* ( const AVector< U, N, Accessor1 > & vec,
const AMatrix< T, N, M, Accessor2 > & mat ) -> Vector< std::common_type_t< T, U >, M >
constexpr
Parameters
[in]vecThe vector.
[in]matThe matrix.

◆ determinant()

template<size_t N, size_t M, typename T, ValidAccessor< T > Accessor>
auto mundy::determinant ( const AMatrix< T, N, M, Accessor > & mat)
constexpr
Parameters
[in]matThe matrix.

◆ trace()

template<size_t N, size_t M, typename T, ValidAccessor< T > Accessor>
auto mundy::trace ( const AMatrix< T, N, M, Accessor > & mat)
constexpr
Parameters
[in]matThe matrix.

◆ sum() [1/2]

template<size_t N, size_t M, typename T, ValidAccessor< T > Accessor>
auto mundy::sum ( const AMatrix< T, N, M, Accessor > & mat)
constexpr
Parameters
[in]matThe matrix.

◆ product() [1/2]

template<size_t N, size_t M, typename T, ValidAccessor< T > Accessor>
auto mundy::product ( const AMatrix< T, N, M, Accessor > & mat)
constexpr
Parameters
[in]matThe matrix.

◆ min() [1/2]

template<size_t N, size_t M, typename T, ValidAccessor< T > Accessor>
auto mundy::min ( const AMatrix< T, N, M, Accessor > & mat)
constexpr
Parameters
[in]matThe matrix.

◆ max() [1/2]

template<size_t N, size_t M, typename T, ValidAccessor< T > Accessor>
auto mundy::max ( const AMatrix< T, N, M, Accessor > & mat)
constexpr
Parameters
[in]matThe matrix.

◆ mean() [1/2]

template<size_t N, size_t M, typename T, ValidAccessor< T > Accessor, typename OutputType = std::conditional_t<std::is_integral_v<T>, double, T>>
OutputType mundy::mean ( const AMatrix< T, N, M, Accessor > & mat)
constexpr
Parameters
[in]matThe matrix.

◆ mean_f() [1/2]

template<size_t N, size_t M, typename T, ValidAccessor< T > Accessor, typename OutputType = std::conditional_t<std::is_integral_v<T>, float, T>>
OutputType mundy::mean_f ( const AMatrix< T, N, M, Accessor > & mat)
constexpr
Parameters
[in]matThe matrix.

◆ variance() [1/2]

template<size_t N, size_t M, typename T, ValidAccessor< T > Accessor, typename OutputType = std::conditional_t<std::is_integral_v<T>, double, T>>
OutputType mundy::variance ( const AMatrix< T, N, M, Accessor > & mat)
constexpr
Parameters
[in]matThe matrix.

◆ variance_f() [1/2]

template<size_t N, size_t M, typename T, ValidAccessor< T > Accessor, typename OutputType = std::conditional_t<std::is_integral_v<T>, float, T>>
OutputType mundy::variance_f ( const AMatrix< T, N, M, Accessor > & mat)
constexpr
Parameters
[in]matThe matrix.

◆ stddev() [1/2]

template<size_t N, size_t M, typename T, ValidAccessor< T > Accessor, typename OutputType = std::conditional_t<std::is_integral_v<T>, double, T>>
OutputType mundy::stddev ( const AMatrix< T, N, M, Accessor > & mat)
constexpr
Parameters
[in]matThe matrix.

◆ stddev_f() [1/2]

template<size_t N, size_t M, typename T, ValidAccessor< T > Accessor, typename OutputType = std::conditional_t<std::is_integral_v<T>, float, T>>
OutputType mundy::stddev_f ( const AMatrix< T, N, M, Accessor > & mat)
constexpr
Parameters
[in]matThe matrix.

◆ copy() [1/4]

template<ValidMatrixType MatrixType>
auto mundy::copy ( const MatrixType & m)
constexpr

◆ cast() [1/4]

template<typename U, ValidMatrixType MatrixType>
auto mundy::cast ( const MatrixType & m)
constexpr

◆ transpose()

template<size_t N, size_t M, typename T, ValidAccessor< T > Accessor>
AMatrix< T, M, N > mundy::transpose ( const AMatrix< T, N, M, Accessor > & mat)
constexpr
Parameters
[in]matThe matrix.

◆ cofactors()

template<size_t N, typename T, ValidAccessor< T > Accessor>
AMatrix< T, N, N > constexpr mundy::cofactors ( const AMatrix< T, N, N, Accessor > & mat)
constexpr
Parameters
[in]matThe matrix.

◆ adjugate()

template<size_t N, typename T, ValidAccessor< T > Accessor>
AMatrix< T, N, N > constexpr mundy::adjugate ( const AMatrix< T, N, N, Accessor > & mat)
constexpr
Parameters
[in]matThe matrix.

◆ inverse() [1/2]

template<size_t N, typename T, ValidAccessor< T > Accessor, typename OutputType = std::conditional_t<std::is_integral_v<T>, double, T>>
AMatrix< OutputType, N, N > constexpr mundy::inverse ( const AMatrix< T, N, N, Accessor > & mat)
constexpr

\briuf AMatrix inverse (returns a double if T is an integral type, otherwise returns T)

Parameters
[in]matThe matrix.

◆ inverse_f()

template<size_t N, typename T, ValidAccessor< T > Accessor, typename OutputElementType = std::conditional_t<std::is_integral_v<T>, float, T>>
auto mundy::inverse_f ( const AMatrix< T, N, N, Accessor > & mat)
constexpr
Template Parameters
TThe input matrix element type.
AccessorThe accessor for the AMatrix, assuming this is part of your implementation.
OutputElementTypeThe output matrix element type, defaults T if T is an integral type (e.g., float or double) and float otherwise.

◆ frobenius_inner_product()

template<size_t N, size_t M, typename U, typename T, ValidAccessor< U > Accessor1, ValidAccessor< T > Accessor2>
auto mundy::frobenius_inner_product ( const AMatrix< U, N, M, Accessor1 > & a,
const AMatrix< T, N, M, Accessor2 > & b )
constexpr
Parameters
[in]aThe left matrix.
[in]bThe right matrix.

◆ elementwise_mul() [1/2]

template<size_t N, size_t M, typename U, typename T, ValidAccessor< U > Accessor1, ValidAccessor< T > Accessor2>
auto mundy::elementwise_mul ( const AMatrix< U, N, M, Accessor1 > & a,
const AMatrix< T, N, M, Accessor2 > & b )
constexpr
Parameters
[in]aThe left matrix.
[in]bThe right matrix.

◆ elementwise_div() [1/2]

template<size_t N, size_t M, typename U, typename T, ValidAccessor< U > Accessor1, ValidAccessor< T > Accessor2>
auto mundy::elementwise_div ( const AMatrix< U, N, M, Accessor1 > & a,
const AMatrix< T, N, M, Accessor2 > & b )
constexpr
Parameters
[in]aThe left matrix.
[in]bThe right matrix.

◆ apply() [2/3]

template<typename Func, size_t N, size_t M, typename T, ValidAccessor< T > Accessor>
auto mundy::apply ( Func && func,
const AMatrix< T, N, M, Accessor > & mat )
constexpr
Parameters
[in]funcThe function to apply.
[in]matThe matrix.

◆ apply_row()

template<typename Func, size_t N, size_t M, typename T, ValidAccessor< T > Accessor>
auto mundy::apply_row ( Func && func,
const AMatrix< T, N, M, Accessor > & mat )
constexpr
Parameters
[in]funcThe function to apply.
[in]matThe matrix.

◆ apply_column()

template<typename Func, size_t N, size_t M, typename T, ValidAccessor< T > Accessor>
auto mundy::apply_column ( Func && func,
const AMatrix< T, N, M, Accessor > & mat )
constexpr
Parameters
[in]funcThe function to apply.
[in]matThe matrix.

◆ outer_product()

template<size_t N, size_t M, typename U, typename T, ValidAccessor< U > Accessor1, ValidAccessor< T > Accessor2>
auto mundy::outer_product ( const AVector< U, N, Accessor1 > & a,
const AVector< T, M, Accessor2 > & b )
constexpr
Parameters
[in]aThe first vector.
[in]bThe second vector.

◆ frobenius_norm()

template<size_t N, size_t M, typename T, ValidAccessor< T > Accessor>
auto mundy::frobenius_norm ( const AMatrix< T, N, M, Accessor > & mat)
constexpr

◆ inf_norm() [1/2]

template<size_t N, size_t M, typename T, ValidAccessor< T > Accessor>
auto mundy::inf_norm ( const AMatrix< T, N, M, Accessor > & mat)
constexpr

◆ one_norm() [1/2]

template<size_t N, size_t M, typename T, ValidAccessor< T > Accessor>
auto mundy::one_norm ( const AMatrix< T, N, M, Accessor > & mat)
constexpr

◆ two_norm() [1/2]

template<size_t N, size_t M, typename T, ValidAccessor< T > Accessor>
auto mundy::two_norm ( const AMatrix< T, N, M, Accessor > & mat)
constexpr

◆ atomic_load() [1/3]

template<size_t N, size_t M, typename T, ValidAccessor< T > A>
AMatrix< T, N, M > mundy::atomic_load ( AMatrix< T, N, M, A > *const m)

Note: Even if the input is a view, the return is a plain matrix.

◆ atomic_store() [1/5]

template<size_t N, size_t M, typename T1, ValidAccessor< T1 > A, typename T2>
void mundy::atomic_store ( AMatrix< T1, N, M, A > *const m,
const T2 & s )

◆ atomic_store() [2/5]

template<size_t N, size_t M, typename T1, ValidAccessor< T1 > A1, typename T2, ValidAccessor< T2 > A2>
void mundy::atomic_store ( AMatrix< T1, N, M, A1 > *const m1,
const AMatrix< T2, N, M, A2 > & m2 )

◆ MUNDY_MATH_MATRIX_EXPAND_1_TO_6_2D()

mundy::MUNDY_MATH_MATRIX_EXPAND_1_TO_6_2D ( MUNDY_MATH_MATRIX_SIZE_SPECIALIZATION )
Note
Sorry for the layers of macros. I needed to avoid having 36 * 3 evocations of the type specialization macro. The following just calls that macro for each of the 36 combinations of N and M.

◆ MUNDY_MATH_MATRIX_SIZE_SPECIALIZATION_IMPL() [1/3]

mundy::MUNDY_MATH_MATRIX_SIZE_SPECIALIZATION_IMPL ( Matrix2 ,
matrix2 ,
2 ,
2  )

◆ MUNDY_MATH_MATRIX_SIZE_SPECIALIZATION_IMPL() [2/3]

mundy::MUNDY_MATH_MATRIX_SIZE_SPECIALIZATION_IMPL ( Matrix4 ,
matrix4 ,
4 ,
4  )

◆ MUNDY_MATH_MATRIX_SIZE_SPECIALIZATION_IMPL() [3/3]

mundy::MUNDY_MATH_MATRIX_SIZE_SPECIALIZATION_IMPL ( Matrix6 ,
matrix6 ,
6 ,
6  )

◆ MUNDY_MATH_MATRIX_TYPE_AND_SIZE_SPECIALIZATION_IMPL() [1/8]

mundy::MUNDY_MATH_MATRIX_TYPE_AND_SIZE_SPECIALIZATION_IMPL ( Matrix2f ,
matrix2f ,
float ,
2 ,
2  )

◆ MUNDY_MATH_MATRIX_TYPE_AND_SIZE_SPECIALIZATION_IMPL() [2/8]

mundy::MUNDY_MATH_MATRIX_TYPE_AND_SIZE_SPECIALIZATION_IMPL ( Matrix4f ,
matrix4f ,
float ,
4 ,
4  )

◆ MUNDY_MATH_MATRIX_TYPE_AND_SIZE_SPECIALIZATION_IMPL() [3/8]

mundy::MUNDY_MATH_MATRIX_TYPE_AND_SIZE_SPECIALIZATION_IMPL ( Matrix6f ,
matrix6f ,
float ,
6 ,
6  )

◆ MUNDY_MATH_MATRIX_TYPE_AND_SIZE_SPECIALIZATION_IMPL() [4/8]

mundy::MUNDY_MATH_MATRIX_TYPE_AND_SIZE_SPECIALIZATION_IMPL ( Matrix2d ,
matrix2d ,
double ,
2 ,
2  )

◆ MUNDY_MATH_MATRIX_TYPE_AND_SIZE_SPECIALIZATION_IMPL() [5/8]

mundy::MUNDY_MATH_MATRIX_TYPE_AND_SIZE_SPECIALIZATION_IMPL ( Matrix4d ,
matrix4d ,
double ,
4 ,
4  )

◆ MUNDY_MATH_MATRIX_TYPE_AND_SIZE_SPECIALIZATION_IMPL() [6/8]

mundy::MUNDY_MATH_MATRIX_TYPE_AND_SIZE_SPECIALIZATION_IMPL ( Matrix6d ,
matrix6d ,
double ,
6 ,
6  )

◆ MUNDY_MATH_MATRIX_TYPE_AND_SIZE_SPECIALIZATION_IMPL() [7/8]

mundy::MUNDY_MATH_MATRIX_TYPE_AND_SIZE_SPECIALIZATION_IMPL ( Matrix2i ,
matrix2i ,
int ,
2 ,
2  )

◆ MUNDY_MATH_MATRIX_TYPE_AND_SIZE_SPECIALIZATION_IMPL() [8/8]

mundy::MUNDY_MATH_MATRIX_TYPE_AND_SIZE_SPECIALIZATION_IMPL ( Matrix4i ,
matrix4i ,
int ,
4 ,
4  )

◆ get_matrix_view()

size_t size_t ValidAccessor< T > Accessor constexpr auto mundy::get_matrix_view ( Accessor && data)
constexpr

◆ get_owning_matrix()

template<typename T, size_t N, size_t M, ValidAccessor< T > Accessor>
auto mundy::get_owning_matrix ( Accessor && data)
constexpr

◆ cholesky()

template<typename T, ValidAccessor< T > Accessor, typename OutputType = std::conditional_t<std::is_integral_v<T>, double, T>>
auto mundy::cholesky ( const AMatrix3< T, Accessor > & A) -> Matrix3< OutputType >
Parameters
AThe symmetric positive definite matrix
Returns
The lower triangular matrix of the Cholesky decomposition

◆ cholesky_f()

template<typename T, ValidAccessor< T > Accessor, typename OutputType = std::conditional_t<std::is_integral_v<T>, float, T>>
auto mundy::cholesky_f ( const AMatrix3< T, Accessor > & A) -> Matrix3< OutputType >

◆ get_matrix3_view()

template<typename T, ValidAccessor< T > Accessor>
auto mundy::get_matrix3_view ( Accessor && data)
constexpr
Parameters
[in]dataThe data accessor.

In practice, this function is syntactic sugar to avoid having to specify the template parameters when creating a AMatrix3<T, Accessor> from a data accessor. Instead of writing

AMatrix3<T, Accessor> mat(data);

you can write

auto mat = get_matrix3_view<T>(data);
constexpr auto get_matrix3_view(Accessor &&data)
A helper function to create a AMatrix3<T, Accessor> based on a given (valid) accessor.
Definition Matrix3.hpp:221

◆ get_owning_matrix3()

template<typename T, ValidAccessor< T > Accessor>
auto mundy::get_owning_matrix3 ( Accessor && data)
constexpr

◆ find_min_using_approximate_derivatives()

template<size_t max_size, size_t N, typename CostFunctionType>
double mundy::find_min_using_approximate_derivatives ( const CostFunctionType & cost_func,
Vector< double, N > & x,
const double min_alowable_cost = -Kokkos::Experimental::infinity_v<double>,
const double min_objective_delta = 1e-7,
const double derivative_eps = 1e-7 )

◆ find_min_with_fdf()

template<size_t max_size, size_t N, typename FDFType>
double mundy::find_min_with_fdf ( const FDFType & fdf,
Vector< double, N > & x,
const double min_alowable_cost = -Kokkos::Experimental::infinity_v<double>,
const double min_objective_delta = 1e-7 )

Prefer this over find_min_using_approximate_derivatives whenever the exact gradient is available. The line search uses exact directional derivatives, so each outer L-BFGS iteration costs O(line_search) evaluations of cost_func instead of O(2N + line_search).

Template Parameters
max_sizeL-BFGS history depth.
NDimensionality of the parameter space.
Parameters
cost_funcCallable: double(const Vector<double,N>&).
der_funcCallable: Vector<double,N>(const Vector<double,N>&) — exact gradient.
xStarting point; overwritten with the minimizer on return.
min_alowable_costEarly-exit threshold (stop if cost drops below this value).
min_objective_deltaConvergence tolerance on the change in objective value.

L-BFGS minimization using a single combined cost-and-gradient (FDF) callable.

Prefer this over find_min_with_derivatives when the cost and gradient can be computed from the same intermediate values (e.g. foot-points on ellipsoid surfaces). The combined callable is invoked exactly once per evaluation point in both the outer loop and the line search, eliminating all redundant forward passes.

Note
Host-only: relies on mutable caching inside CachingFDFLineAdaptor.
Template Parameters
max_sizeL-BFGS history depth.
NDimensionality of the parameter space.
Parameters
fdfCallable: double(const Vector<double,N>&, Vector<double,N>&). Must fill the second argument with ∇f and return f(x).
xStarting point; overwritten with the minimizer on return.
min_alowable_costEarly-exit threshold.
min_objective_deltaConvergence tolerance on the change in objective value.

◆ find_min_with_derivatives()

template<size_t max_size, size_t N, typename CostFunctionType, typename DerivativeFunctionType>
double mundy::find_min_with_derivatives ( const CostFunctionType & cost_func,
const DerivativeFunctionType & der_func,
Vector< double, N > & x,
const double min_alowable_cost = -Kokkos::Experimental::infinity_v<double>,
const double min_objective_delta = 1e-7 )

◆ norm() [1/2]

template<typename T, ValidAccessor< T > Accessor>
auto mundy::norm ( const AQuaternion< T, Accessor > & quat)
constexpr
Parameters
[in]quatThe quaternion.

◆ operator<<() [10/12]

template<typename T, ValidAccessor< T > Accessor>
std::ostream & mundy::operator<< ( std::ostream & os,
const AQuaternion< T, Accessor > & quat )
Parameters
[in]osThe output stream.
[in]quatThe quaternion.

◆ is_close() [2/15]

template<typename U, typename T, ValidAccessor< U > Accessor1, ValidAccessor< T > Accessor2>
bool mundy::is_close ( const AQuaternion< U, Accessor1 > & quat1,
const AQuaternion< T, Accessor2 > & quat2,
const decltype(get_comparison_tolerance< T, U >())& tol = get_comparison_tolerance<T, U>() )
constexpr
Parameters
[in]quat1The first quaternion.
[in]quat2The second quaternion.
[in]tolThe tolerance.

◆ is_approx_close() [2/15]

template<typename U, typename T, ValidAccessor< U > Accessor1, ValidAccessor< T > Accessor2>
bool mundy::is_approx_close ( const AQuaternion< U, Accessor1 > & quat1,
const AQuaternion< T, Accessor2 > & quat2,
const decltype(get_relaxed_comparison_tolerance< T, U >())& tol = get_relaxed_comparison_tolerance<T, U>() )
constexpr
Parameters
[in]quat1The first quaternion.
[in]quat2The second quaternion.
[in]tolThe tolerance.

◆ operator*() [3/11]

template<typename U, typename T, ValidAccessor< T > Accessor>
auto mundy::operator* ( const U & scalar,
const AQuaternion< T, Accessor > & quat ) -> AQuaternion< std::common_type_t< T, U > >
constexpr
Parameters
[in]scalarThe scalar.
[in]quatThe quaternion.

◆ operator*() [4/11]

template<typename U, typename T, ValidAccessor< U > Accessor1, ValidAccessor< T > Accessor2>
auto mundy::operator* ( const AVector3< U, Accessor1 > & vec,
const AQuaternion< T, Accessor2 > & quat ) -> Vector3< std::common_type_t< T, U > >
constexpr
Parameters
[in]vecThe vector.
[in]quatThe quaternion.

◆ operator*() [5/11]

template<typename U, typename T, ValidAccessor< U > Accessor1, ValidAccessor< T > Accessor2>
auto mundy::operator* ( const AMatrix3< U, Accessor1 > & mat,
const AQuaternion< T, Accessor2 > & quat )
constexpr
Parameters
[in]matThe matrix.
[in]quatThe quaternion.

◆ copy() [2/4]

template<ValidQuaternionType QuaternionType>
auto mundy::copy ( const QuaternionType & q)
constexpr

◆ cast() [2/4]

template<typename U, ValidQuaternionType QuaternionType>
auto mundy::cast ( const QuaternionType & q)
constexpr

◆ dot() [1/2]

template<typename U, typename T, ValidAccessor< U > Accessor1, ValidAccessor< T > Accessor2>
auto mundy::dot ( const AQuaternion< U, Accessor1 > & q1,
const AQuaternion< T, Accessor2 > & q2 )
constexpr
Parameters
[in]q1The first quaternion.
[in]q2The second quaternion.

◆ conjugate()

template<typename T, ValidAccessor< T > Accessor>
AQuaternion< std::remove_const_t< T > > mundy::conjugate ( const AQuaternion< T, Accessor > & quat)
constexpr
Parameters
[in]quatThe quaternion.

◆ inverse() [2/2]

template<typename T, ValidAccessor< T > Accessor>
AQuaternion< std::remove_const_t< T > > mundy::inverse ( const AQuaternion< T, Accessor > & quat)
constexpr
Parameters
[in]quatThe quaternion.

◆ norm_squared() [1/2]

template<typename T, ValidAccessor< T > Accessor>
auto mundy::norm_squared ( const AQuaternion< T, Accessor > & quat)
constexpr
Parameters
[in]quatThe quaternion.

◆ normalize()

template<typename T, ValidAccessor< T > Accessor>
AQuaternion< std::remove_const_t< T > > mundy::normalize ( const AQuaternion< T, Accessor > & quat)
constexpr
Parameters
[in]quatThe quaternion.

◆ slerp()

template<typename U, typename T, typename V, ValidAccessor< U > Accessor1, ValidAccessor< T > Accessor2>
auto mundy::slerp ( const AQuaternion< U, Accessor1 > & q1,
const AQuaternion< T, Accessor2 > & q2,
const V t ) -> AQuaternion< std::common_type_t< U, T, V > >
constexpr
Parameters
[in]q1The first quaternion.
[in]q2The second quaternion.
[in]tThe interpolation parameter.

◆ rotate_quaternion()

template<ValidQuaternionType QuaternionType, ValidVectorType VectorType>
void mundy::rotate_quaternion ( QuaternionType & quat,
const VectorType & omega,
const typename QuaternionType::value_type & dt )
constexpr

Delong, JCP, 2015, Appendix A eq1, not linearized

Parameters
qThe quaternion to rotate
omegaThe angular velocity
dtThe time

◆ axis_angle_to_quaternion()

template<typename T, typename U, ValidAccessor< T > Accessor>
auto mundy::axis_angle_to_quaternion ( const AVector3< T, Accessor > & axis,
const U & angle ) -> AQuaternion< std::common_type_t< T, U > >
constexpr
Parameters
[in]axisThe axis.
[in]angleThe angle.

◆ rotation_matrix_to_quaternion()

template<typename T, ValidAccessor< T > Accessor>
AQuaternion< T > mundy::rotation_matrix_to_quaternion ( const AMatrix3< T, Accessor > & rot_mat)
constexpr
Parameters
[in]rot_matThe rotation matrix.

◆ quaternion_to_rotation_matrix()

template<typename T, ValidAccessor< T > Accessor>
Matrix3< std::remove_const_t< T > > mundy::quaternion_to_rotation_matrix ( const AQuaternion< T, Accessor > & quat)
constexpr
Parameters
[in]quatThe quaternion.

◆ euler_to_quat()

template<typename T>
AQuaternion< std::remove_const_t< T > > mundy::euler_to_quat ( const T roll,
const T pitch,
const T yaw )
constexpr
Parameters
[in]rollRoll angle.
[in]pitchPitch angle.
[in]yawYaw angle.

◆ quat_from_parallel_transport()

template<typename U, typename T, ValidAccessor< U > Accessor1, ValidAccessor< T > Accessor2>
auto mundy::quat_from_parallel_transport ( const AVector3< U, Accessor1 > & v_from,
const AVector3< T, Accessor2 > & v_to ) -> AQuaternion< decltype(U() *T())>
constexpr
Parameters
[in]v1The first vector.
[in]v2The second vector.

The parallel transport quaternion from a to b is given by

p_a^b = \frac{1}{\sqrt{2}} \sqrt{1 + a \cdot b} \left( 1 + \frac{a \times b}{1 + a \cdot b} \right) = \frac{1}{\sqrt{2}} \left( \sqrt{1 + a \cdot b} + \frac{a \times b}{\sqrt{1 + a \cdot b}} \right) = \sqrt{\frac{1 + a \cdot b}{2}} + \frac{1}{2} \frac{a \times b}{\sqrt{(1 + a \cdot b) / 2}}

This equation comes from J. Linn's 2020 "Discrete Cosserat rod kinematics constricted on the basis of the difference geometry of framed curves," and as shown above, is identical to the equation given in K. Korner's "Simple deformation measures for discrete elastic rods and ribbons."

◆ MUNDY_MATH_QUATERNION_TYPE_SPECIALIZATION()

mundy::MUNDY_MATH_QUATERNION_TYPE_SPECIALIZATION ( Quaterniond ,
quaterniond ,
double  )

◆ get_quaternion_view()

template<typename T, typename Accessor>
auto mundy::get_quaternion_view ( Accessor && data)
constexpr
Parameters
[in]dataThe data accessor.
Note
The accessor is interpreted in the raw storage order (x, y, z, w).

In practice, this function is syntactic sugar to avoid having to specify the template parameters when creating a AQuaternion<T, Accessor> from a data accessor. Instead of writing

AQuaternion class with floating point entries (an integer-valued quaternion doesn't make much sense).
Definition Quaternion.hpp:137

you can write

auto quat = get_quaternion_view<T>(data);
constexpr auto get_quaternion_view(Accessor &&data)
A helper function to create a AQuaternion<T, Accessor> based on a given accessor.
Definition Quaternion.hpp:1103

◆ get_owning_quaternion()

template<typename T, typename Accessor>
auto mundy::get_owning_quaternion ( Accessor && data)
constexpr

◆ operator<<() [11/12]

template<typename T, ValidAccessor< T > Accessor>
std::ostream & mundy::operator<< ( std::ostream & os,
const AScalar< T, Accessor > & s )

◆ is_close() [3/15]

template<typename U, typename T, ValidAccessor< U > Accessor1, ValidAccessor< T > Accessor2>
bool mundy::is_close ( const AScalar< U, Accessor1 > & a,
const AScalar< T, Accessor2 > & b,
const decltype(get_comparison_tolerance< T, U >())& tol = get_comparison_tolerance<T, U>() )
constexpr

◆ is_approx_close() [3/15]

template<typename U, typename T, ValidAccessor< U > Accessor1, ValidAccessor< T > Accessor2>
bool mundy::is_approx_close ( const AScalar< U, Accessor1 > & a,
const AScalar< T, Accessor2 > & b,
const decltype(get_relaxed_comparison_tolerance< T, U >())& tol = get_relaxed_comparison_tolerance<T, U>() )
constexpr

◆ operator+() [2/3]

template<typename U, typename T, ValidAccessor< T > Accessor>
auto mundy::operator+ ( const U & scalar,
const AScalar< T, Accessor > & s )
constexpr

◆ operator-() [2/3]

template<typename U, typename T, ValidAccessor< T > Accessor>
auto mundy::operator- ( const U & scalar,
const AScalar< T, Accessor > & s )
constexpr

◆ operator*() [6/11]

template<typename U, typename T, ValidAccessor< T > Accessor>
auto mundy::operator* ( const U & scalar,
const AScalar< T, Accessor > & s )
constexpr

◆ operator/() [1/3]

template<typename U, typename T, ValidAccessor< T > Accessor>
auto mundy::operator/ ( const U & scalar,
const AScalar< T, Accessor > & s )
constexpr

◆ operator*() [7/11]

template<size_t N, typename T, typename U, ValidAccessor< T > Accessor1, ValidAccessor< U > Accessor2>
auto mundy::operator* ( const AVector< T, N, Accessor1 > & vec,
const AScalar< U, Accessor2 > & s ) -> AVector< std::common_type_t< T, U >, N >
constexpr

◆ operator*() [8/11]

template<size_t N, typename U, typename T, ValidAccessor< U > Accessor1, ValidAccessor< T > Accessor2>
auto mundy::operator* ( const AScalar< U, Accessor1 > & s,
const AVector< T, N, Accessor2 > & vec ) -> AVector< std::common_type_t< T, U >, N >
constexpr

◆ operator/() [2/3]

template<size_t N, typename T, typename U, ValidAccessor< T > Accessor1, ValidAccessor< U > Accessor2>
auto mundy::operator/ ( const AVector< T, N, Accessor1 > & vec,
const AScalar< U, Accessor2 > & s )
constexpr

◆ operator*() [9/11]

template<size_t N, size_t M, typename T, typename U, ValidAccessor< T > Accessor1, ValidAccessor< U > Accessor2>
auto mundy::operator* ( const AMatrix< T, N, M, Accessor1 > & mat,
const AScalar< U, Accessor2 > & s ) -> AMatrix< std::common_type_t< T, U >, N, M >
constexpr

◆ operator*() [10/11]

template<size_t N, size_t M, typename U, typename T, ValidAccessor< U > Accessor1, ValidAccessor< T > Accessor2>
auto mundy::operator* ( const AScalar< U, Accessor1 > & s,
const AMatrix< T, N, M, Accessor2 > & mat ) -> AMatrix< std::common_type_t< T, U >, N, M >
constexpr

◆ operator/() [3/3]

template<size_t N, size_t M, typename T, typename U, ValidAccessor< T > Accessor1, ValidAccessor< U > Accessor2>
auto mundy::operator/ ( const AMatrix< T, N, M, Accessor1 > & mat,
const AScalar< U, Accessor2 > & s )
constexpr

◆ abs() [1/2]

template<typename T, ValidAccessor< T > Accessor>
auto mundy::abs ( const AScalar< T, Accessor > & s)
constexpr

◆ copy() [3/4]

template<ValidScalarType ScalarType>
auto mundy::copy ( const ScalarType & s)
constexpr

◆ cast() [3/4]

template<typename U, ValidScalarType ScalarType>
auto mundy::cast ( const ScalarType & s)
constexpr

◆ atomic_load() [2/3]

template<typename T>
T mundy::atomic_load ( T *const s)

◆ atomic_store() [3/5]

template<typename T, typename U>
void mundy::atomic_store ( T *const s,
const U & value )

◆ atomic_add() [1/2]

template<typename T, typename U>
void mundy::atomic_add ( T *const s,
const U & value )

◆ atomic_add() [2/2]

template<typename T, typename Acc, typename U>
void mundy::atomic_add ( AScalar< T, Acc > *const s,
const U & value )

◆ atomic_sub() [1/2]

template<typename T, typename U>
void mundy::atomic_sub ( T *const s,
const U & value )

◆ atomic_sub() [2/2]

template<typename T, typename Acc, typename U>
void mundy::atomic_sub ( AScalar< T, Acc > *const s,
const U & value )

◆ atomic_mul() [1/2]

template<typename T, typename U>
void mundy::atomic_mul ( T *const s,
const U & value )

◆ atomic_mul() [2/2]

template<typename T, typename Acc, typename U>
void mundy::atomic_mul ( AScalar< T, Acc > *const s,
const U & value )

◆ atomic_div() [1/2]

template<typename T, typename U>
void mundy::atomic_div ( T *const s,
const U & value )

◆ atomic_div() [2/2]

template<typename T, typename Acc, typename U>
void mundy::atomic_div ( AScalar< T, Acc > *const s,
const U & value )

◆ atomic_fetch_add()

template<typename T, typename U>
T mundy::atomic_fetch_add ( T *const s,
const U & value )

◆ atomic_fetch_sub()

template<typename T, typename U>
T mundy::atomic_fetch_sub ( T *const s,
const U & value )

◆ atomic_fetch_mul()

template<typename T, typename U>
T mundy::atomic_fetch_mul ( T *const s,
const U & value )

◆ atomic_fetch_div()

template<typename T, typename U>
T mundy::atomic_fetch_div ( T *const s,
const U & value )

◆ atomic_add_fetch()

template<typename T, typename U>
T mundy::atomic_add_fetch ( T *const s,
const U & value )

◆ atomic_sub_fetch()

template<typename T, typename U>
T mundy::atomic_sub_fetch ( T *const s,
const U & value )

◆ atomic_mul_fetch()

template<typename T, typename U>
T mundy::atomic_mul_fetch ( T *const s,
const U & value )

◆ atomic_div_fetch()

template<typename T, typename U>
T mundy::atomic_div_fetch ( T *const s,
const U & value )

◆ get_scalar_view()

template<typename T, ValidAccessor< T > Accessor>
auto mundy::get_scalar_view ( Accessor && data)
constexpr
double x = 3.14;
auto s = get_scalar_view<double>(&x); // views x, does not copy
constexpr auto get_scalar_view(Accessor &&data)
Create a non-owning AScalar view over an existing accessor.
Definition Scalar.hpp:795

◆ get_owning_scalar()

template<typename T, ValidAccessor< T > Accessor>
auto mundy::get_owning_scalar ( Accessor && data)
constexpr

◆ get_shifted_view()

template<typename T, size_t shift, ValidAccessor< T > Accessor>
auto mundy::get_shifted_view ( Accessor && data)
constexpr
Parameters
[in]dataThe data accessor.

In practice, this function is syntactic sugar to avoid having to specify the template parameters when creating a ShiftedView<T, stride, Accessor> from a data accessor. Instead of writing

Get a shifted accessor into a contiguous accessor.
Definition ShiftedView.hpp:45

you can write

auto shifted_data = get_shifted_view<T, shift>(data);
constexpr auto get_shifted_view(Accessor &&data)
A helper function to create a ShiftedView<T, N, Accessor> based on a given accessor.
Definition ShiftedView.hpp:101

◆ get_owning_shifted_accessor()

template<typename T, size_t shift, ValidAccessor< T > Accessor>
auto mundy::get_owning_shifted_accessor ( Accessor && data)
constexpr

◆ get_strided_view()

template<typename T, size_t stride, ValidAccessor< T > Accessor>
auto mundy::get_strided_view ( Accessor && data)
constexpr
Parameters
[in]dataThe data accessor.

In practice, this function is syntactic sugar to avoid having to specify the template parameters when creating a StridedView<T, stride, Accessor> from a data accessor. Instead of writing

Get a strided accessor into a contiguous accessor.
Definition StridedView.hpp:45

you can write

auto strided_data = get_strided_view<T, stride>(data);
constexpr auto get_strided_view(Accessor &&data)
A helper function to create a StridedView<T, stride, Accessor> based on a given accessor.
Definition StridedView.hpp:99

◆ get_owning_strided_accessor()

template<typename T, size_t stride, ValidAccessor< T > Accessor>
auto mundy::get_owning_strided_accessor ( Accessor && data)
constexpr

◆ get_zero_tolerance()

template<typename T>
T mundy::get_zero_tolerance ( )
constexpr
Template Parameters
TThe type to get the tolerance for.

◆ get_relaxed_zero_tolerance()

template<typename T>
T mundy::get_relaxed_zero_tolerance ( )
constexpr
Template Parameters
TThe type to get the tolerance for.

◆ get_comparison_tolerance()

template<typename T1, typename T2>
auto mundy::get_comparison_tolerance ( )
constexpr

◆ get_comparison_tolerance_promote_ints()

template<typename T1, typename T2>
auto mundy::get_comparison_tolerance_promote_ints ( )
constexpr

◆ get_relaxed_comparison_tolerance()

template<typename T1, typename T2>
auto mundy::get_relaxed_comparison_tolerance ( )
constexpr

◆ get_relaxed_comparison_tolerance_promote_ints()

template<typename T1, typename T2>
auto mundy::get_relaxed_comparison_tolerance_promote_ints ( )
constexpr

◆ get_transposed_view()

template<typename T, size_t N, size_t M, ValidAccessor< T > Accessor>
auto mundy::get_transposed_view ( Accessor && data)
constexpr
Parameters
[in]dataThe data accessor.

In practice, this function is syntactic sugar to avoid having to specify the template parameters when creating a TransposedView<T, stride, Accessor> from a data accessor. Instead of writing

An accessor that represents the transpose of a row-major (NxM) matrix represented by a contiguous acc...
Definition TransposedView.hpp:49

you can write

auto transposed_data = get_transposed_view<T, N, M>(data);
constexpr auto get_transposed_view(Accessor &&data)
A helper function to create a TransposedView<T, N, Accessor> based on a given accessor.
Definition TransposedView.hpp:114

◆ get_owning_transposed_accessor()

template<typename T, size_t N, size_t M, ValidAccessor< T > Accessor>
auto mundy::get_owning_transposed_accessor ( Accessor && data)
constexpr

◆ operator<<() [12/12]

template<typename T, size_t N, ValidAccessor< T > Accessor>
std::ostream & mundy::operator<< ( std::ostream & os,
const AVector< T, N, Accessor > & vec )
Parameters
[in]osThe output stream.
[in]vecThe vector.

◆ is_close() [4/15]

template<typename U, typename T>
bool mundy::is_close ( const U & scalar1,
const T & scalar2,
const decltype(get_comparison_tolerance< T, U >())& tol = get_comparison_tolerance<T, U>() )
constexpr

TODO(palmerb4): These really shouldn't be in the vector class. They should be in a separate file.

Parameters
[in]scalar1The first scalar.
[in]scalar2The second scalar.
[in]tolThe tolerance (default is determined by the given type).

◆ is_approx_close() [4/15]

template<typename U, typename T>
bool mundy::is_approx_close ( const U & scalar1,
const T & scalar2,
const decltype(get_relaxed_comparison_tolerance< T, U >())& tol = get_relaxed_comparison_tolerance<T, U>() )
constexpr
Parameters
[in]scalar1The first scalar.
[in]scalar2The second scalar.
[in]tolThe tolerance (default is determined by the given type).

◆ is_close() [5/15]

template<size_t N, typename U, typename T, ValidAccessor< U > Accessor1, ValidAccessor< T > Accessor2>
bool mundy::is_close ( const AVector< U, N, Accessor1 > & vec1,
const AVector< T, N, Accessor2 > & vec2,
const decltype(get_comparison_tolerance< T, U >())& tol = get_comparison_tolerance<T, U>() )
constexpr
Parameters
[in]vec1The first vector.
[in]vec2The second vector.
[in]tolThe tolerance (default is determined by the given type).

◆ is_approx_close() [5/15]

template<size_t N, typename U, typename T, ValidAccessor< U > Accessor1, ValidAccessor< T > Accessor2>
bool mundy::is_approx_close ( const AVector< U, N, Accessor1 > & vec1,
const AVector< T, N, Accessor2 > & vec2,
const decltype(get_relaxed_comparison_tolerance< T, U >())& tol = get_relaxed_comparison_tolerance<T, U>() )
constexpr
Parameters
[in]vec1The first vector.
[in]vec2The second vector.
[in]tolThe tolerance (default is determined by the given type).

◆ operator+() [3/3]

template<size_t N, typename U, typename T, ValidAccessor< T > Accessor>
auto mundy::operator+ ( const U & scalar,
const AVector< T, N, Accessor > & vec ) -> AVector< std::common_type_t< T, U >, N >
constexpr
Parameters
[in]scalarThe scalar.
[in]vecThe vector.

◆ operator-() [3/3]

template<size_t N, typename U, typename T, ValidAccessor< T > Accessor>
auto mundy::operator- ( const U & scalar,
const AVector< T, N, Accessor > & vec ) -> AVector< std::common_type_t< T, U >, N >
constexpr
Parameters
[in]scalarThe scalar.
[in]vecThe vector.

◆ operator*() [11/11]

template<size_t N, typename U, typename T, ValidAccessor< T > Accessor>
auto mundy::operator* ( const U & scalar,
const AVector< T, N, Accessor > & vec ) -> AVector< std::common_type_t< T, U >, N >
constexpr
Parameters
[in]scalarThe scalar.
[in]vecThe vector.

◆ sum() [2/2]

template<size_t N, typename T, ValidAccessor< T > Accessor>
auto mundy::sum ( const AVector< T, N, Accessor > & vec)
constexpr

◆ product() [2/2]

template<size_t N, typename T, ValidAccessor< T > Accessor>
auto mundy::product ( const AVector< T, N, Accessor > & vec)
constexpr

◆ min() [2/2]

template<size_t N, typename T, ValidAccessor< T > Accessor>
auto mundy::min ( const AVector< T, N, Accessor > & vec)
constexpr

◆ max() [2/2]

template<size_t N, typename T, ValidAccessor< T > Accessor>
auto mundy::max ( const AVector< T, N, Accessor > & vec)
constexpr

◆ mean() [2/2]

template<size_t N, typename T, ValidAccessor< T > Accessor, typename OutputType = std::conditional_t<std::is_integral_v<T>, double, T>>
OutputType mundy::mean ( const AVector< T, N, Accessor > & vec)
constexpr

◆ mean_f() [2/2]

template<size_t N, typename T, ValidAccessor< T > Accessor, typename OutputType = std::conditional_t<std::is_integral_v<T>, float, T>>
OutputType mundy::mean_f ( const AVector< T, N, Accessor > & vec)
constexpr

◆ variance() [2/2]

template<size_t N, typename T, ValidAccessor< T > Accessor, typename OutputType = std::conditional_t<std::is_integral_v<T>, double, T>>
OutputType mundy::variance ( const AVector< T, N, Accessor > & vec)
constexpr

◆ variance_f() [2/2]

template<size_t N, typename T, ValidAccessor< T > Accessor, typename OutputType = std::conditional_t<std::is_integral_v<T>, float, T>>
OutputType mundy::variance_f ( const AVector< T, N, Accessor > & vec)
constexpr

◆ stddev() [2/2]

template<size_t N, typename T, ValidAccessor< T > Accessor, typename OutputType = std::conditional_t<std::is_integral_v<T>, double, T>>
OutputType mundy::stddev ( const AVector< T, N, Accessor > & vec)
constexpr

◆ stddev_f() [2/2]

template<size_t N, typename T, ValidAccessor< T > Accessor, typename OutputType = std::conditional_t<std::is_integral_v<T>, float, T>>
OutputType mundy::stddev_f ( const AVector< T, N, Accessor > & vec)
constexpr

◆ copy() [4/4]

template<ValidVectorType VectorType>
auto mundy::copy ( const VectorType & v)
constexpr

◆ cast() [4/4]

template<typename U, ValidVectorType VectorType>
auto mundy::cast ( const VectorType & v)
constexpr

◆ dot() [2/2]

template<size_t N, typename U, typename T, ValidAccessor< U > Accessor1, ValidAccessor< T > Accessor2>
auto mundy::dot ( const AVector< U, N, Accessor1 > & a,
const AVector< T, N, Accessor2 > & b ) -> std::common_type_t< T, U >
constexpr
Parameters
[in]aThe first vector.
[in]bThe second vector.

◆ elementwise_mul() [2/2]

template<size_t N, typename U, typename T, ValidAccessor< U > Accessor1, ValidAccessor< T > Accessor2>
auto mundy::elementwise_mul ( const AVector< U, N, Accessor1 > & a,
const AVector< T, N, Accessor2 > & b )
constexpr
Parameters
[in]aThe first vector.
[in]bThe second vector.

◆ elementwise_div() [2/2]

template<size_t N, typename U, typename T, ValidAccessor< U > Accessor1, ValidAccessor< T > Accessor2>
auto mundy::elementwise_div ( const AVector< U, N, Accessor1 > & a,
const AVector< T, N, Accessor2 > & b )
constexpr
Parameters
[in]aThe first vector.
[in]bThe second vector.

◆ apply() [3/3]

template<typename Func, size_t N, typename T, ValidAccessor< T > Accessor>
auto mundy::apply ( Func && func,
const AVector< T, N, Accessor > & vec )
constexpr
Parameters
[in]funcThe function to apply.
[in]vecThe vector.

◆ abs() [2/2]

template<size_t N, typename T, ValidAccessor< T > Accessor>
auto mundy::abs ( const AVector< T, N, Accessor > & vec)
constexpr
Parameters
[in]vecThe vector.

◆ inf_norm() [2/2]

template<size_t N, typename T, ValidAccessor< T > Accessor>
auto mundy::inf_norm ( const AVector< T, N, Accessor > & vec)
constexpr
Parameters
[in]vecThe vector.

◆ one_norm() [2/2]

template<size_t N, typename T, ValidAccessor< T > Accessor>
auto mundy::one_norm ( const AVector< T, N, Accessor > & vec)
constexpr
Parameters
[in]vecThe vector.

◆ two_norm() [2/2]

template<size_t N, typename T, ValidAccessor< T > Accessor, typename OutputType = std::conditional_t<std::is_integral_v<T>, double, T>>
OutputType mundy::two_norm ( const AVector< T, N, Accessor > & vec)
constexpr
Parameters
[in]vecThe vector.

◆ two_norm_f()

template<size_t N, typename T, ValidAccessor< T > Accessor, typename OutputType = std::conditional_t<std::is_integral_v<T>, float, T>>
OutputType mundy::two_norm_f ( const AVector< T, N, Accessor > & vec)
constexpr
Parameters
[in]vecThe vector.

◆ two_norm_squared()

template<size_t N, typename T, ValidAccessor< T > Accessor>
auto mundy::two_norm_squared ( const AVector< T, N, Accessor > & vec)
constexpr
Parameters
[in]vecThe vector.

◆ norm() [2/2]

template<size_t N, typename T, ValidAccessor< T > Accessor, typename OutputType = std::conditional_t<std::is_integral_v<T>, double, T>>
OutputType mundy::norm ( const AVector< T, N, Accessor > & vec)
constexpr
Parameters
[in]vecThe vector.

◆ norm_f()

template<size_t N, typename T, ValidAccessor< T > Accessor, typename OutputType = std::conditional_t<std::is_integral_v<T>, float, T>>
OutputType mundy::norm_f ( const AVector< T, N, Accessor > & vec)
constexpr
Parameters
[in]vecThe vector.

◆ norm_squared() [2/2]

template<size_t N, typename T, ValidAccessor< T > Accessor>
auto mundy::norm_squared ( const AVector< T, N, Accessor > & vec)
constexpr
Parameters
[in]vecThe vector.

◆ minor_angle()

template<size_t N, typename U, typename T, ValidAccessor< U > Accessor1, ValidAccessor< T > Accessor2, typename OutputType = std::conditional_t<std::is_integral_v<std::common_type_t<U, T>>, double, std::common_type_t<U, T>>>
OutputType mundy::minor_angle ( const AVector< U, N, Accessor1 > & a,
const AVector< T, N, Accessor2 > & b )
constexpr
Parameters
[in]aThe first vector.
[in]bThe second vector.

◆ minor_angle_f()

template<size_t N, typename U, typename T, ValidAccessor< U > Accessor1, ValidAccessor< T > Accessor2, typename OutputType = std::conditional_t<std::is_integral_v<std::common_type_t<U, T>>, float, std::common_type_t<U, T>>>
OutputType mundy::minor_angle_f ( const AVector< U, N, Accessor1 > & a,
const AVector< T, N, Accessor2 > & b )
constexpr
Parameters
[in]aThe first vector.
[in]bThe second vector.

◆ major_angle()

template<size_t N, typename U, typename T, ValidAccessor< U > Accessor1, ValidAccessor< T > Accessor2, typename OutputType = std::conditional_t<std::is_integral_v<std::common_type_t<U, T>>, double, std::common_type_t<U, T>>>
OutputType mundy::major_angle ( const AVector< U, N, Accessor1 > & a,
const AVector< T, N, Accessor2 > & b )
constexpr
Parameters
[in]aThe first vector.
[in]bThe second vector.

◆ major_angle_f()

template<size_t N, typename U, typename T, ValidAccessor< U > Accessor1, ValidAccessor< T > Accessor2, typename OutputType = std::conditional_t<std::is_integral_v<std::common_type_t<U, T>>, float, std::common_type_t<U, T>>>
OutputType mundy::major_angle_f ( const AVector< U, N, Accessor1 > & a,
const AVector< T, N, Accessor2 > & b )
constexpr
Parameters
[in]aThe first vector.
[in]bThe second vector.

◆ atomic_load() [3/3]

template<size_t N, typename T, ValidAccessor< T > A>
AVector< T, N > mundy::atomic_load ( AVector< T, N, A > *const v)

Note: Even if the input is a view, the return is a plain owning vector.

◆ atomic_store() [4/5]

template<size_t N, typename T1, ValidAccessor< T1 > A, typename T2>
void mundy::atomic_store ( AVector< T1, N, A > *const v,
const T2 & s )

◆ atomic_store() [5/5]

template<size_t N, typename T1, ValidAccessor< T1 > A1, typename T2, ValidAccessor< T2 > A2>
void mundy::atomic_store ( AVector< T1, N, A1 > *const v1,
const AVector< T2, N, A2 > & v2 )

◆ MUNDY_MATH_VECTOR_SIZE_SPECIALIZATION() [1/3]

mundy::MUNDY_MATH_VECTOR_SIZE_SPECIALIZATION ( Vector2 ,
vector2 ,
2  )

◆ MUNDY_MATH_VECTOR_SIZE_SPECIALIZATION() [2/3]

mundy::MUNDY_MATH_VECTOR_SIZE_SPECIALIZATION ( Vector4 ,
vector4 ,
4  )

◆ MUNDY_MATH_VECTOR_SIZE_SPECIALIZATION() [3/3]

mundy::MUNDY_MATH_VECTOR_SIZE_SPECIALIZATION ( Vector6 ,
vector6 ,
6  )

◆ MUNDY_MATH_VECTOR_TYPE_AND_SIZE_SPECIALIZATION() [1/8]

mundy::MUNDY_MATH_VECTOR_TYPE_AND_SIZE_SPECIALIZATION ( Vector2d ,
vector2d ,
double ,
2  )

◆ MUNDY_MATH_VECTOR_TYPE_AND_SIZE_SPECIALIZATION() [2/8]

mundy::MUNDY_MATH_VECTOR_TYPE_AND_SIZE_SPECIALIZATION ( Vector4d ,
vector4d ,
double ,
4  )

◆ MUNDY_MATH_VECTOR_TYPE_AND_SIZE_SPECIALIZATION() [3/8]

mundy::MUNDY_MATH_VECTOR_TYPE_AND_SIZE_SPECIALIZATION ( Vector6d ,
vector6d ,
double ,
6  )

◆ MUNDY_MATH_VECTOR_TYPE_AND_SIZE_SPECIALIZATION() [4/8]

mundy::MUNDY_MATH_VECTOR_TYPE_AND_SIZE_SPECIALIZATION ( Vector2f ,
vector2f ,
float ,
2  )

◆ MUNDY_MATH_VECTOR_TYPE_AND_SIZE_SPECIALIZATION() [5/8]

mundy::MUNDY_MATH_VECTOR_TYPE_AND_SIZE_SPECIALIZATION ( Vector4f ,
vector4f ,
float ,
4  )

◆ MUNDY_MATH_VECTOR_TYPE_AND_SIZE_SPECIALIZATION() [6/8]

mundy::MUNDY_MATH_VECTOR_TYPE_AND_SIZE_SPECIALIZATION ( Vector6f ,
vector6f ,
float ,
6  )

◆ MUNDY_MATH_VECTOR_TYPE_AND_SIZE_SPECIALIZATION() [7/8]

mundy::MUNDY_MATH_VECTOR_TYPE_AND_SIZE_SPECIALIZATION ( Vector2i ,
vector2i ,
int ,
2  )

◆ MUNDY_MATH_VECTOR_TYPE_AND_SIZE_SPECIALIZATION() [8/8]

mundy::MUNDY_MATH_VECTOR_TYPE_AND_SIZE_SPECIALIZATION ( Vector4i ,
vector4i ,
int ,
4  )

◆ get_vector_view()

size_t ValidAccessor< T > Accessor constexpr auto mundy::get_vector_view ( Accessor && data)
constexpr

◆ get_owning_vector()

template<typename T, size_t N, ValidAccessor< T > Accessor>
auto mundy::get_owning_vector ( Accessor && data)
constexpr

◆ cross()

template<typename U, typename T, ValidAccessor< U > Accessor1, ValidAccessor< T > Accessor2>
auto mundy::cross ( const AVector3< U, Accessor1 > & a,
const AVector3< T, Accessor2 > & b ) -> AVector3< std::common_type_t< T, U > >
constexpr
Parameters
[in]aThe first vector.
[in]bThe second vector.

◆ get_vector3_view()

template<typename T, ValidAccessor< T > Accessor>
auto mundy::get_vector3_view ( Accessor && data)
constexpr
Parameters
[in]dataThe data accessor.

In practice, this function is syntactic sugar to avoid having to specify the template parameters when creating a AVector3<T, Accessor> from a data accessor. Instead of writing

AVector3<T, Accessor> vec(data);

you can write

auto vec = get_vector3_view<T>(data);
constexpr auto get_vector3_view(Accessor &&data)
A helper function to create a AVector3<T, Accessor> based on a given accessor.
Definition Vector3.hpp:121

◆ get_owning_vector3()

template<typename T, ValidAccessor< T > Accessor>
auto mundy::get_owning_vector3 ( Accessor && data)
constexpr

◆ zmorton_less()

template<ValidVector3Type Vector3Type1, ValidVector3Type Vector3Type2>
bool mundy::zmorton_less ( const Vector3Type1 & p,
const Vector3Type2 & q )

◆ compute_aabb() [1/12]

template<ValidPointType PointType>
AABB< typename PointType::value_type > mundy::compute_aabb ( const PointType & point)

◆ compute_aabb() [2/12]

template<ValidPointType PointType, typename Metric>
AABB< typename PointType::value_type > mundy::compute_aabb ( const PointType & point,
const Metric &  )

◆ compute_aabb() [3/12]

template<ValidLineSegmentType LineSegmentType>
AABB< typename LineSegmentType::value_type > mundy::compute_aabb ( const LineSegmentType & line_segment)

◆ compute_aabb() [4/12]

template<ValidLineSegmentType LineSegmentType, typename Metric>
AABB< typename LineSegmentType::value_type > mundy::compute_aabb ( const LineSegmentType & line_segment,
const Metric & metric )

◆ compute_aabb() [5/12]

template<ValidSphereType SphereType>
AABB< typename SphereType::value_type > mundy::compute_aabb ( const SphereType & sphere)

◆ compute_aabb() [6/12]

template<ValidSphereType SphereType, typename Metric>
AABB< typename SphereType::value_type > mundy::compute_aabb ( const SphereType & sphere,
const Metric &  )

◆ compute_aabb() [7/12]

template<ValidEllipsoidType EllipsoidType>
AABB< typename EllipsoidType::value_type > mundy::compute_aabb ( const EllipsoidType & ellipsoid)

An oriented ellipsoid with center c, radii r_i, and lab-frame principal axes u_i = Q e_i can be written as x = c + sum_i alpha_i r_i u_i, where ||alpha||_2 <= 1. The half-width in lab coordinate direction e_j is therefore max_{||alpha|| <= 1} |sum_i alpha_i r_i (e_j . u_i)| = sqrt(sum_i (r_i u_i[j])^2).

In code, we form the three scaled lab-frame axes r_i u_i, square them component-wise, sum, and take a component-wise square root. The AABB is center +/- extents.

◆ compute_aabb() [8/12]

template<ValidEllipsoidType EllipsoidType, typename Metric>
AABB< typename EllipsoidType::value_type > mundy::compute_aabb ( const EllipsoidType & ellipsoid,
const Metric &  )

◆ compute_aabb() [9/12]

template<ValidSpherocylinderType SpherocylinderType>
AABB< typename SpherocylinderType::value_type > mundy::compute_aabb ( const SpherocylinderType & spherocylinder)

The centerline runs along the lab-frame image of the body z-axis with half-length length/2. The AABB is the centerline endpoint AABB padded by radius in every coordinate direction.

◆ compute_aabb() [10/12]

template<ValidSpherocylinderType SpherocylinderType, typename Metric>
AABB< typename SpherocylinderType::value_type > mundy::compute_aabb ( const SpherocylinderType & spherocylinder,
const Metric &  )

◆ compute_aabb() [11/12]

template<ValidSpherocylinderSegmentType SegmentType>
AABB< typename SegmentType::value_type > mundy::compute_aabb ( const SegmentType & segment)

◆ compute_aabb() [12/12]

template<ValidSpherocylinderSegmentType SegmentType, typename Metric>
AABB< typename SegmentType::value_type > mundy::compute_aabb ( const SegmentType & segment,
const Metric & metric )

◆ compute_bounding_radius() [1/12]

template<ValidPointType PointType>
PointType::value_type mundy::compute_bounding_radius ( const PointType & point)

◆ compute_bounding_radius() [2/12]

template<ValidPointType PointType, typename Metric>
PointType::value_type mundy::compute_bounding_radius ( const PointType & point,
const Metric &  )

◆ compute_bounding_radius() [3/12]

template<ValidLineSegmentType LineSegmentType>
LineSegmentType::value_type mundy::compute_bounding_radius ( const LineSegmentType & line_segment)

◆ compute_bounding_radius() [4/12]

template<ValidLineSegmentType LineSegmentType, typename Metric>
LineSegmentType::value_type mundy::compute_bounding_radius ( const LineSegmentType & line_segment,
const Metric & metric )

◆ compute_bounding_radius() [5/12]

template<ValidSphereType SphereType>
SphereType::value_type mundy::compute_bounding_radius ( const SphereType & sphere)

◆ compute_bounding_radius() [6/12]

template<ValidSphereType SphereType, typename Metric>
SphereType::value_type mundy::compute_bounding_radius ( const SphereType & sphere,
const Metric &  )

◆ compute_bounding_radius() [7/12]

template<ValidEllipsoidType EllipsoidType>
EllipsoidType::value_type mundy::compute_bounding_radius ( const EllipsoidType & ellipsoid)

◆ compute_bounding_radius() [8/12]

template<ValidEllipsoidType EllipsoidType, typename Metric>
EllipsoidType::value_type mundy::compute_bounding_radius ( const EllipsoidType & ellipsoid,
const Metric &  )

◆ compute_bounding_radius() [9/12]

template<ValidSpherocylinderType SpherocylinderType>
SpherocylinderType::value_type mundy::compute_bounding_radius ( const SpherocylinderType & spherocylinder)

◆ compute_bounding_radius() [10/12]

template<ValidSpherocylinderType SpherocylinderType, typename Metric>
SpherocylinderType::value_type mundy::compute_bounding_radius ( const SpherocylinderType & spherocylinder,
const Metric &  )

◆ compute_bounding_radius() [11/12]

template<ValidSpherocylinderSegmentType SegmentType>
SegmentType::value_type mundy::compute_bounding_radius ( const SegmentType & segment)

◆ compute_bounding_radius() [12/12]

template<ValidSpherocylinderSegmentType SegmentType, typename Metric>
SegmentType::value_type mundy::compute_bounding_radius ( const SegmentType & segment,
const Metric & metric )

◆ compute_obb() [1/14]

template<ValidPointType PointType>
OBB< typename PointType::value_type > mundy::compute_obb ( const PointType & point)

◆ compute_obb() [2/14]

template<ValidPointType PointType, typename Metric>
OBB< typename PointType::value_type > mundy::compute_obb ( const PointType & point,
const Metric &  )

◆ compute_obb() [3/14]

template<ValidSphereType SphereType>
OBB< typename SphereType::value_type > mundy::compute_obb ( const SphereType & sphere)

◆ compute_obb() [4/14]

template<ValidSphereType SphereType, typename Metric>
OBB< typename SphereType::value_type > mundy::compute_obb ( const SphereType & sphere,
const Metric &  )

◆ compute_obb() [5/14]

template<ValidAABBType AABBType>
OBB< typename AABBType::value_type > mundy::compute_obb ( const AABBType & aabb)

◆ compute_obb() [6/14]

template<ValidAABBType AABBType, typename Metric>
OBB< typename AABBType::value_type > mundy::compute_obb ( const AABBType & aabb,
const Metric &  )

◆ compute_obb() [7/14]

template<ValidEllipsoidType EllipsoidType>
OBB< typename EllipsoidType::value_type > mundy::compute_obb ( const EllipsoidType & ellipsoid)

The ellipsoid's principal semi-axes ARE the local box axes. The tightest box in the principal frame is the axis-aligned box with half-extents equal to the three radii. The quaternion that maps body axes to world is exactly the ellipsoid's stored orientation.

◆ compute_obb() [8/14]

template<ValidEllipsoidType EllipsoidType, typename Metric>
OBB< typename EllipsoidType::value_type > mundy::compute_obb ( const EllipsoidType & ellipsoid,
const Metric &  )

◆ compute_obb() [9/14]

template<ValidSpherocylinderType SpherocylinderType>
OBB< typename SpherocylinderType::value_type > mundy::compute_obb ( const SpherocylinderType & sc)

The capsule axis is the body z-axis rotated to world space. The tightest box has:

  • local z half-extent = length/2 + radius (hemispherical caps along the long axis)
  • local x/y half-extents = radius (radial directions)

The box orientation matches the capsule orientation.

◆ compute_obb() [10/14]

template<ValidSpherocylinderType SpherocylinderType, typename Metric>
OBB< typename SpherocylinderType::value_type > mundy::compute_obb ( const SpherocylinderType & sc,
const Metric &  )

◆ compute_obb() [11/14]

template<ValidSpherocylinderSegmentType SegmentType>
OBB< typename SegmentType::value_type > mundy::compute_obb ( const SegmentType & seg)

The segment's long axis runs from start to end. The OBB is centered at the segment midpoint, oriented so that local z points from start to end, with:

  • local z half-extent = segment_length/2 + radius
  • local x/y half-extents = radius

◆ compute_obb() [12/14]

template<ValidSpherocylinderSegmentType SegmentType, typename Metric>
OBB< typename SegmentType::value_type > mundy::compute_obb ( const SegmentType & seg,
const Metric & metric )

◆ compute_obb() [13/14]

template<ValidLineSegmentType LineSegmentType>
OBB< typename LineSegmentType::value_type > mundy::compute_obb ( const LineSegmentType & ls)

◆ compute_obb() [14/14]

template<ValidLineSegmentType LineSegmentType, typename Metric>
OBB< typename LineSegmentType::value_type > mundy::compute_obb ( const LineSegmentType & ls,
const Metric & metric )

◆ make_orthorhombic_metric() [1/2]

template<unsigned PeriodicAxes = AXIS_XYZ, typename Scalar>
OrthorhombicMetric< PeriodicAxes, Scalar > mundy::make_orthorhombic_metric ( const Vector3< Scalar > & cell_widths)
constexpr
Template Parameters
PeriodicAxesBitmask of periodic axes; defaults to AXIS_XYZ (all periodic).

◆ make_orthorhombic_metric() [2/2]

template<unsigned PeriodicAxes = AXIS_XYZ, typename Scalar>
OrthorhombicMetric< PeriodicAxes, Scalar > mundy::make_orthorhombic_metric ( const Vector3< Scalar > & domain_min,
const Vector3< Scalar > & domain_max )
constexpr
Template Parameters
PeriodicAxesBitmask of periodic axes; defaults to AXIS_XYZ (all periodic).

◆ make_triclinic_metric() [1/2]

template<unsigned PeriodicAxes = AXIS_XYZ, typename Scalar>
TriclinicMetric< PeriodicAxes, Scalar > mundy::make_triclinic_metric ( const Matrix3< Scalar > & h)
constexpr
Template Parameters
PeriodicAxesBitmask of periodic lattice-vector directions; defaults to AXIS_XYZ (all three lattice directions periodic).

◆ make_triclinic_metric() [2/2]

template<unsigned PeriodicAxes = AXIS_XYZ, typename Scalar>
TriclinicMetric< PeriodicAxes, Scalar > mundy::make_triclinic_metric ( const Vector3< Scalar > & cell_widths)
constexpr
Template Parameters
PeriodicAxesBitmask of periodic lattice-vector directions; defaults to AXIS_XYZ (all three lattice directions periodic).

◆ reference_point()

template<typename Object>
auto mundy::reference_point ( const Object & obj)

wrap_rigid and shift_image translate the whole object so this point reaches the target location; all other constituent points move with it.

Mapping: Point -> the point itself LineSegment -> start VSegment -> start SpherocylinderSegment -> start AABB -> min_corner All others -> center

◆ shift_image()

template<typename Integer, typename Object, typename Metric>
auto mundy::shift_image ( const Object & obj,
const Vector3< Integer > & lattice_vector,
const Metric & metric )

The displacement is determined by shifting the reference point and applied rigidly to the whole object via translate().

◆ wrap_rigid()

template<typename Object, typename Metric>
auto mundy::wrap_rigid ( const Object & obj,
const Metric & metric )

The whole object moves as a rigid body: orientation, shape, and relative positions of all constituent points are preserved. The reference point is defined by reference_point(obj).

◆ wrap_rigid_inplace()

template<typename Object, typename Metric>
void mundy::wrap_rigid_inplace ( Object & obj,
const Metric & metric )

◆ wrap_points()

template<FinitePrimitive Object, typename Metric>
auto mundy::wrap_points ( const Object & obj,
const Metric & metric )

Each point is wrapped in isolation via metric.wrap(). For multi-point objects (LineSegment, VSegment, AABB, etc.) this does NOT preserve relative positions between points — use wrap_rigid when shape must be maintained.

Requires FinitePrimitive<Object>. Infinite primitives (e.g. Line) do not satisfy this — use wrap_rigid for those instead.

◆ wrap_points_inplace()

template<FinitePrimitive Object, typename Metric>
void mundy::wrap_points_inplace ( Object & obj,
const Metric & metric )

◆ unwrap_points_to_ref()

template<FinitePrimitive Object, ValidPointType PointT, typename Metric>
auto mundy::unwrap_points_to_ref ( const Object & obj,
const Metric & metric,
const PointT & ref_point )

For each constituent point p, computes: p' = from_fractional(frac(ref) + frac_minimum_image(frac(p) - frac(ref)))

This is the inverse of wrap_points only when ref_point is already inside the primary cell. Otherwise the result equals wrap_rigid applied to the original object: wrap_rigid(s, m) == unwrap_points_to_ref(wrap_points(s, m), m, reference_point(s))

Requires FinitePrimitive<Object>.

◆ unwrap_points_to_ref_inplace()

template<FinitePrimitive Object, ValidPointType PointT, typename Metric>
void mundy::unwrap_points_to_ref_inplace ( Object & obj,
const Metric & metric,
const PointT & ref_point )

◆ image_index()

template<ValidPointType PointT, typename Metric>
Vector3< int > mundy::image_index ( const PointT & p,
const Metric & metric )

Computed in fractional coordinates, where wrapping is genuinely per-axis, so it is exact and correct for any lattice — orthorhombic or tilted. A non-periodic axis wraps to itself, giving k = 0 there. The displacement that wraps the point into the primary cell is -lattice_displacement(image_index(p, m), m); the integer reconstruction avoids the sub-ULP noise of the metric's wrap/from_fractional round-trip.

◆ lattice_displacement()

template<typename Integer, typename Metric>
Vector3< typename Metric::value_type > mundy::lattice_displacement ( const Vector3< Integer > & n,
const Metric & metric )

Applies the metric's lattice vectors to the integer fractional offset via from_fractional, so it is exact and correct for tilted cells. The result is in the metric's scalar type.

◆ is_close() [6/15]

template<ValidCircle3DType T1, ValidCircle3DType T2>
bool mundy::is_close ( const T1 & c1,
const T2 & c2,
typename T1::value_type tol = get_comparison_tolerance<typename T1::value_type, typename T2::value_type>() )
constexpr

◆ is_approx_close() [6/15]

template<ValidCircle3DType T1, ValidCircle3DType T2>
bool mundy::is_approx_close ( const T1 & c1,
const T2 & c2,
typename T1::value_type tol = get_relaxed_comparison_tolerance<typename T1::value_type, typename T2::value_type>() )
constexpr

◆ is_close() [7/15]

template<ValidEllipsoidType T1, ValidEllipsoidType T2>
bool mundy::is_close ( const T1 & e1,
const T2 & e2,
typename T1::value_type tol = get_comparison_tolerance<typename T1::value_type, typename T2::value_type>() )
constexpr

◆ is_approx_close() [7/15]

template<ValidEllipsoidType T1, ValidEllipsoidType T2>
bool mundy::is_approx_close ( const T1 & e1,
const T2 & e2,
typename T1::value_type tol = get_relaxed_comparison_tolerance<typename T1::value_type, typename T2::value_type>() )
constexpr

◆ is_close() [8/15]

template<ValidLineType T1, ValidLineType T2>
bool mundy::is_close ( const T1 & l1,
const T2 & l2,
typename T1::value_type tol = get_comparison_tolerance<typename T1::value_type, typename T2::value_type>() )
constexpr

◆ is_approx_close() [8/15]

template<ValidLineType T1, ValidLineType T2>
bool mundy::is_approx_close ( const T1 & l1,
const T2 & l2,
typename T1::value_type tol = get_relaxed_comparison_tolerance<typename T1::value_type, typename T2::value_type>() )
constexpr

◆ is_close() [9/15]

template<ValidLineSegmentType T1, ValidLineSegmentType T2>
bool mundy::is_close ( const T1 & ls1,
const T2 & ls2,
typename T1::value_type tol = get_comparison_tolerance<typename T1::value_type, typename T2::value_type>() )
constexpr

◆ is_approx_close() [9/15]

template<ValidLineSegmentType T1, ValidLineSegmentType T2>
bool mundy::is_approx_close ( const T1 & ls1,
const T2 & ls2,
typename T1::value_type tol = get_relaxed_comparison_tolerance<typename T1::value_type, typename T2::value_type>() )
constexpr

◆ is_close() [10/15]

template<ValidOBBType T1, ValidOBBType T2>
bool mundy::is_close ( const T1 & a,
const T2 & b,
typename T1::value_type tol = get_comparison_tolerance<typename T1::value_type, typename T2::value_type>() )
constexpr

◆ is_approx_close() [10/15]

template<ValidOBBType T1, ValidOBBType T2>
bool mundy::is_approx_close ( const T1 & a,
const T2 & b,
typename T1::value_type tol = get_relaxed_comparison_tolerance<typename T1::value_type, typename T2::value_type>() )
constexpr

◆ is_close() [11/15]

template<ValidRingType T1, ValidRingType T2>
bool mundy::is_close ( const T1 & r1,
const T2 & r2,
typename T1::value_type tol = get_comparison_tolerance<typename T1::value_type, typename T2::value_type>() )
constexpr

◆ is_approx_close() [11/15]

template<ValidRingType T1, ValidRingType T2>
bool mundy::is_approx_close ( const T1 & r1,
const T2 & r2,
typename T1::value_type tol = get_relaxed_comparison_tolerance<typename T1::value_type, typename T2::value_type>() )
constexpr

◆ is_close() [12/15]

template<ValidSphereType T1, ValidSphereType T2>
bool mundy::is_close ( const T1 & s1,
const T2 & s2,
typename T1::value_type tol = get_comparison_tolerance<typename T1::value_type, typename T2::value_type>() )
constexpr

◆ is_approx_close() [12/15]

template<ValidSphereType T1, ValidSphereType T2>
bool mundy::is_approx_close ( const T1 & s1,
const T2 & s2,
typename T1::value_type tol = get_relaxed_comparison_tolerance<typename T1::value_type, typename T2::value_type>() )
constexpr

◆ is_close() [13/15]

template<ValidSpherocylinderType T1, ValidSpherocylinderType T2>
bool mundy::is_close ( const T1 & sc1,
const T2 & sc2,
typename T1::value_type tol = get_comparison_tolerance<typename T1::value_type, typename T2::value_type>() )
constexpr

◆ is_approx_close() [13/15]

template<ValidSpherocylinderType T1, ValidSpherocylinderType T2>
bool mundy::is_approx_close ( const T1 & sc1,
const T2 & sc2,
typename T1::value_type tol = get_relaxed_comparison_tolerance<typename T1::value_type, typename T2::value_type>() )
constexpr

◆ is_close() [14/15]

template<ValidSpherocylinderSegmentType T1, ValidSpherocylinderSegmentType T2>
bool mundy::is_close ( const T1 & scs1,
const T2 & scs2,
typename T1::value_type tol = get_comparison_tolerance<typename T1::value_type, typename T2::value_type>() )
constexpr

◆ is_approx_close() [14/15]

template<ValidSpherocylinderSegmentType T1, ValidSpherocylinderSegmentType T2>
bool mundy::is_approx_close ( const T1 & scs1,
const T2 & scs2,
typename T1::value_type tol = get_relaxed_comparison_tolerance<typename T1::value_type, typename T2::value_type>() )
constexpr

◆ is_close() [15/15]

template<ValidVSegmentType T1, ValidVSegmentType T2>
bool mundy::is_close ( const T1 & vs1,
const T2 & vs2,
typename T1::value_type tol = get_comparison_tolerance<typename T1::value_type, typename T2::value_type>() )
constexpr

◆ is_approx_close() [15/15]

template<ValidVSegmentType T1, ValidVSegmentType T2>
bool mundy::is_approx_close ( const T1 & vs1,
const T2 & vs2,
typename T1::value_type tol = get_relaxed_comparison_tolerance<typename T1::value_type, typename T2::value_type>() )
constexpr

Variable Documentation

◆ has_tag_type_v

template<typename T>
bool mundy::has_tag_type_v = has_tag_type<T>::value
staticconstexpr

◆ all_have_tags_v

template<typename... Ts>
bool mundy::all_have_tags_v = all_have_tags<Ts...>::value
staticconstexpr

◆ all_tags_unique_v

template<typename... Ts>
bool mundy::all_tags_unique_v = all_tags_unique<Ts...>::value
staticconstexpr

◆ contains_tag_v

template<typename Tag, typename... Ts>
bool mundy::contains_tag_v = contains_tag<Tag, Ts...>::value
staticconstexpr

◆ index_of_tag_v

template<typename Tag, typename... Ts>
size_t mundy::index_of_tag_v = index_of_tag<Tag, Ts...>::value
staticconstexpr

◆ variant_aggregate_has_v

template<typename Tag, typename VarAggType>
bool mundy::variant_aggregate_has_v = variant_aggregate_has<Tag, VarAggType>::value
staticconstexpr

◆ aggregate_has_v

template<typename Tag, typename AggType>
bool mundy::aggregate_has_v = aggregate_has<Tag, AggType>::value
staticconstexpr

◆ is_reference_wrapper_v

template<class T>
bool mundy::is_reference_wrapper_v = is_reference_wrapper<T>::value
staticconstexpr

◆ is_char_array_v

template<typename T>
bool mundy::is_char_array_v = is_char_array<std::remove_cvref_t<T>>::value
inlineconstexpr

◆ is_string_literal_v

template<typename T>
bool mundy::is_string_literal_v = is_string_literal<std::remove_cvref_t<T>>::value
inlineconstexpr

◆ is_our_string_literal_v

template<typename T>
bool mundy::is_our_string_literal_v = is_our_string_literal<std::remove_cvref_t<T>>::value
inlineconstexpr

◆ is_string_literal_sink_v

template<typename T>
bool mundy::is_string_literal_sink_v = is_string_literal_sink<std::remove_cvref_t<T>>::value
inlineconstexpr

◆ is_string_sink_v

template<typename T>
bool mundy::is_string_sink_v = is_string_sink<std::remove_cvref_t<T>>::value
inlineconstexpr

◆ tuple_size_v

template<class T>
size_t mundy::tuple_size_v = tuple_size<T>::value
staticconstexpr

◆ contains_type_v

template<class T, class... Ts>
bool mundy::contains_type_v = contains_type<T, Ts...>::value
staticconstexpr

◆ count_type_v

template<class T, class... Types>
size_t mundy::count_type_v = count_type<T, Types...>::value
staticconstexpr

◆ index_finder_v

template<class T, class... Ts>
size_t mundy::index_finder_v = index_finder<T, Ts...>::value
staticconstexpr

◆ variant_size_v

template<class T>
size_t mundy::variant_size_v = variant_size<T>::value
staticconstexpr

◆ mundy_infinity_v

template<typename T>
auto mundy::mundy_infinity_v = Kokkos::Experimental::infinity_v<passive_scalar_t<T>>
inlineconstexpr

◆ mundy_epsilon_v

template<typename T>
auto mundy::mundy_epsilon_v = Kokkos::Experimental::epsilon_v<passive_scalar_t<T>>
inlineconstexpr

◆ mundy_norm_min_v

template<typename T>
auto mundy::mundy_norm_min_v = Kokkos::Experimental::norm_min_v<passive_scalar_t<T>>
inlineconstexpr

◆ is_matrix_v

template<typename TypeToCheck>
bool mundy::is_matrix_v = is_matrix<TypeToCheck>::value
constexpr

◆ matrix1

mundy::matrix1

◆ matrix3

mundy::matrix3

◆ matrix5

mundy::matrix5

◆ matrix1f

mundy::matrix1f

◆ float

mundy::float

◆ matrix3f

mundy::matrix3f

◆ matrix5f

mundy::matrix5f

◆ matrix1d

mundy::matrix1d

◆ double

mundy::double

◆ matrix3d

mundy::matrix3d

◆ matrix5d

mundy::matrix5d

◆ matrix1i

mundy::matrix1i

◆ int

mundy::int

◆ matrix3i

mundy::matrix3i

◆ matrix5i

mundy::matrix5i

◆ N

size_t mundy::N

◆ M

size_t size_t mundy::M

◆ is_quaternion_v

template<typename TypeToCheck>
bool mundy::is_quaternion_v = is_quaternion<TypeToCheck>::value
constexpr

◆ quaternionf

mundy::quaternionf

◆ is_scalar_v

template<typename TypeToCheck>
bool mundy::is_scalar_v = is_scalar<TypeToCheck>::value
constexpr

◆ is_scalar_wrapper_v

template<typename TypeToCheck>
bool mundy::is_scalar_wrapper_v = is_scalar_v<TypeToCheck>
constexpr

◆ is_vector_v

template<typename TypeToCheck>
bool mundy::is_vector_v = is_vector<TypeToCheck>::value
constexpr

◆ vector1

mundy::vector1

◆ vector3

mundy::vector3

◆ vector5

mundy::vector5

◆ vector1d

mundy::vector1d

◆ vector3d

mundy::vector3d

◆ vector5d

mundy::vector5d

◆ vector1f

mundy::vector1f

◆ vector3f

mundy::vector3f

◆ vector5f

mundy::vector5f

◆ vector1i

mundy::vector1i

◆ vector3i

mundy::vector3i

◆ vector5i

mundy::vector5i

◆ AXIS_X

unsigned mundy::AXIS_X = 0b001u
inlineconstexpr

◆ AXIS_Y

unsigned mundy::AXIS_Y = 0b010u
inlineconstexpr

◆ AXIS_Z

unsigned mundy::AXIS_Z = 0b100u
inlineconstexpr

◆ AXIS_XY

unsigned mundy::AXIS_XY = AXIS_X | AXIS_Y
inlineconstexpr

◆ AXIS_XZ

unsigned mundy::AXIS_XZ = AXIS_X | AXIS_Z
inlineconstexpr

◆ AXIS_YZ

unsigned mundy::AXIS_YZ = AXIS_Y | AXIS_Z
inlineconstexpr

◆ AXIS_XYZ

unsigned mundy::AXIS_XYZ = AXIS_X | AXIS_Y | AXIS_Z
inlineconstexpr

◆ is_free_space_metric_v

template<typename T>
bool mundy::is_free_space_metric_v = is_free_space_metric<T>::value
inlineconstexpr

◆ is_orthorhombic_metric_v

template<typename T>
bool mundy::is_orthorhombic_metric_v = is_orthorhombic_metric<T>::value
inlineconstexpr

◆ is_triclinic_metric_v

template<typename T>
bool mundy::is_triclinic_metric_v = is_triclinic_metric<T>::value
inlineconstexpr

◆ is_periodic_metric_v

template<typename T>
bool mundy::is_periodic_metric_v = is_periodic_metric<T>::value
inlineconstexpr

◆ is_ball_joint_v

template<typename T>
bool mundy::is_ball_joint_v = is_ball_joint<T>::value
inlineconstexpr

◆ is_fene_spring_v

template<typename T>
bool mundy::is_fene_spring_v = is_fene_spring<T>::value
inlineconstexpr

◆ is_hookean_spring_v

template<typename T>
bool mundy::is_hookean_spring_v = is_hookean_spring<T>::value
inlineconstexpr

◆ is_torsional_spring_v

template<typename T>
bool mundy::is_torsional_spring_v = is_torsional_spring<T>::value
inlineconstexpr