Manifold 3.0
Robust geometry
 
Loading...
Searching...
No Matches
Fold

Produce a scalar by applying f(A,B) -> A to adjacent pairs of elements from a vec/mat in left-to-right/column-major order (matching the associativity of arithmetic and logical operators). More...

Functions

template<class F , class A , class B >
constexpr A fold (F f, A a, const vec< B, 1 > &b)
 
template<class F , class A , class B >
constexpr A fold (F f, A a, const vec< B, 2 > &b)
 
template<class F , class A , class B >
constexpr A fold (F f, A a, const vec< B, 3 > &b)
 
template<class F , class A , class B >
constexpr A fold (F f, A a, const vec< B, 4 > &b)
 
template<class F , class A , class B , int M>
constexpr A fold (F f, A a, const mat< B, M, 1 > &b)
 
template<class F , class A , class B , int M>
constexpr A fold (F f, A a, const mat< B, M, 2 > &b)
 
template<class F , class A , class B , int M>
constexpr A fold (F f, A a, const mat< B, M, 3 > &b)
 
template<class F , class A , class B , int M>
constexpr A fold (F f, A a, const mat< B, M, 4 > &b)
 

Detailed Description

Produce a scalar by applying f(A,B) -> A to adjacent pairs of elements from a vec/mat in left-to-right/column-major order (matching the associativity of arithmetic and logical operators).