cotila
1.2.1
A compile time linear algebra system
|
Vector operations (relating to the class cotila::vector) More...
Functions | |
template<typename T , std::size_t N> | |
constexpr vector< T, N > | cotila::conj (const vector< T, N > &v) |
computes the elementwise complex conjugate More... | |
template<typename T , std::size_t N> | |
constexpr vector< T, N > | cotila::sqrt (const vector< T, N > &v) |
computes the elementwise square root More... | |
template<typename T , std::size_t N> | |
constexpr vector< detail::remove_complex_t< T >, N > | cotila::real (const vector< T, N > &v) |
computes the elementwise real More... | |
template<typename T , std::size_t N> | |
constexpr vector< detail::remove_complex_t< T >, N > | cotila::imag (const vector< T, N > &v) |
computes the elementwise imag More... | |
template<typename T , std::size_t N> | |
constexpr vector< detail::remove_complex_t< T >, N > | cotila::abs (const vector< T, N > &v) |
computes the elementwise absolute value More... | |
template<typename T , std::size_t N> | |
constexpr T | cotila::dot (const vector< T, N > &a, const vector< T, N > &b) |
computes the dot product More... | |
template<typename T , std::size_t N> | |
constexpr T | cotila::sum (const vector< T, N > &v) |
computes the sum of elements More... | |
template<typename T , std::size_t N> | |
constexpr T | cotila::min (const vector< T, N > &v) |
computes the minimum valued element More... | |
template<typename T , std::size_t N> | |
constexpr T | cotila::max (const vector< T, N > &v) |
computes the maximum valued element More... | |
template<typename T , std::size_t N> | |
constexpr std::size_t | cotila::min_index (const vector< T, N > &v) |
computes the index of the minimum valued element More... | |
template<typename T , std::size_t N> | |
constexpr std::size_t | cotila::max_index (const vector< T, N > &v) |
computes the index of the maximum valued element More... | |
template<typename T , std::size_t N> | |
constexpr bool | cotila::operator== (const vector< T, N > &a, const vector< T, N > &b) |
checks equality of two vectors More... | |
template<typename T , std::size_t N> | |
constexpr bool | cotila::operator!= (const vector< T, N > &a, const vector< T, N > &b) |
checks inequality of two vectors More... | |
template<typename T , std::size_t N> | |
constexpr vector< T, N > | cotila::operator+ (const vector< T, N > &v, T a) |
computes the sum of a vector and a scalar More... | |
template<typename T , std::size_t N> | |
constexpr vector< T, N > | cotila::operator+ (T a, const vector< T, N > &v) |
computes the sum of a vector and a scalar More... | |
template<typename T , std::size_t N> | |
constexpr vector< T, N > | cotila::operator+ (const vector< T, N > &a, const vector< T, N > &b) |
computes the vector sum More... | |
template<typename T , std::size_t N> | |
constexpr vector< T, N > | cotila::operator* (const vector< T, N > &v, T a) |
computes the product of a vector and a scalar More... | |
template<typename T , std::size_t N> | |
constexpr vector< T, N > | cotila::operator* (T a, const vector< T, N > &v) |
computes the product of a vector and a scalar More... | |
template<typename T , std::size_t N> | |
constexpr vector< T, N > | cotila::operator* (const vector< T, N > &a, const vector< T, N > &b) |
computes the Hadamard product More... | |
template<typename T , std::size_t N> | |
constexpr vector< T, N > | cotila::operator/ (T a, const vector< T, N > &v) |
computes the quotient between a vector and a scalar More... | |
template<typename T , std::size_t N> | |
constexpr vector< T, N > | cotila::operator/ (const vector< T, N > &a, const vector< T, N > &b) |
computes the elementwise vector quotient More... | |
template<typename F , typename T , typename... Vectors, typename U = std::invoke_result_t<F, T, typename Vectors::value_type...>, std::size_t N = detail::all_same_value<std::size_t, Vectors::size...>::value> | |
constexpr vector< U, N > | cotila::elementwise (F f, const vector< T, N > &v, const Vectors &... vectors) |
applies a function elementwise between many vectors More... | |
template<typename T , std::size_t N, typename F , typename U > | |
constexpr U | cotila::accumulate (const vector< T, N > &v, U init, F &&f) |
accumulates an operation across a vector More... | |
template<typename T , typename U , std::size_t N> | |
constexpr vector< T, N > | cotila::cast (const vector< U, N > &v) |
casts a vector to another type More... | |
template<std::size_t N, typename T > | |
constexpr vector< T, N > | cotila::iota (T value=T()) |
generates a vector containing consecutive elements More... | |
template<std::size_t N, typename T > | |
constexpr vector< T, N > | cotila::linspace (T min, T max) |
generates a vector of equally spaced elements More... | |
template<std::size_t N, typename T > | |
constexpr vector< T, N > | cotila::fill (T value) |
generates a vector containing a single value More... | |
template<std::size_t N, typename F > | |
decltype(auto) constexpr | cotila::generate (F &&f) |
generates a vector as a function of its index More... | |
template<std::size_t N, typename T > | |
constexpr vector< T, N > | cotila::rotate (vector< T, N > v, int n) |
shifts vector elements More... | |
template<std::size_t M, typename T , std::size_t N> | |
constexpr vector< T, M > | cotila::slice (vector< T, N > v, std::size_t start=0) |
slices a vector into a subvector More... | |
template<typename T , std::size_t N, std::size_t M> | |
constexpr vector< T, N+M > | cotila::concat (vector< T, N > a, vector< T, M > b) |
concatenates two vectors More... | |
template<typename... Args> | |
decltype(auto) constexpr | cotila::make_vector (Args... args) |
constructs a cotila::vector from arguments More... | |
template<typename... Args> | |
decltype (auto) constexpr cotila::make_vector(Args... args) | |
constructs a cotila::vector from arguments More... | |
cotila::vector deduction guides | |
template<typename T , typename... U> | |
cotila::vector (T, U...) -> vector< std::enable_if_t<(std::is_same_v< T, U > &&...), T >, 1+sizeof...(U)> | |
deduction guide for uniform initialization More... | |
template<typename T , std::size_t N> | |
cotila::vector (const T(&)[N]) -> vector< T, N > | |
deduction guide for aggregate initialization More... | |
template<typename T , std::size_t N> | |
cotila::vector (const T(&)[N][2]) -> vector< std::complex< T >, N > | |
deduction guide for complex-valued aggregate initialization More... | |
template<typename T , typename... U> | |
vector (T, U...) -> vector< std::enable_if_t<(std::is_same_v< T, U > &&...), T >, 1+sizeof...(U)> | |
deduction guide for uniform initialization More... | |
template<typename T , std::size_t N> | |
vector (const T(&)[N]) -> vector< T, N > | |
deduction guide for aggregate initialization More... | |
template<typename T , std::size_t N> | |
vector (const T(&)[N][2]) -> vector< std::complex< T >, N > | |
deduction guide for complex-valued aggregate initialization More... | |