matrix/utility.hpp File Reference
#include <nil/crypto3/algebra/matrix/matrix.hpp>
#include <tuple>
+ Include dependency graph for matrix/utility.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 nil
 
 nil::crypto3
 
 nil::crypto3::algebra
 

Functions

template<typename T , std::size_t N>
constexpr matrix< T, N, 1 > nil::crypto3::algebra::as_column (const vector< T, N > &v)
 converts a vector into a column vector More...
 
template<typename T , std::size_t N>
constexpr matrix< T, 1, N > nil::crypto3::algebra::as_row (const vector< T, N > &v)
 converts a vector into a row vector More...
 
template<typename T , typename U , std::size_t N, std::size_t M>
constexpr matrix< T, N, M > nil::crypto3::algebra::cast (const matrix< U, N, M > &m)
 casts a vector to another type More...
 
template<typename F , typename T , typename... Matrices, typename U = std::invoke_result_t<F, T, typename Matrices::value_type...>, std::size_t N = detail::all_same_value<std::size_t, Matrices::column_size...>::value, std::size_t M = detail::all_same_value<std::size_t, Matrices::row_size...>::value>
constexpr matrix< U, N, M > nil::crypto3::algebra::elementwise (F f, const matrix< T, N, M > &m, const Matrices &...matrices)
 applies a function elementwise between many matrices More...
 
template<std::size_t N, std::size_t M, typename T >
constexpr matrix< T, N, M > nil::crypto3::algebra::fill (T value)
 generates a matrix containing a single value More...
 
template<std::size_t N, std::size_t M, typename F >
constexpr decltype(auto) nil::crypto3::algebra::generate (F &&f)
 generates a matrix as a function of its indices More...
 
template<typename T , std::size_t N>
constexpr matrix< T, N, N > nil::crypto3::algebra::get_identity ()
 
template<std::size_t M, std::size_t N, std::size_t P, typename T >
constexpr matrix< T, M, N+P > nil::crypto3::algebra::horzcat (const matrix< T, M, N > &a, const matrix< T, M, P > &b)
 horizontally concatenates two matrices More...
 
template<std::size_t Row, std::size_t Col, std::size_t M, std::size_t N, typename T >
constexpr matrix< T, M *Row, N *Col > nil::crypto3::algebra::repmat (const matrix< T, M, N > &m)
 repeats a matrix More...
 
template<std::size_t P, std::size_t Q, std::size_t M, std::size_t N, typename T >
constexpr matrix< T, P, Q > nil::crypto3::algebra::reshape (const matrix< T, M, N > &m)
 reshapes a matrix More...
 
template<std::size_t P, std::size_t Q, std::size_t M, std::size_t N, typename T >
constexpr matrix< T, P, Q > nil::crypto3::algebra::submat (const matrix< T, M, N > &m, std::size_t a, std::size_t b)
 extracts the submatrix of a matrix More...
 
template<std::size_t M, std::size_t N, typename T >
constexpr matrix< T, M, N > nil::crypto3::algebra::swapcol (matrix< T, M, N > m, std::size_t a, std::size_t b)
 swaps columns of a matrix More...
 
template<std::size_t M, std::size_t N, typename T >
constexpr matrix< T, M, N > nil::crypto3::algebra::swaprow (matrix< T, M, N > m, std::size_t a, std::size_t b)
 swaps rows of a matrix More...
 
template<std::size_t M, std::size_t N, std::size_t P, typename T >
constexpr matrix< T, M+N, P > nil::crypto3::algebra::vertcat (const matrix< T, M, P > &a, const matrix< T, N, P > &b)
 vertically concatenates two matrices More...
 

Variables

template<typename T , std::size_t N>
const matrix< T, N, N > nil::crypto3::algebra::identity
 the matrix identity More...