plll  1.0
plll::linalg Namespace Reference

Contains the matrix and vector library as long as other linear algebra functionality. More...

Classes

class  base_colvector
 Represents a column vector with coefficients in T. More...
 
class  base_matrix
 Represents a matrix with coefficients in T. More...
 
class  base_rowvector
 Represents a row vector with coefficients in T. More...
 
class  math_colvector
 Represents a math column vector with coefficients in T. More...
 
class  math_matrix
 Represents a math matrix with coefficients in T. More...
 
class  math_rowvector
 Represents a math row vector with coefficients in T. More...
 
class  storage_traits
 Provides means to allocate, reallocate and release (linear) arrays of objects of type T. More...
 

Typedefs

typedef unsigned int size_type
 

Enumerations

enum  { Flexible = -1 }
 

Functions

Linear algebra over rationals and integers.
unsigned hnf (math_matrix< arithmetic::Integer > &A)
 Computes the Hermite Normal Form (HNF) of the given matrix A by applying row operations. More...
 
unsigned hnf (math_matrix< arithmetic::Integer > &A, math_matrix< arithmetic::Integer > &T)
 Computes the Hermite Normal Form (HNF) of the given matrix A by applying row operations, together with a transformation matrix T. More...
 
arithmetic::Integer det (const math_matrix< arithmetic::Integer > &A)
 Computes the determinant of an integer matrix A. More...
 
math_matrix< arithmetic::IntegersolveUniqInt (const math_matrix< arithmetic::Integer > &A, const math_matrix< arithmetic::Integer > &w, const arithmetic::Integer &startPrime=arithmetic::Integer())
 Assumes that A is a square matrix and that the equation A * res == w has a unique solutions in the integers. Returns the. More...
 
void invert (math_matrix< arithmetic::Integer > &inverse, const math_matrix< arithmetic::Integer > &A, const arithmetic::Integer &startPrime=arithmetic::Integer())
 Assumes that A is invertible. Inverts the matrix A and stores the result in inverse. More...
 
std::pair< math_colvector
< arithmetic::Integer >
, arithmetic::Integer
solve (const math_matrix< arithmetic::Integer > &A, const math_colvector< arithmetic::Integer > &b)
 Solves the linear system A * x == b over the rationals. More...
 
math_colvector
< arithmetic::Integer
solveInt (const math_matrix< arithmetic::Integer > &A, const math_colvector< arithmetic::Integer > &w)
 Assumes that the linear system A * v == w has a solution in the integers. Finds this solution. More...
 
math_matrix< arithmetic::Integerkernel (const math_matrix< arithmetic::Integer > &A)
 Computes a $\mathbb{Z}$-basis of the right-kernel of A. More...
 
Swap functions.
template<typename T , int R, int C, typename ST , bool MO>
void swap (base_matrix< T, R, C, ST, MO > &A, base_matrix< T, R, C, ST, MO > &B) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Swaps matrices A and B efficiently. More...
 
template<typename T , int R1, int C1, int R2, int C2, typename ST , bool MO1, bool MO2>
void swap (base_matrix< T, R1, C1, ST, MO1 > &A, base_matrix< T, R2, C2, ST, MO2 > &B) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Swaps matrices A and B efficiently. More...
 
template<template< typename AData > class AOp, typename AData , template< typename BData > class BOp, typename BData >
void swap (const implementation::expressions::expr< AOp, AData > &A, const implementation::expressions::expr< BOp, BData > &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::do_swap(A, B)))
 Swaps matrices A and B componentwise. More...
 
template<template< typename AData > class AOp, typename AData , typename BT , int BRows, int BCols, typename BST , bool BMO>
void swap (const implementation::expressions::expr< AOp, AData > &A, base_matrix< BT, BRows, BCols, BST, BMO > &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(linalg::swap(A, implementation::expressions::make_matrix_expression(B))))
 Swaps matrices A and B componentwise. More...
 
template<typename AT , int ARows, int ACols, typename AST , bool AMO, template< typename BData > class BOp, typename BData >
void swap (base_matrix< AT, ARows, ACols, AST, AMO > &A, const implementation::expressions::expr< BOp, BData > &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(linalg::swap(implementation::expressions::make_matrix_expression(A), B)))
 Swaps matrices A and B componentwise. More...
 
template<typename T , int ARows, int ACols, typename AST , bool AMO, int BRows, int BCols, typename BST , bool BMO>
void swap (base_matrix< T, ARows, ACols, AST, AMO > &A, base_matrix< T, BRows, BCols, BST, BMO > &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(linalg::swap(implementation::expressions::make_matrix_expression(A), implementation::expressions::make_matrix_expression(B))))
 Swaps matrices A and B componentwise. More...
 
Assignment functions.
template<template< typename SourceData > class SourceOp, typename SourceData , template< typename DestData > class DestOp, typename DestData , bool move>
void assign (const implementation::expressions::expr< DestOp, DestData > &destination, const implementation::expressions::expr< SourceOp, SourceData > &source, helper::BoolToType< move > ittm)
 Assigns the content of matrix source to matrix destination. Allows to force move. More...
 
template<template< typename SourceData > class SourceOp, typename SourceData , template< typename DestData > class DestOp, typename DestData >
void assign (const implementation::expressions::expr< DestOp, DestData > &destination, const implementation::expressions::expr< SourceOp, SourceData > &source)
 Assigns the content of matrix source to matrix destination. More...
 
template<typename SourceT , int SourceRows, int SourceCols, typename SourceST , bool SourceMO, template< typename DestData > class DestOp, typename DestData >
void assign (const implementation::expressions::expr< DestOp, DestData > &destination, const base_matrix< SourceT, SourceRows, SourceCols, SourceST, SourceMO > &source)
 Assigns the content of matrix source to matrix destination. More...
 
template<template< typename SourceData > class SourceOp, typename SourceData , typename DestT , int DestRows, int DestCols, typename DestST , bool DestMO>
void assign (base_matrix< DestT, DestRows, DestCols, DestST, DestMO > &destination, const implementation::expressions::expr< SourceOp, SourceData > &source)
 Assigns the content of matrix source to matrix destination. More...
 
template<typename SourceT , int SourceRows, int SourceCols, typename SourceST , bool SourceMO, typename DestT , int DestRows, int DestCols, typename DestST , bool DestMO>
void assign (base_matrix< DestT, DestRows, DestCols, DestST, DestMO > &destination, const base_matrix< SourceT, SourceRows, SourceCols, SourceST, SourceMO > &source)
 Assigns the content of matrix source to matrix destination. More...
 
Transpose functions.
template<template< typename SourceData > class SourceOp, typename SourceData , template< typename DestData > class DestOp, typename DestData , bool move>
void transpose (const implementation::expressions::expr< DestOp, DestData > &destination, const implementation::expressions::expr< SourceOp, SourceData > &source, helper::BoolToType< move > ittm)
 Transposes the content of matrix source and stores the result in the matrix destination. Allows to force move. More...
 
template<template< typename SourceData > class SourceOp, typename SourceData , template< typename DestData > class DestOp, typename DestData >
void transpose (const implementation::expressions::expr< DestOp, DestData > &destination, const implementation::expressions::expr< SourceOp, SourceData > &source)
 Transposes the content of matrix source and stores the result in the matrix destination. More...
 
template<typename SourceT , int SourceRows, int SourceCols, typename SourceST , bool SourceMO, template< typename DestData > class DestOp, typename DestData >
void transpose (const implementation::expressions::expr< DestOp, DestData > &destination, const base_matrix< SourceT, SourceRows, SourceCols, SourceST, SourceMO > &source)
 Transposes the content of matrix source and stores the result in the matrix destination. More...
 
template<template< typename SourceData > class SourceOp, typename SourceData , typename DestT , int DestRows, int DestCols, typename DestST , bool DestMO>
void transpose (base_matrix< DestT, DestRows, DestCols, DestST, DestMO > &destination, const implementation::expressions::expr< SourceOp, SourceData > &source)
 Transposes the content of matrix source and stores the result in the matrix destination. More...
 
template<typename SourceT , int SourceRows, int SourceCols, typename SourceST , bool SourceMO, typename DestT , int DestRows, int DestCols, typename DestST , bool DestMO>
void transpose (base_matrix< DestT, DestRows, DestCols, DestST, DestMO > &destination, const base_matrix< SourceT, SourceRows, SourceCols, SourceST, SourceMO > &source)
 Transposes the content of matrix source and stores the result in the matrix destination. More...
 
Operators.
template<typename T , int Rows, int Cols, typename ST , typename MT >
implementation::BinaryMatrixOperationImpl
< base_matrix< T, Rows, Cols,
ST, true >, MT >
::Mul_ReturnType 
operator* (const base_matrix< T, Rows, Cols, ST, true > &A, const MT &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::BinaryMatrixOperationImpl< base_matrix< T, Rows, Cols, ST, true >, MT >::multiply(A, B)))
 Computes the product of A with B. More...
 
template<typename T , int Rows, int Cols, typename ST >
implementation::BinaryMatrixOperationImpl
< T, base_matrix< T, Rows,
Cols, ST, true >
>::Mul_ReturnType 
operator* (const T &A, const base_matrix< T, Rows, Cols, ST, true > &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::BinaryMatrixOperationImpl< T, base_matrix< T, Rows, Cols, ST, true > >::multiply(A, B)))
 Computes the product of A with B. More...
 
template<typename T , int Rows, int Cols, typename ST , typename MT >
implementation::BinaryMatrixOperationImpl
< base_matrix< T, Rows, Cols,
ST, true >, MT >
::Div_ReturnType 
operator/ (const base_matrix< T, Rows, Cols, ST, true > &A, const MT &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::BinaryMatrixOperationImpl< base_matrix< T, Rows, Cols, ST, true >, MT >::divide(A, B)))
 Computes the componentwise division of A with the scalar B. More...
 
template<typename T , int Rows, int Cols, typename ST , typename MT >
implementation::BinaryMatrixOperationImpl
< base_matrix< T, Rows, Cols,
ST, true >, MT >
::Mod_ReturnType 
operator% (const base_matrix< T, Rows, Cols, ST, true > &A, const MT &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::BinaryMatrixOperationImpl< base_matrix< T, Rows, Cols, ST, true >, MT >::modulo(A, B)))
 Computes the componentwise modulo of A with the scalar B. More...
 
template<typename T , int Rows, int Cols, typename ST , typename MT >
implementation::BinaryMatrixOperationImpl
< base_matrix< T, Rows, Cols,
ST, true >, MT >
::CwMul_ReturnType 
componentwise_mul (const base_matrix< T, Rows, Cols, ST, true > &A, const MT &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::BinaryMatrixOperationImpl< base_matrix< T, Rows, Cols, ST, true >, MT >::componentwise_mul(A, B)))
 Computes the componentwise multiplication of A with B. More...
 
template<typename T , int Rows, int Cols, typename ST , typename MT >
implementation::BinaryMatrixOperationImpl
< base_matrix< T, Rows, Cols,
ST, true >, MT >
::CwDiv_ReturnType 
componentwise_div (const base_matrix< T, Rows, Cols, ST, true > &A, const MT &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::BinaryMatrixOperationImpl< base_matrix< T, Rows, Cols, ST, true >, MT >::componentwise_div(A, B)))
 Computes the componentwise division of A with B. More...
 
template<typename T , int Rows, int Cols, typename ST , typename MT >
implementation::BinaryMatrixOperationImpl
< base_matrix< T, Rows, Cols,
ST, true >, MT >
::CwMod_ReturnType 
componentwise_mod (const base_matrix< T, Rows, Cols, ST, true > &A, const MT &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::BinaryMatrixOperationImpl< base_matrix< T, Rows, Cols, ST, true >, MT >::componentwise_mod(A, B)))
 Computes the componentwise modulo of A with B. More...
 
template<typename T , int Rows, int Cols, typename ST , typename MT >
implementation::BinaryMatrixOperationImpl
< base_matrix< T, Rows, Cols,
ST, true >, MT >
::Add_ReturnType 
operator+ (const base_matrix< T, Rows, Cols, ST, true > &A, const MT &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::BinaryMatrixOperationImpl< base_matrix< T, Rows, Cols, ST, true >, MT >::add(A, B)))
 Computes the sum of A and B. More...
 
template<typename T , int Rows, int Cols, typename ST , typename MT >
implementation::BinaryMatrixOperationImpl
< base_matrix< T, Rows, Cols,
ST, true >, MT >
::Sub_ReturnType 
operator- (const base_matrix< T, Rows, Cols, ST, true > &A, const MT &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::BinaryMatrixOperationImpl< base_matrix< T, Rows, Cols, ST, true >, MT >::sub(A, B)))
 Computes the difference of A and B. More...
 
template<typename T , int Rows, int Cols, typename ST >
implementation::UnaryMatrixOperationImpl
< base_matrix< T, Rows, Cols,
ST, true > >::Neg_ReturnType 
operator- (const base_matrix< T, Rows, Cols, ST, true > &A) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::UnaryMatrixOperationImpl< base_matrix< T, Rows, Cols, ST, true > >::negate(A)))
 Computes the negation of A. More...
 
template<template< typename DataType > class Operator, typename Data , typename MT >
implementation::BinaryMatrixOperationImpl
< implementation::expressions::expr
< Operator, Data >, MT >
::Mul_ReturnType 
operator* (const implementation::expressions::expr< Operator, Data > &A, const MT &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::BinaryMatrixOperationImpl< implementation::expressions::expr< Operator, Data >, MT >::multiply(A, B)))
 
template<template< typename DataType > class Operator, typename Data >
implementation::BinaryMatrixOperationImpl
< typename
implementation::MatrixInfo
< implementation::expressions::expr
< Operator, Data > >::Type,
implementation::expressions::expr
< Operator, Data >
>::Mul_ReturnType 
operator* (const typename implementation::MatrixInfo< implementation::expressions::expr< Operator, Data > >::Type &A, const implementation::expressions::expr< Operator, Data > &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::BinaryMatrixOperationImpl< typename implementation::MatrixInfo< implementation::expressions::expr< Operator, Data > >::Type, implementation::expressions::expr< Operator, Data > >::multiply(A, B)))
 
template<template< typename DataType > class Operator, typename Data , typename MT >
implementation::BinaryMatrixOperationImpl
< implementation::expressions::expr
< Operator, Data >, MT >
::Div_ReturnType 
operator/ (const implementation::expressions::expr< Operator, Data > &A, const MT &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::BinaryMatrixOperationImpl< implementation::expressions::expr< Operator, Data >, MT >::divide(A, B)))
 
template<template< typename DataType > class Operator, typename Data , typename MT >
implementation::BinaryMatrixOperationImpl
< implementation::expressions::expr
< Operator, Data >, MT >
::Mod_ReturnType 
operator% (const implementation::expressions::expr< Operator, Data > &A, const MT &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::BinaryMatrixOperationImpl< implementation::expressions::expr< Operator, Data >, MT >::modulo(A, B)))
 
template<template< typename DataType > class Operator, typename Data , typename MT >
implementation::BinaryMatrixOperationImpl
< implementation::expressions::expr
< Operator, Data >, MT >
::CwMul_ReturnType 
componentwise_mul (const implementation::expressions::expr< Operator, Data > &A, const MT &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::BinaryMatrixOperationImpl< implementation::expressions::expr< Operator, Data >, MT >::componentwise_mul(A, B)))
 
template<template< typename DataType > class Operator, typename Data , typename MT >
implementation::BinaryMatrixOperationImpl
< implementation::expressions::expr
< Operator, Data >, MT >
::CwDiv_ReturnType 
componentwise_div (const implementation::expressions::expr< Operator, Data > &A, const MT &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::BinaryMatrixOperationImpl< implementation::expressions::expr< Operator, Data >, MT >::componentwise_div(A, B)))
 
template<template< typename DataType > class Operator, typename Data , typename MT >
implementation::BinaryMatrixOperationImpl
< implementation::expressions::expr
< Operator, Data >, MT >
::CwMod_ReturnType 
componentwise_mod (const implementation::expressions::expr< Operator, Data > &A, const MT &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::BinaryMatrixOperationImpl< implementation::expressions::expr< Operator, Data >, MT >::componentwise_mod(A, B)))
 
template<template< typename DataType > class Operator, typename Data , typename MT >
implementation::BinaryMatrixOperationImpl
< implementation::expressions::expr
< Operator, Data >, MT >
::Add_ReturnType 
operator+ (const implementation::expressions::expr< Operator, Data > &A, const MT &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::BinaryMatrixOperationImpl< implementation::expressions::expr< Operator, Data >, MT >::add(A, B)))
 
template<template< typename DataType > class Operator, typename Data , typename MT >
implementation::BinaryMatrixOperationImpl
< implementation::expressions::expr
< Operator, Data >, MT >
::Mul_ReturnType 
operator- (const implementation::expressions::expr< Operator, Data > &A, const MT &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::BinaryMatrixOperationImpl< implementation::expressions::expr< Operator, Data >, MT >::sub(A, B)))
 
template<template< typename DataType > class Operator, typename Data >
implementation::UnaryMatrixOperationImpl
< implementation::expressions::expr
< Operator, Data >
>::Neg_ReturnType 
operator- (const implementation::expressions::expr< Operator, Data > &A) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::UnaryMatrixOperationImpl< implementation::expressions::expr< Operator, Data > >::negate(A)))
 
Functional versions of operators.
template<typename T , int Rows, int Cols, typename ST , typename MT1 , typename MT2 >
void mul (base_matrix< T, Rows, Cols, ST, true > &result, const MT1 &A, const MT2 &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(assign(result, implementation::BinaryMatrixOperationImpl< MT1, MT2 >::multiply(A, B))))
 Computes the product of A and B and stores the result in result. More...
 
template<typename T , int Rows, int Cols, typename ST , typename MT1 , typename MT2 >
void div (base_matrix< T, Rows, Cols, ST, true > &result, const MT1 &A, const MT2 &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(assign(result, implementation::BinaryMatrixOperationImpl< MT1, MT2 >::divide(A, B))))
 Computes the componentwise division of A by B and stores the result in result. More...
 
template<typename T , int Rows, int Cols, typename ST , typename MT1 , typename MT2 >
void mod (base_matrix< T, Rows, Cols, ST, true > &result, const MT1 &A, const MT2 &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(assign(result, implementation::BinaryMatrixOperationImpl< MT1, MT2 >::modulo(A, B))))
 Computes the componentwise modulo of A by B and stores the result in result. More...
 
template<typename T , int Rows, int Cols, typename ST , typename MT1 , typename MT2 >
void componentwise_mul (base_matrix< T, Rows, Cols, ST, true > &result, const MT1 &A, const MT2 &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(assign(result, implementation::BinaryMatrixOperationImpl< MT1, MT2 >::componentwise_mul(A, B))))
 Computes the componentwise product of A and B and stores the result in result. More...
 
template<typename T , int Rows, int Cols, typename ST , typename MT1 , typename MT2 >
void componentwise_div (base_matrix< T, Rows, Cols, ST, true > &result, const MT1 &A, const MT2 &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(assign(result, implementation::BinaryMatrixOperationImpl< MT1, MT2 >::componentwise_div(A, B))))
 Computes the componentwise division of A by B and stores the result in result. More...
 
template<typename T , int Rows, int Cols, typename ST , typename MT1 , typename MT2 >
void componentwise_mod (base_matrix< T, Rows, Cols, ST, true > &result, const MT1 &A, const MT2 &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(assign(result, implementation::BinaryMatrixOperationImpl< MT1, MT2 >::componentwise_mod(A, B))))
 Computes the componentwise modulo of A by B and stores the result in result. More...
 
template<typename T , int Rows, int Cols, typename ST , typename MT1 , typename MT2 >
void add (base_matrix< T, Rows, Cols, ST, true > &result, const MT1 &A, const MT2 &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(assign(result, implementation::BinaryMatrixOperationImpl< MT1, MT2 >::add(A, B))))
 Computes the sum of A and B and stores the result in result. More...
 
template<typename T , int Rows, int Cols, typename ST , typename MT1 , typename MT2 >
void sub (base_matrix< T, Rows, Cols, ST, true > &result, const MT1 &A, const MT2 &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(assign(result, implementation::BinaryMatrixOperationImpl< MT1, MT2 >::sub(A, B))))
 Computes the difference of A and B and stores the result in result. More...
 
template<typename T , int Rows, int Cols, typename ST , typename MT >
void neg (base_matrix< T, Rows, Cols, ST, true > &result, const MT &A) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(assign(result, implementation::UnaryMatrixOperationImpl< MT >::negate(A))))
 Computes the negation of A and stores the result in result. More...
 
template<template< typename DataType > class Operator, typename Data , typename MT1 , typename MT2 >
void mul (const implementation::expressions::expr< Operator, Data > &result, const MT1 &A, const MT2 &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(assign(result, implementation::BinaryMatrixOperationImpl< MT1, MT2 >::multiply(A, B))))
 
template<template< typename DataType > class Operator, typename Data , typename MT1 , typename MT2 >
void div (const implementation::expressions::expr< Operator, Data > &result, const MT1 &A, const MT2 &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(assign(result, implementation::BinaryMatrixOperationImpl< MT1, MT2 >::divide(A, B))))
 
template<template< typename DataType > class Operator, typename Data , typename MT1 , typename MT2 >
void mod (const implementation::expressions::expr< Operator, Data > &result, const MT1 &A, const MT2 &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(assign(result, implementation::BinaryMatrixOperationImpl< MT1, MT2 >::modulo(A, B))))
 
template<template< typename DataType > class Operator, typename Data , typename MT1 , typename MT2 >
void componentwise_mul (const implementation::expressions::expr< Operator, Data > &result, const MT1 &A, const MT2 &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(assign(result, implementation::BinaryMatrixOperationImpl< MT1, MT2 >::componentwise_mul(A, B))))
 
template<template< typename DataType > class Operator, typename Data , typename MT1 , typename MT2 >
void componentwise_div (const implementation::expressions::expr< Operator, Data > &result, const MT1 &A, const MT2 &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(assign(result, implementation::BinaryMatrixOperationImpl< MT1, MT2 >::componentwise_div(A, B))))
 
template<template< typename DataType > class Operator, typename Data , typename MT1 , typename MT2 >
void componentwise_mod (const implementation::expressions::expr< Operator, Data > &result, const MT1 &A, const MT2 &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(assign(result, implementation::BinaryMatrixOperationImpl< MT1, MT2 >::componentwise_mod(A, B))))
 
template<template< typename DataType > class Operator, typename Data , typename MT1 , typename MT2 >
void add (const implementation::expressions::expr< Operator, Data > &result, const MT1 &A, const MT2 &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(assign(result, implementation::BinaryMatrixOperationImpl< MT1, MT2 >::add(A, B))))
 
template<template< typename DataType > class Operator, typename Data , typename MT1 , typename MT2 >
void sub (const implementation::expressions::expr< Operator, Data > &result, const MT1 &A, const MT2 &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(assign(result, implementation::BinaryMatrixOperationImpl< MT1, MT2 >::sub(A, B))))
 
template<template< typename DataType > class Operator, typename Data , typename MT >
void neg (const implementation::expressions::expr< Operator, Data > &result, const MT &A) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(assign(result, implementation::UnaryMatrixOperationImpl< MT >::negate(A))))
 
Assignment-operation operators.
template<typename T , int Rows, int Cols, typename ST , typename MT >
base_matrix< T, Rows, Cols, ST,
true > & 
operator+= (base_matrix< T, Rows, Cols, ST, true > &A, const MT &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::expressions::make_matrix_expression(A)+=B))
 Adds B to the current matrix. More...
 
template<typename T , int Rows, int Cols, typename ST , typename MT >
base_matrix< T, Rows, Cols, ST,
true > & 
operator-= (base_matrix< T, Rows, Cols, ST, true > &A, const MT &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::expressions::make_matrix_expression(A)-=B))
 Subtracts B from the current matrix. More...
 
template<typename T , int Rows, int Cols, typename ST , typename MT >
base_matrix< T, Rows, Cols, ST,
true > & 
operator*= (base_matrix< T, Rows, Cols, ST, true > &A, const MT &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::expressions::make_matrix_expression(A)*=B))
 Multiplies the current matrix with B and stores the result in the current matrix. More...
 
template<typename T , int Rows, int Cols, typename ST , typename MT >
base_matrix< T, Rows, Cols, ST,
true > & 
operator/= (base_matrix< T, Rows, Cols, ST, true > &A, const MT &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::expressions::make_matrix_expression(A)/=B))
 Divides the current matrix by the scalar B and stores the result in the current matrix. More...
 
template<typename T , int Rows, int Cols, typename ST , typename MT >
base_matrix< T, Rows, Cols, ST,
true > & 
operator%= (base_matrix< T, Rows, Cols, ST, true > &A, const MT &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::expressions::make_matrix_expression(A)%=B))
 Takes the current matrix modulo the scalar B and stores the result in the current matrix. More...
 
template<template< typename DataType > class Op, typename Data , typename MT >
const
implementation::expressions::expr
< Op, Data > & 
operator+= (const implementation::expressions::expr< Op, Data > &A, const MT &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::AssignmentMatrixOperationImpl< implementation::expressions::expr< Op, Data >, MT >::add_assign(A, B)))
 
template<template< typename DataType > class Op, typename Data , typename MT >
const
implementation::expressions::expr
< Op, Data > & 
operator-= (const implementation::expressions::expr< Op, Data > &A, const MT &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::AssignmentMatrixOperationImpl< implementation::expressions::expr< Op, Data >, MT >::sub_assign(A, B)))
 
template<template< typename DataType > class Op, typename Data , typename MT >
const
implementation::expressions::expr
< Op, Data > & 
operator*= (const implementation::expressions::expr< Op, Data > &A, const MT &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::AssignmentMatrixOperationImpl< implementation::expressions::expr< Op, Data >, MT >::mul_assign(A, B)))
 
template<template< typename DataType > class Op, typename Data , typename MT >
const
implementation::expressions::expr
< Op, Data > & 
operator/= (const implementation::expressions::expr< Op, Data > &A, const MT &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::AssignmentMatrixOperationImpl< implementation::expressions::expr< Op, Data >, MT >::div_assign(A, B)))
 
template<template< typename DataType > class Op, typename Data , typename MT >
const
implementation::expressions::expr
< Op, Data > & 
operator%= (const implementation::expressions::expr< Op, Data > &A, const MT &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::AssignmentMatrixOperationImpl< implementation::expressions::expr< Op, Data >, MT >::mod_assign(A, B)))
 
Other operations.
template<typename RetType , typename T , int Rows, int Cols, typename ST >
void sum (RetType &result, const base_matrix< T, Rows, Cols, ST, true > &A) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::SumImpl< base_matrix< T, Rows, Cols, ST, true > >::sum(result, A)))
 Computes the sum of all entries of A and stores the result in result. More...
 
template<typename T , int Rows, int Cols, typename ST >
implementation::SumImpl
< base_matrix< T, Rows, Cols,
ST, true > >::RetValue 
sum (const base_matrix< T, Rows, Cols, ST, true > &A) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::SumImpl< base_matrix< T, Rows, Cols, ST, true > >::sum(A)))
 Computes the sum of all entries of A and returns the result. More...
 
template<typename RetType , template< typename DataType > class Operator, typename Data >
void sum (RetType &result, const implementation::expressions::expr< Operator, Data > &A) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::SumImpl< implementation::expressions::expr< Operator, Data > >::sum(result, A)))
 
template<template< typename DataType > class Operator, typename Data >
implementation::SumImpl
< implementation::expressions::expr
< Operator, Data > >::RetValue 
sum (const implementation::expressions::expr< Operator, Data > &A) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::SumImpl< implementation::expressions::expr< Operator, Data > >::sum(A)))
 
template<typename RetType , typename T , int Rows, int Cols, typename ST , typename MT >
void dot (RetType &result, const base_matrix< T, Rows, Cols, ST, true > &A, const MT &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::DotImpl< base_matrix< T, Rows, Cols, ST, true >, MT >::dot(result, A, B)))
 Computes the dot product of A and B and stores the result in result. More...
 
template<typename T , int Rows, int Cols, typename ST , typename MT >
implementation::DotImpl
< base_matrix< T, Rows, Cols,
ST, true >, MT >::RetValue 
dot (const base_matrix< T, Rows, Cols, ST, true > &A, const MT &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::DotImpl< base_matrix< T, Rows, Cols, ST, true >, MT >::dot(A, B)))
 Computes the dot product of A and B and returns the result. More...
 
template<typename RetType , template< typename DataType > class Operator, typename Data , typename MT >
void dot (RetType &result, const implementation::expressions::expr< Operator, Data > &A, const MT &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::DotImpl< implementation::expressions::expr< Operator, Data >, MT >::dot(result, A, B)))
 
template<template< typename DataType > class Operator, typename Data , typename MT >
implementation::DotImpl
< implementation::expressions::expr
< Operator, Data >, MT >
::RetValue 
dot (const implementation::expressions::expr< Operator, Data > &A, const MT &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::DotImpl< implementation::expressions::expr< Operator, Data >, MT >::dot(A, B)))
 
template<typename RetType , typename T , int Rows, int Cols, typename ST >
void normSq (RetType &result, const base_matrix< T, Rows, Cols, ST, true > &A) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::NormSqImpl< base_matrix< T, Rows, Cols, ST, true > >::normSq(result, A)))
 Computes the squared norm of A, i.e. the sum of the squares of all entries of A, and stores the result in result. More...
 
template<typename T , int Rows, int Cols, typename ST >
implementation::NormSqImpl
< base_matrix< T, Rows, Cols,
ST, true > >::RetValue 
normSq (const base_matrix< T, Rows, Cols, ST, true > &A) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::NormSqImpl< base_matrix< T, Rows, Cols, ST, true > >::normSq(A)))
 Computes the squared norm of A, i.e. the sum of the squares of all entries of A, and returns the result. More...
 
template<typename RetType , template< typename DataType > class Operator, typename Data >
void normSq (RetType &result, const implementation::expressions::expr< Operator, Data > &A) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::NormSqImpl< implementation::expressions::expr< Operator, Data > >::normSq(result, A)))
 
template<template< typename DataType > class Operator, typename Data >
implementation::NormSqImpl
< implementation::expressions::expr
< Operator, Data > >::RetValue 
normSq (const implementation::expressions::expr< Operator, Data > &A) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::NormSqImpl< implementation::expressions::expr< Operator, Data > >::normSq(A)))
 
template<typename T , int Rows, int Cols, typename ST , typename T1 , typename T2 >
void addmul (base_matrix< T, Rows, Cols, ST, true > &A, const T1 &B, const T2 &C)
 Computes A += B * C. More...
 
template<typename T , int Rows, int Cols, typename ST , typename T1 , typename T2 >
void submul (base_matrix< T, Rows, Cols, ST, true > &A, const T1 &B, const T2 &C)
 Computes A -= B * C. More...
 
template<template< typename DataType > class Op, typename Data , typename T1 , typename T2 >
void addmul (const implementation::expressions::expr< Op, Data > &A, const T1 &B, const T2 &C)
 
template<template< typename DataType > class Op, typename Data , typename T1 , typename T2 >
void submul (const implementation::expressions::expr< Op, Data > &A, const T1 &B, const T2 &C)
 
Comparisons.
template<template< typename AData > class AOp, typename AData , template< typename BData > class BOp, typename BData >
int compare (const implementation::expressions::expr< AOp, AData > &A, const implementation::expressions::expr< BOp, BData > &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::comparison_impl< implementation::expressions::expr< AOp, AData >, implementation::expressions::expr< BOp, BData > >::compare(A, B)))
 
template<template< typename AData > class AOp, typename AData , typename BT , int BRows, int BCols, typename BST , bool BMO>
int compare (const implementation::expressions::expr< AOp, AData > &A, const base_matrix< BT, BRows, BCols, BST, BMO > &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(compare(A, implementation::expressions::make_matrix_expression(B))))
 
template<typename AT , int ARows, int ACols, typename AST , bool AMO, template< typename BData > class BOp, typename BData >
int compare (const base_matrix< AT, ARows, ACols, AST, AMO > &A, const implementation::expressions::expr< BOp, BData > &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(compare(implementation::expressions::make_matrix_expression(A), B)))
 
template<typename AT , int ARows, int ACols, typename AST , bool AMO, typename BT , int BRows, int BCols, typename BST , bool BMO>
int compare (const base_matrix< AT, ARows, ACols, AST, AMO > &A, const base_matrix< BT, BRows, BCols, BST, BMO > &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(compare(implementation::expressions::make_matrix_expression(A), implementation::expressions::make_matrix_expression(B))))
 Lexicographically compares the matrices A and B. More...
 
template<template< typename AData > class AOp, typename AData , template< typename BData > class BOp, typename BData >
bool operator== (const implementation::expressions::expr< AOp, AData > &A, const implementation::expressions::expr< BOp, BData > &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::comparison_impl< implementation::expressions::expr< AOp, AData >, implementation::expressions::expr< BOp, BData > >::eq(A, B)))
 
template<template< typename AData > class AOp, typename AData , typename BT , int BRows, int BCols, typename BST , bool BMO>
bool operator== (const implementation::expressions::expr< AOp, AData > &A, const base_matrix< BT, BRows, BCols, BST, BMO > &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(A==implementation::expressions::make_matrix_expression(B)))
 
template<typename AT , int ARows, int ACols, typename AST , bool AMO, template< typename BData > class BOp, typename BData >
bool operator== (const base_matrix< AT, ARows, ACols, AST, AMO > &A, const implementation::expressions::expr< BOp, BData > &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::expressions::make_matrix_expression(A)==B))
 
template<typename AT , int ARows, int ACols, typename AST , bool AMO, typename BT , int BRows, int BCols, typename BST , bool BMO>
bool operator== (const base_matrix< AT, ARows, ACols, AST, AMO > &A, const base_matrix< BT, BRows, BCols, BST, BMO > &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::expressions::make_matrix_expression(A)==implementation::expressions::make_matrix_expression(B)))
 Tests A and B for equality. More...
 
template<template< typename AData > class AOp, typename AData , template< typename BData > class BOp, typename BData >
bool operator!= (const implementation::expressions::expr< AOp, AData > &A, const implementation::expressions::expr< BOp, BData > &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::comparison_impl< implementation::expressions::expr< AOp, AData >, implementation::expressions::expr< BOp, BData > >::neq(A, B)))
 
template<template< typename AData > class AOp, typename AData , typename BT , int BRows, int BCols, typename BST , bool BMO>
bool operator!= (const implementation::expressions::expr< AOp, AData > &A, const base_matrix< BT, BRows, BCols, BST, BMO > &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(A!=implementation::expressions::make_matrix_expression(B)))
 
template<typename AT , int ARows, int ACols, typename AST , bool AMO, template< typename BData > class BOp, typename BData >
bool operator!= (const base_matrix< AT, ARows, ACols, AST, AMO > &A, const implementation::expressions::expr< BOp, BData > &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::expressions::make_matrix_expression(A)!=B))
 
template<typename AT , int ARows, int ACols, typename AST , bool AMO, typename BT , int BRows, int BCols, typename BST , bool BMO>
bool operator!= (const base_matrix< AT, ARows, ACols, AST, AMO > &A, const base_matrix< BT, BRows, BCols, BST, BMO > &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::expressions::make_matrix_expression(A)!=implementation::expressions::make_matrix_expression(B)))
 Tests A and B for inequality. More...
 
template<template< typename AData > class AOp, typename AData , template< typename BData > class BOp, typename BData >
bool operator< (const implementation::expressions::expr< AOp, AData > &A, const implementation::expressions::expr< BOp, BData > &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::comparison_impl< implementation::expressions::expr< AOp, AData >, implementation::expressions::expr< BOp, BData > >::less(A, B)))
 
template<template< typename AData > class AOp, typename AData , typename BT , int BRows, int BCols, typename BST , bool BMO>
bool operator< (const implementation::expressions::expr< AOp, AData > &A, const base_matrix< BT, BRows, BCols, BST, BMO > &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(A< implementation::expressions::make_matrix_expression(B)))
 
template<typename AT , int ARows, int ACols, typename AST , bool AMO, template< typename BData > class BOp, typename BData >
bool operator< (const base_matrix< AT, ARows, ACols, AST, AMO > &A, const implementation::expressions::expr< BOp, BData > &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::expressions::make_matrix_expression(A)< B))
 
template<typename AT , int ARows, int ACols, typename AST , bool AMO, typename BT , int BRows, int BCols, typename BST , bool BMO>
bool operator< (const base_matrix< AT, ARows, ACols, AST, AMO > &A, const base_matrix< BT, BRows, BCols, BST, BMO > &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::expressions::make_matrix_expression(A)< implementation::expressions::make_matrix_expression(B)))
 Tests A and B lexicographically for A being less than B. More...
 
template<template< typename AData > class AOp, typename AData , template< typename BData > class BOp, typename BData >
bool operator<= (const implementation::expressions::expr< AOp, AData > &A, const implementation::expressions::expr< BOp, BData > &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::comparison_impl< implementation::expressions::expr< AOp, AData >, implementation::expressions::expr< BOp, BData > >::less_eq(A, B)))
 
template<template< typename AData > class AOp, typename AData , typename BT , int BRows, int BCols, typename BST , bool BMO>
bool operator<= (const implementation::expressions::expr< AOp, AData > &A, const base_matrix< BT, BRows, BCols, BST, BMO > &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(A<=implementation::expressions::make_matrix_expression(B)))
 
template<typename AT , int ARows, int ACols, typename AST , bool AMO, template< typename BData > class BOp, typename BData >
bool operator<= (const base_matrix< AT, ARows, ACols, AST, AMO > &A, const implementation::expressions::expr< BOp, BData > &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::expressions::make_matrix_expression(A)<=B))
 
template<typename AT , int ARows, int ACols, typename AST , bool AMO, typename BT , int BRows, int BCols, typename BST , bool BMO>
bool operator<= (const base_matrix< AT, ARows, ACols, AST, AMO > &A, const base_matrix< BT, BRows, BCols, BST, BMO > &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::expressions::make_matrix_expression(A)<=implementation::expressions::make_matrix_expression(B)))
 Tests A and B lexicographically for A being less than or equal to B. More...
 
template<template< typename AData > class AOp, typename AData , template< typename BData > class BOp, typename BData >
bool operator> (const implementation::expressions::expr< AOp, AData > &A, const implementation::expressions::expr< BOp, BData > &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::comparison_impl< implementation::expressions::expr< AOp, AData >, implementation::expressions::expr< BOp, BData > >::greater(A, B)))
 
template<template< typename AData > class AOp, typename AData , typename BT , int BRows, int BCols, typename BST , bool BMO>
bool operator> (const implementation::expressions::expr< AOp, AData > &A, const base_matrix< BT, BRows, BCols, BST, BMO > &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(A > implementation::expressions::make_matrix_expression(B)))
 
template<typename AT , int ARows, int ACols, typename AST , bool AMO, template< typename BData > class BOp, typename BData >
bool operator> (const base_matrix< AT, ARows, ACols, AST, AMO > &A, const implementation::expressions::expr< BOp, BData > &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::expressions::make_matrix_expression(A) > B))
 
template<typename AT , int ARows, int ACols, typename AST , bool AMO, typename BT , int BRows, int BCols, typename BST , bool BMO>
bool operator> (const base_matrix< AT, ARows, ACols, AST, AMO > &A, const base_matrix< BT, BRows, BCols, BST, BMO > &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::expressions::make_matrix_expression(A) > implementation::expressions::make_matrix_expression(B)))
 Tests A and B lexicographically for A being greater than B. More...
 
template<template< typename AData > class AOp, typename AData , template< typename BData > class BOp, typename BData >
bool operator>= (const implementation::expressions::expr< AOp, AData > &A, const implementation::expressions::expr< BOp, BData > &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::comparison_impl< implementation::expressions::expr< AOp, AData >, implementation::expressions::expr< BOp, BData > >::greater_eq(A, B)))
 
template<template< typename AData > class AOp, typename AData , typename BT , int BRows, int BCols, typename BST , bool BMO>
bool operator>= (const implementation::expressions::expr< AOp, AData > &A, const base_matrix< BT, BRows, BCols, BST, BMO > &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(A >=implementation::expressions::make_matrix_expression(B)))
 
template<typename AT , int ARows, int ACols, typename AST , bool AMO, template< typename BData > class BOp, typename BData >
bool operator>= (const base_matrix< AT, ARows, ACols, AST, AMO > &A, const implementation::expressions::expr< BOp, BData > &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::expressions::make_matrix_expression(A) >=B))
 
template<typename AT , int ARows, int ACols, typename AST , bool AMO, typename BT , int BRows, int BCols, typename BST , bool BMO>
bool operator>= (const base_matrix< AT, ARows, ACols, AST, AMO > &A, const base_matrix< BT, BRows, BCols, BST, BMO > &B) PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(implementation::expressions::make_matrix_expression(A) >=implementation::expressions::make_matrix_expression(B)))
 Tests A and B lexicographically for A being greater than or equal to B. More...
 
Initializers.
template<typename S >
implementation::Initialize_Impl
< S, false > 
Initialize (const S &ref) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Creates an initializer object to initialize with the given reference. More...
 
template<typename S >
implementation::Initialize_Impl
< S, true > 
Initialize () PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(S()))
 Creates an initializer object to default-initialize with type S. More...
 
Stream input/output
template<typename MatrixType , bool forceGeneric>
void print_matrix (std::ostream &s, const MatrixType &mat)
 Prints the given matrix mat to the output stream s. More...
 
template<typename MatrixType >
void print_matrix (std::ostream &s, const MatrixType &mat, bool forceGeneric=false)
 Prints the given matrix mat to the output stream s. More...
 
template<typename T , int Rows, int Cols, typename ST , bool MO>
std::ostream & operator<< (std::ostream &s, const base_matrix< T, Rows, Cols, ST, MO > &mat)
 Prints the given matrix mat to the output stream s. More...
 
template<template< typename DataType > class Operator, typename Data >
std::ostream & operator<< (std::ostream &s, const implementation::expressions::expr< Operator, Data > &mat)
 Prints the given matrix mat to the output stream s. More...
 
template<typename MatrixType >
bool scan_matrix (std::istream &s, MatrixType &mat)
 Reads a matrix from the input stream s and stores it in mat. More...
 
template<typename MatrixType >
bool scan_matrix (std::istream &s, const MatrixType &mat)
 Reads a matrix from the input stream s and stores it in mat. More...
 
template<typename MatrixType , typename T >
bool scan_matrix (std::istream &s, MatrixType &mat, const T &default_object)
 Reads a matrix from the input stream s and stores it in mat. More...
 
template<typename MatrixType , typename T >
bool scan_matrix (std::istream &s, const MatrixType &mat, const T &default_object)
 Reads a matrix from the input stream s and stores it in mat. More...
 
template<typename T , int Rows, int Cols, typename ST , bool MO>
std::istream & operator>> (std::istream &s, base_matrix< T, Rows, Cols, ST, MO > &mat)
 Reads a matrix from the input stream s and stores it in mat. More...
 
template<template< typename DataType > class Op, typename Data >
std::istream & operator>> (std::istream &s, const implementation::expressions::expr< Op, Data > &mat)
 Reads a matrix from the input stream s and stores it in mat. More...
 

Detailed Description

Contains the matrix and vector library as long as other linear algebra functionality.

The plll::linalg namespace contains the matrix and vector library as long as other linear algebra functionality of plll.

Typedef Documentation

typedef unsigned int plll::linalg::size_type

Type used for indices and sizes.

Definition at line 141 of file matrix.hpp.

Enumeration Type Documentation

anonymous enum
Enumerator
Flexible 

Identifier to make number of rows and/or columns flexible instead of determined at compile time.

Definition at line 72 of file matrix.hpp.

Function Documentation

template<typename T , int Rows, int Cols, typename ST , typename MT1 , typename MT2 >
void plll::linalg::add ( base_matrix< T, Rows, Cols, ST, true > &  result,
const MT1 &  A,
const MT2 &  B 
)
noexcept

Computes the sum of A and B and stores the result in result.

Parameters
resultThe variable to store the result in.
AThe first operand. Must be a matrix.
BThe second operand. Must be a matrix.

Definition at line 774 of file matrix-ops2.hpp.

template<typename T , int Rows, int Cols, typename ST , typename T1 , typename T2 >
void plll::linalg::addmul ( base_matrix< T, Rows, Cols, ST, true > &  A,
const T1 &  B,
const T2 &  C 
)

Computes A += B * C.

Parameters
AThe variable to add the product to.
BThe first operand of the product.
CThe second operand of the product.

Definition at line 1380 of file matrix-ops2.hpp.

template<template< typename SourceData > class SourceOp, typename SourceData , template< typename DestData > class DestOp, typename DestData , bool move>
void plll::linalg::assign ( const implementation::expressions::expr< DestOp, DestData > &  destination,
const implementation::expressions::expr< SourceOp, SourceData > &  source,
helper::BoolToType< move >  ittm 
)

Assigns the content of matrix source to matrix destination. Allows to force move.

Parameters
sourceSource matrix, whose contents are copied.
destinationDestination matrix, where the contents of the source matrix are stored.
ittmIndicates whether a copy or move (if possible) should be executed.

Definition at line 251 of file matrix-ops2.hpp.

template<template< typename SourceData > class SourceOp, typename SourceData , template< typename DestData > class DestOp, typename DestData >
void plll::linalg::assign ( const implementation::expressions::expr< DestOp, DestData > &  destination,
const implementation::expressions::expr< SourceOp, SourceData > &  source 
)
inline

Assigns the content of matrix source to matrix destination.

Parameters
sourceSource matrix, whose contents are copied.
destinationDestination matrix, where the contents of the source matrix are stored.

Definition at line 278 of file matrix-ops2.hpp.

template<typename SourceT , int SourceRows, int SourceCols, typename SourceST , bool SourceMO, template< typename DestData > class DestOp, typename DestData >
void plll::linalg::assign ( const implementation::expressions::expr< DestOp, DestData > &  destination,
const base_matrix< SourceT, SourceRows, SourceCols, SourceST, SourceMO > &  source 
)
inline

Assigns the content of matrix source to matrix destination.

Parameters
sourceSource matrix, whose contents are copied.
destinationDestination matrix, where the contents of the source matrix are stored.

Definition at line 285 of file matrix-ops2.hpp.

template<template< typename SourceData > class SourceOp, typename SourceData , typename DestT , int DestRows, int DestCols, typename DestST , bool DestMO>
void plll::linalg::assign ( base_matrix< DestT, DestRows, DestCols, DestST, DestMO > &  destination,
const implementation::expressions::expr< SourceOp, SourceData > &  source 
)
inline

Assigns the content of matrix source to matrix destination.

Parameters
sourceSource matrix, whose contents are copied.
destinationDestination matrix, where the contents of the source matrix are stored.

Definition at line 293 of file matrix-ops2.hpp.

template<typename SourceT , int SourceRows, int SourceCols, typename SourceST , bool SourceMO, typename DestT , int DestRows, int DestCols, typename DestST , bool DestMO>
void plll::linalg::assign ( base_matrix< DestT, DestRows, DestCols, DestST, DestMO > &  destination,
const base_matrix< SourceT, SourceRows, SourceCols, SourceST, SourceMO > &  source 
)
inline

Assigns the content of matrix source to matrix destination.

Parameters
sourceSource matrix, whose contents are copied.
destinationDestination matrix, where the contents of the source matrix are stored.

Definition at line 302 of file matrix-ops2.hpp.

template<typename AT , int ARows, int ACols, typename AST , bool AMO, typename BT , int BRows, int BCols, typename BST , bool BMO>
int plll::linalg::compare ( const base_matrix< AT, ARows, ACols, AST, AMO > &  A,
const base_matrix< BT, BRows, BCols, BST, BMO > &  B 
)
inlinenoexcept

Lexicographically compares the matrices A and B.

First compares rows and columns, and then all entries. The exact procedure is described in General Operations.

Parameters
AThe first operand.
BThe second operand.
Returns
Returns a negative integer if A < B, zero if A == B and a positive integer if A > B.

Definition at line 1736 of file matrix-ops2.hpp.

template<typename T , int Rows, int Cols, typename ST , typename MT >
implementation::BinaryMatrixOperationImpl<base_matrix<T, Rows, Cols, ST, true>, MT>::CwDiv_ReturnType plll::linalg::componentwise_div ( const base_matrix< T, Rows, Cols, ST, true > &  A,
const MT &  B 
)
inlinenoexcept

Computes the componentwise division of A with B.

Parameters
AA matrix.
BA matrix.
Returns
The componentwise division of A by B.

Definition at line 496 of file matrix-ops2.hpp.

template<typename T , int Rows, int Cols, typename ST , typename MT1 , typename MT2 >
void plll::linalg::componentwise_div ( base_matrix< T, Rows, Cols, ST, true > &  result,
const MT1 &  A,
const MT2 &  B 
)
noexcept

Computes the componentwise division of A by B and stores the result in result.

Parameters
resultThe variable to store the result in.
AThe first operand. Must be a matrix.
BThe second operand. Must be a matrix.

Definition at line 744 of file matrix-ops2.hpp.

template<typename T , int Rows, int Cols, typename ST , typename MT >
implementation::BinaryMatrixOperationImpl<base_matrix<T, Rows, Cols, ST, true>, MT>::CwMod_ReturnType plll::linalg::componentwise_mod ( const base_matrix< T, Rows, Cols, ST, true > &  A,
const MT &  B 
)
inlinenoexcept

Computes the componentwise modulo of A with B.

Parameters
AA matrix.
BA matrix.
Returns
The componentwise modulo of A by B.

Definition at line 512 of file matrix-ops2.hpp.

template<typename T , int Rows, int Cols, typename ST , typename MT1 , typename MT2 >
void plll::linalg::componentwise_mod ( base_matrix< T, Rows, Cols, ST, true > &  result,
const MT1 &  A,
const MT2 &  B 
)
noexcept

Computes the componentwise modulo of A by B and stores the result in result.

Parameters
resultThe variable to store the result in.
AThe first operand. Must be a matrix.
BThe second operand. Must be a matrix.

Definition at line 759 of file matrix-ops2.hpp.

template<typename T , int Rows, int Cols, typename ST , typename MT >
implementation::BinaryMatrixOperationImpl<base_matrix<T, Rows, Cols, ST, true>, MT>::CwMul_ReturnType plll::linalg::componentwise_mul ( const base_matrix< T, Rows, Cols, ST, true > &  A,
const MT &  B 
)
inlinenoexcept

Computes the componentwise multiplication of A with B.

Parameters
AA matrix.
BA matrix.
Returns
The componentwise multiplication of A and B.

Definition at line 480 of file matrix-ops2.hpp.

template<typename T , int Rows, int Cols, typename ST , typename MT1 , typename MT2 >
void plll::linalg::componentwise_mul ( base_matrix< T, Rows, Cols, ST, true > &  result,
const MT1 &  A,
const MT2 &  B 
)
noexcept

Computes the componentwise product of A and B and stores the result in result.

Parameters
resultThe variable to store the result in.
AThe first operand. Must be a matrix.
BThe second operand. Must be a matrix.

Definition at line 728 of file matrix-ops2.hpp.

arithmetic::Integer plll::linalg::det ( const math_matrix< arithmetic::Integer > &  A)

Computes the determinant of an integer matrix A.

It does this by first finding an upper bound on it, then computing the determinant modulo many small primes, and finally recovering the result using an effective version of the Chinese Remainder Theorem.

Parameters
AThe matrix whose determinant should be computed. Must be square.
Returns
The determinant of the matrix.
template<typename T , int Rows, int Cols, typename ST , typename MT1 , typename MT2 >
void plll::linalg::div ( base_matrix< T, Rows, Cols, ST, true > &  result,
const MT1 &  A,
const MT2 &  B 
)
noexcept

Computes the componentwise division of A by B and stores the result in result.

Parameters
resultThe variable to store the result in.
AThe first operand. Must be a matrix.
BThe second operand. Must be a scalar.

Definition at line 697 of file matrix-ops2.hpp.

template<typename RetType , typename T , int Rows, int Cols, typename ST , typename MT >
void plll::linalg::dot ( RetType &  result,
const base_matrix< T, Rows, Cols, ST, true > &  A,
const MT &  B 
)
noexcept

Computes the dot product of A and B and stores the result in result.

What this does is componentwise multiplying A and B and then calling sum() of the resulting matrix.

Parameters
resultA scalar where to compute the result in.
AThe first operand.
BThe second operand.

Definition at line 1223 of file matrix-ops2.hpp.

template<typename T , int Rows, int Cols, typename ST , typename MT >
implementation::DotImpl<base_matrix<T, Rows, Cols, ST, true>, MT>::RetValue plll::linalg::dot ( const base_matrix< T, Rows, Cols, ST, true > &  A,
const MT &  B 
)
noexcept

Computes the dot product of A and B and returns the result.

What this does is componentwise multiplying A and B and then calling sum() of the resulting matrix.

Returns
A scalar whose value is the dot product of A and B.
Parameters
AThe first operand.
BThe second operand.

Definition at line 1241 of file matrix-ops2.hpp.

unsigned plll::linalg::hnf ( math_matrix< arithmetic::Integer > &  A)

Computes the Hermite Normal Form (HNF) of the given matrix A by applying row operations.

The resulting HNF is an upper triangular matrix, with all zero rows moved to the bottom. Note that the matrix in A is modified. The algorithm returns the rank of A.

Implements the 1996 algorithm by Storjohann and Labahn [20].

Parameters
AThe matrix to compute the HNF of. This matrix is modified.
Returns
The rank of A.
unsigned plll::linalg::hnf ( math_matrix< arithmetic::Integer > &  A,
math_matrix< arithmetic::Integer > &  T 
)

Computes the Hermite Normal Form (HNF) of the given matrix A by applying row operations, together with a transformation matrix T.

The resulting HNF is an upper triangular matrix, with all zero rows moved to the bottom. Note that the matrices in A and T are modified. The algorithm returns the rank of A, and the resulting T satisfies $T \cdot A_{original} = A_{HNF}$.

Implements the 1996 algorithm by Storjohann and Labahn [20].

Parameters
AThe matrix to compute the HNF of. This matrix is modified.
TThe matrix where the transformation matrix is stored in.
Returns
The rank of A.
template<typename S >
implementation::Initialize_Impl<S, false> plll::linalg::Initialize ( const S &  ref)
inline

Creates an initializer object to initialize with the given reference.

Template Parameters
SThe type of the object to initialize with.
Parameters
refThe object to initialize with.
Returns
An initializer object.

Definition at line 123 of file matrix.hpp.

template<typename S >
implementation::Initialize_Impl<S, true> plll::linalg::Initialize ( )
inlinenoexcept

Creates an initializer object to default-initialize with type S.

Template Parameters
SThe type of the object to default-initialize with.
Returns
An initializer object.

Definition at line 135 of file matrix.hpp.

void plll::linalg::invert ( math_matrix< arithmetic::Integer > &  inverse,
const math_matrix< arithmetic::Integer > &  A,
const arithmetic::Integer &  startPrime = arithmetic::Integer() 
)

Assumes that A is invertible. Inverts the matrix A and stores the result in inverse.

In case no solution exists, the algorithm might not terminate. The algorithm uses p-adic methods by first finding a prime p not dividing the determinant of A. If special knowledge of the determinant is available, a prime not dividing it can be specified as the startPrime parameter.

Parameters
inverseA matrix where the inverse is stored in.
AThe matrix to invert.
startPrimeThe prime to start at. If given, should not be much less than a prime not dividing the determinant of A.
math_matrix<arithmetic::Integer> plll::linalg::kernel ( const math_matrix< arithmetic::Integer > &  A)

Computes a $\mathbb{Z}$-basis of the right-kernel of A.

The right-kernel of A is the $\mathbb{Z}$-module $\{ v \mid A v = 0 \}$. A basis is a set of vectors from the kernel such that every vector in the kernel can be uniquely written as a linear combination of these vectors.

Parameters
AThe matrix to compute the kernel of.
Returns
A matrix whose columns form a basis of the kernel of A.
template<typename T , int Rows, int Cols, typename ST , typename MT1 , typename MT2 >
void plll::linalg::mod ( base_matrix< T, Rows, Cols, ST, true > &  result,
const MT1 &  A,
const MT2 &  B 
)
noexcept

Computes the componentwise modulo of A by B and stores the result in result.

Parameters
resultThe variable to store the result in.
AThe first operand. Must be a matrix.
BThe second operand. Must be a scalar.

Definition at line 712 of file matrix-ops2.hpp.

template<typename T , int Rows, int Cols, typename ST , typename MT1 , typename MT2 >
void plll::linalg::mul ( base_matrix< T, Rows, Cols, ST, true > &  result,
const MT1 &  A,
const MT2 &  B 
)
noexcept

Computes the product of A and B and stores the result in result.

Parameters
resultThe variable to store the result in.
AThe first operand.
BThe second operand.

Definition at line 681 of file matrix-ops2.hpp.

template<typename T , int Rows, int Cols, typename ST , typename MT >
void plll::linalg::neg ( base_matrix< T, Rows, Cols, ST, true > &  result,
const MT &  A 
)
noexcept

Computes the negation of A and stores the result in result.

Parameters
resultThe variable to store the result in.
AThe operand. Must be a matrix.

Definition at line 803 of file matrix-ops2.hpp.

template<typename RetType , typename T , int Rows, int Cols, typename ST >
void plll::linalg::normSq ( RetType &  result,
const base_matrix< T, Rows, Cols, ST, true > &  A 
)
noexcept

Computes the squared norm of A, i.e. the sum of the squares of all entries of A, and stores the result in result.

Parameters
resultA scalar where to compute the result in.
AThe matrix whose square norm to compute.

Definition at line 1332 of file matrix-ops2.hpp.

template<typename T , int Rows, int Cols, typename ST >
implementation::NormSqImpl<base_matrix<T, Rows, Cols, ST, true> >::RetValue plll::linalg::normSq ( const base_matrix< T, Rows, Cols, ST, true > &  A)
noexcept

Computes the squared norm of A, i.e. the sum of the squares of all entries of A, and returns the result.

Returns
A scalar whose value is the squared norm of A.
Parameters
AThe matrix whose square norm to compute.

Definition at line 1347 of file matrix-ops2.hpp.

template<typename AT , int ARows, int ACols, typename AST , bool AMO, typename BT , int BRows, int BCols, typename BST , bool BMO>
bool plll::linalg::operator!= ( const base_matrix< AT, ARows, ACols, AST, AMO > &  A,
const base_matrix< BT, BRows, BCols, BST, BMO > &  B 
)
inlinenoexcept

Tests A and B for inequality.

Parameters
AThe first operand.
BThe second operand.
Returns
Returns false if and only if A and B have the same format and the same entries.

Definition at line 1820 of file matrix-ops2.hpp.

template<typename T , int Rows, int Cols, typename ST , typename MT >
implementation::BinaryMatrixOperationImpl<base_matrix<T, Rows, Cols, ST, true>, MT>::Mod_ReturnType plll::linalg::operator% ( const base_matrix< T, Rows, Cols, ST, true > &  A,
const MT &  B 
)
inlinenoexcept

Computes the componentwise modulo of A with the scalar B.

Parameters
AA matrix.
BA scalar.
Returns
The componentwise modulo of A by B.

Definition at line 464 of file matrix-ops2.hpp.

template<typename T , int Rows, int Cols, typename ST , typename MT >
base_matrix<T, Rows, Cols, ST, true>& plll::linalg::operator%= ( base_matrix< T, Rows, Cols, ST, true > &  A,
const MT &  B 
)
inlinenoexcept

Takes the current matrix modulo the scalar B and stores the result in the current matrix.

Parameters
AThe current matrix.
BThe scalar to mod by.
Returns
A reference to the current matrix.

Definition at line 967 of file matrix-ops2.hpp.

template<typename T , int Rows, int Cols, typename ST , typename MT >
implementation::BinaryMatrixOperationImpl<base_matrix<T, Rows, Cols, ST, true>, MT>::Mul_ReturnType plll::linalg::operator* ( const base_matrix< T, Rows, Cols, ST, true > &  A,
const MT &  B 
)
inlinenoexcept

Computes the product of A with B.

Parameters
AA matrix.
BA matrix or scalar.
Returns
The product of A and B.

Definition at line 416 of file matrix-ops2.hpp.

template<typename T , int Rows, int Cols, typename ST >
implementation::BinaryMatrixOperationImpl<T, base_matrix<T, Rows, Cols, ST, true> >::Mul_ReturnType plll::linalg::operator* ( const T &  A,
const base_matrix< T, Rows, Cols, ST, true > &  B 
)
inlinenoexcept

Computes the product of A with B.

Parameters
AA scalar.
BA matrix.
Returns
The product of A and B.

Definition at line 432 of file matrix-ops2.hpp.

template<typename T , int Rows, int Cols, typename ST , typename MT >
base_matrix<T, Rows, Cols, ST, true>& plll::linalg::operator*= ( base_matrix< T, Rows, Cols, ST, true > &  A,
const MT &  B 
)
inlinenoexcept

Multiplies the current matrix with B and stores the result in the current matrix.

Parameters
AThe current matrix.
BThe matrix or scalar to multiply with.
Returns
A reference to the current matrix.

Definition at line 934 of file matrix-ops2.hpp.

template<typename T , int Rows, int Cols, typename ST , typename MT >
implementation::BinaryMatrixOperationImpl<base_matrix<T, Rows, Cols, ST, true>, MT>::Add_ReturnType plll::linalg::operator+ ( const base_matrix< T, Rows, Cols, ST, true > &  A,
const MT &  B 
)
inlinenoexcept

Computes the sum of A and B.

Parameters
AA matrix.
BA matrix.
Returns
The sum of A and B.

Definition at line 528 of file matrix-ops2.hpp.

template<typename T , int Rows, int Cols, typename ST , typename MT >
base_matrix<T, Rows, Cols, ST, true>& plll::linalg::operator+= ( base_matrix< T, Rows, Cols, ST, true > &  A,
const MT &  B 
)
inlinenoexcept

Adds B to the current matrix.

Parameters
AThe current matrix.
BThe matrix to add to the current matrix.
Returns
A reference to the current matrix.

Definition at line 902 of file matrix-ops2.hpp.

template<typename T , int Rows, int Cols, typename ST , typename MT >
implementation::BinaryMatrixOperationImpl<base_matrix<T, Rows, Cols, ST, true>, MT>::Sub_ReturnType plll::linalg::operator- ( const base_matrix< T, Rows, Cols, ST, true > &  A,
const MT &  B 
)
inlinenoexcept

Computes the difference of A and B.

Parameters
AA matrix.
BA matrix.
Returns
The difference of A and B.

Definition at line 544 of file matrix-ops2.hpp.

template<typename T , int Rows, int Cols, typename ST >
implementation::UnaryMatrixOperationImpl<base_matrix<T, Rows, Cols, ST, true> >::Neg_ReturnType plll::linalg::operator- ( const base_matrix< T, Rows, Cols, ST, true > &  A)
inlinenoexcept

Computes the negation of A.

Parameters
AA matrix.
Returns
The componentwise negation of A.

Definition at line 559 of file matrix-ops2.hpp.

template<typename T , int Rows, int Cols, typename ST , typename MT >
base_matrix<T, Rows, Cols, ST, true>& plll::linalg::operator-= ( base_matrix< T, Rows, Cols, ST, true > &  A,
const MT &  B 
)
inlinenoexcept

Subtracts B from the current matrix.

Parameters
AThe current matrix.
BThe matrix to subtract from the current matrix.
Returns
A reference to the current matrix.

Definition at line 918 of file matrix-ops2.hpp.

template<typename T , int Rows, int Cols, typename ST , typename MT >
implementation::BinaryMatrixOperationImpl<base_matrix<T, Rows, Cols, ST, true>, MT>::Div_ReturnType plll::linalg::operator/ ( const base_matrix< T, Rows, Cols, ST, true > &  A,
const MT &  B 
)
inlinenoexcept

Computes the componentwise division of A with the scalar B.

Parameters
AA matrix.
BA scalar.
Returns
The componentwise division of A by B.

Definition at line 448 of file matrix-ops2.hpp.

template<typename T , int Rows, int Cols, typename ST , typename MT >
base_matrix<T, Rows, Cols, ST, true>& plll::linalg::operator/= ( base_matrix< T, Rows, Cols, ST, true > &  A,
const MT &  B 
)
inlinenoexcept

Divides the current matrix by the scalar B and stores the result in the current matrix.

Parameters
AThe current matrix.
BThe scalar to divide by.
Returns
A reference to the current matrix.

Definition at line 950 of file matrix-ops2.hpp.

template<typename AT , int ARows, int ACols, typename AST , bool AMO, typename BT , int BRows, int BCols, typename BST , bool BMO>
bool plll::linalg::operator< ( const base_matrix< AT, ARows, ACols, AST, AMO > &  A,
const base_matrix< BT, BRows, BCols, BST, BMO > &  B 
)
inlinenoexcept

Tests A and B lexicographically for A being less than B.

The exact procedure is described in General Operations.

Parameters
AThe first operand.
BThe second operand.
Returns
Returns true if and only if $A < B$ lexicographically.

Definition at line 1864 of file matrix-ops2.hpp.

template<typename T , int Rows, int Cols, typename ST , bool MO>
std::ostream& plll::linalg::operator<< ( std::ostream &  s,
const base_matrix< T, Rows, Cols, ST, MO > &  mat 
)
inline

Prints the given matrix mat to the output stream s.

Parameters
sAn output stream.
matThe matrix to print.
See also
Input and Output

Definition at line 4175 of file matrix.hpp.

template<template< typename DataType > class Operator, typename Data >
std::ostream& plll::linalg::operator<< ( std::ostream &  s,
const implementation::expressions::expr< Operator, Data > &  mat 
)
inline

Prints the given matrix mat to the output stream s.

Parameters
sAn output stream.
matThe matrix to print.
See also
Input and Output

Definition at line 4191 of file matrix.hpp.

template<typename AT , int ARows, int ACols, typename AST , bool AMO, typename BT , int BRows, int BCols, typename BST , bool BMO>
bool plll::linalg::operator<= ( const base_matrix< AT, ARows, ACols, AST, AMO > &  A,
const base_matrix< BT, BRows, BCols, BST, BMO > &  B 
)
inlinenoexcept

Tests A and B lexicographically for A being less than or equal to B.

The exact procedure is described in General Operations.

Parameters
AThe first operand.
BThe second operand.
Returns
Returns true if and only if $A \le B$ lexicographically.

Definition at line 1908 of file matrix-ops2.hpp.

template<typename AT , int ARows, int ACols, typename AST , bool AMO, typename BT , int BRows, int BCols, typename BST , bool BMO>
bool plll::linalg::operator== ( const base_matrix< AT, ARows, ACols, AST, AMO > &  A,
const base_matrix< BT, BRows, BCols, BST, BMO > &  B 
)
inlinenoexcept

Tests A and B for equality.

Parameters
AThe first operand.
BThe second operand.
Returns
Returns true if and only if A and B have the same format and the same entries.

Definition at line 1778 of file matrix-ops2.hpp.

template<typename AT , int ARows, int ACols, typename AST , bool AMO, typename BT , int BRows, int BCols, typename BST , bool BMO>
bool plll::linalg::operator> ( const base_matrix< AT, ARows, ACols, AST, AMO > &  A,
const base_matrix< BT, BRows, BCols, BST, BMO > &  B 
)
inlinenoexcept

Tests A and B lexicographically for A being greater than B.

The exact procedure is described in General Operations.

Parameters
AThe first operand.
BThe second operand.
Returns
Returns true if and only if $A > B$ lexicographically.

Definition at line 1952 of file matrix-ops2.hpp.

template<typename AT , int ARows, int ACols, typename AST , bool AMO, typename BT , int BRows, int BCols, typename BST , bool BMO>
bool plll::linalg::operator>= ( const base_matrix< AT, ARows, ACols, AST, AMO > &  A,
const base_matrix< BT, BRows, BCols, BST, BMO > &  B 
)
inlinenoexcept

Tests A and B lexicographically for A being greater than or equal to B.

The exact procedure is described in General Operations.

Parameters
AThe first operand.
BThe second operand.
Returns
Returns true if and only if $A \ge B$ lexicographically.

Definition at line 1996 of file matrix-ops2.hpp.

template<typename T , int Rows, int Cols, typename ST , bool MO>
std::istream& plll::linalg::operator>> ( std::istream &  s,
base_matrix< T, Rows, Cols, ST, MO > &  mat 
)
inline

Reads a matrix from the input stream s and stores it in mat.

In case of an error, the std::ios_base::bad_bit flag of s is set.

Parameters
sAn input stream.
matWhere to store the scanned matrix in.
See also
Input and Output

Definition at line 4519 of file matrix.hpp.

template<template< typename DataType > class Op, typename Data >
std::istream& plll::linalg::operator>> ( std::istream &  s,
const implementation::expressions::expr< Op, Data > &  mat 
)
inline

Reads a matrix from the input stream s and stores it in mat.

In case of an error, the std::ios_base::bad_bit flag of s is set.

Parameters
sAn input stream.
matWhere to store the scanned matrix in.
See also
Input and Output

Definition at line 4538 of file matrix.hpp.

template<typename MatrixType , bool forceGeneric>
void plll::linalg::print_matrix ( std::ostream &  s,
const MatrixType &  mat 
)
inline

Prints the given matrix mat to the output stream s.

Template Parameters
forceGenericIf true, always does the output in the mat<r,c>[...] format. If false, uses the vec<r>[...] format for column vectors.
Parameters
sAn output stream.
matThe matrix to print.
See also
Input and Output

Definition at line 4138 of file matrix.hpp.

template<typename MatrixType >
void plll::linalg::print_matrix ( std::ostream &  s,
const MatrixType &  mat,
bool  forceGeneric = false 
)
inline

Prints the given matrix mat to the output stream s.

Parameters
sAn output stream.
matThe matrix to print.
forceGenericIf true, always does the output in the mat<r,c>[...] format. If false, uses the vec<r>[...] format for column vectors. The default value is false.
See also
Input and Output

Definition at line 4157 of file matrix.hpp.

template<typename MatrixType >
bool plll::linalg::scan_matrix ( std::istream &  s,
MatrixType &  mat 
)
inline

Reads a matrix from the input stream s and stores it in mat.

Parameters
sAn input stream.
matWhere to store the scanned matrix in.
Returns
Returns true if the matrix could be successfully read, or `false if an error occured.
See also
Input and Output

Definition at line 4439 of file matrix.hpp.

template<typename MatrixType >
bool plll::linalg::scan_matrix ( std::istream &  s,
const MatrixType &  mat 
)
inline

Reads a matrix from the input stream s and stores it in mat.

Parameters
sAn input stream.
matWhere to store the scanned matrix in.
Returns
Returns true if the matrix could be successfully read, or `false if an error occured.
See also
Input and Output

Definition at line 4458 of file matrix.hpp.

template<typename MatrixType , typename T >
bool plll::linalg::scan_matrix ( std::istream &  s,
MatrixType &  mat,
const T &  default_object 
)
inline

Reads a matrix from the input stream s and stores it in mat.

Parameters
sAn input stream.
matWhere to store the scanned matrix in.
default_objectThe default object to use to initialize new elements. Could be a context.
Returns
Returns true if the matrix could be successfully read, or false if an error occured.
See also
Input and Output

Definition at line 4479 of file matrix.hpp.

template<typename MatrixType , typename T >
bool plll::linalg::scan_matrix ( std::istream &  s,
const MatrixType &  mat,
const T &  default_object 
)
inline

Reads a matrix from the input stream s and stores it in mat.

Parameters
sAn input stream.
matWhere to store the scanned matrix in.
default_objectThe default object to use to initialize new elements. Could be a context.
Returns
Returns true if the matrix could be successfully read, or false if an error occured.
See also
Input and Output

Definition at line 4500 of file matrix.hpp.

std::pair<math_colvector<arithmetic::Integer>, arithmetic::Integer> plll::linalg::solve ( const math_matrix< arithmetic::Integer > &  A,
const math_colvector< arithmetic::Integer > &  b 
)

Solves the linear system A * x == b over the rationals.

Determines the minimal positive integer t such that A * x == t * b is solvable with an integral vector x, and returns t together with an arbitrary such solution x; the quotient x/t is then a "minimal" solution.

In case no solution exists, it returns a random vector together with the integer 0.

Parameters
AThe left-hand side of the linear equations.
bThe right-hand side of the linear equations.
Returns
A pair (x, t) such that A * x == t * b with t > 0 minimal such that such an x exists.
math_colvector<arithmetic::Integer> plll::linalg::solveInt ( const math_matrix< arithmetic::Integer > &  A,
const math_colvector< arithmetic::Integer > &  w 
)

Assumes that the linear system A * v == w has a solution in the integers. Finds this solution.

This algorithm essentially uses plll::linalg::solveUniqInt() and might also not terminate in case no solution exists.

Parameters
AThe left-hand side of the linear equations.
wThe right-hand side of the linear equations.
Returns
A vector res such that A * res == b.
math_matrix<arithmetic::Integer> plll::linalg::solveUniqInt ( const math_matrix< arithmetic::Integer > &  A,
const math_matrix< arithmetic::Integer > &  w,
const arithmetic::Integer &  startPrime = arithmetic::Integer() 
)

Assumes that A is a square matrix and that the equation A * res == w has a unique solutions in the integers. Returns the.

Note that the assumption is the case if and only if det(A) != 0. solution res.

In case no solution exists, the algorithm might not terminate. The algorithm uses p-adic methods by first finding a prime p not dividing the determinant of A. If special knowledge of the determinant is available, a prime not dividing it can be specified as the startPrime parameter.

Note that w and thus also res need not to be vectors, but can also be matrices with any number of columns.

Parameters
AThe left-hand side of the linear equations.
wThe right-hand side of the linear equations.
startPrimeThe prime to start at. If given, should not be much less than a prime not dividing the determinant of A.
Returns
A solution res to A * res == w.
template<typename T , int Rows, int Cols, typename ST , typename MT1 , typename MT2 >
void plll::linalg::sub ( base_matrix< T, Rows, Cols, ST, true > &  result,
const MT1 &  A,
const MT2 &  B 
)
noexcept

Computes the difference of A and B and stores the result in result.

Parameters
resultThe variable to store the result in.
AThe first operand. Must be a matrix.
BThe second operand. Must be a matrix.

Definition at line 789 of file matrix-ops2.hpp.

template<typename T , int Rows, int Cols, typename ST , typename T1 , typename T2 >
void plll::linalg::submul ( base_matrix< T, Rows, Cols, ST, true > &  A,
const T1 &  B,
const T2 &  C 
)

Computes A -= B * C.

Parameters
AThe variable to subtract the product from.
BThe first operand of the product.
CThe second operand of the product.

Definition at line 1394 of file matrix-ops2.hpp.

template<typename RetType , typename T , int Rows, int Cols, typename ST >
void plll::linalg::sum ( RetType &  result,
const base_matrix< T, Rows, Cols, ST, true > &  A 
)
noexcept

Computes the sum of all entries of A and stores the result in result.

Parameters
resultA scalar where to compute the result in.
AThe matrix whose entries to sum up.

Definition at line 1093 of file matrix-ops2.hpp.

template<typename T , int Rows, int Cols, typename ST >
implementation::SumImpl<base_matrix<T, Rows, Cols, ST, true> >::RetValue plll::linalg::sum ( const base_matrix< T, Rows, Cols, ST, true > &  A)
noexcept

Computes the sum of all entries of A and returns the result.

Returns
A scalar whose value is the sum of all entries of A.
Parameters
AThe matrix whose entries to sum up.

Definition at line 1107 of file matrix-ops2.hpp.

template<typename T , int R, int C, typename ST , bool MO>
void plll::linalg::swap ( base_matrix< T, R, C, ST, MO > &  A,
base_matrix< T, R, C, ST, MO > &  B 
)

Swaps matrices A and B efficiently.

Parameters
AFirst matrix.
BSecond matrix.

Definition at line 49 of file matrix-ops2.hpp.

template<typename T , int R1, int C1, int R2, int C2, typename ST , bool MO1, bool MO2>
void plll::linalg::swap ( base_matrix< T, R1, C1, ST, MO1 > &  A,
base_matrix< T, R2, C2, ST, MO2 > &  B 
)

Swaps matrices A and B efficiently.

Parameters
AFirst matrix.
BSecond matrix.

Definition at line 58 of file matrix-ops2.hpp.

template<template< typename AData > class AOp, typename AData , template< typename BData > class BOp, typename BData >
void plll::linalg::swap ( const implementation::expressions::expr< AOp, AData > &  A,
const implementation::expressions::expr< BOp, BData > &  B 
)
noexcept

Swaps matrices A and B componentwise.

Parameters
AFirst matrix.
BSecond matrix.

Definition at line 103 of file matrix-ops2.hpp.

template<template< typename AData > class AOp, typename AData , typename BT , int BRows, int BCols, typename BST , bool BMO>
void plll::linalg::swap ( const implementation::expressions::expr< AOp, AData > &  A,
base_matrix< BT, BRows, BCols, BST, BMO > &  B 
)
noexcept

Swaps matrices A and B componentwise.

Parameters
AFirst matrix.
BSecond matrix.

Definition at line 111 of file matrix-ops2.hpp.

template<typename AT , int ARows, int ACols, typename AST , bool AMO, template< typename BData > class BOp, typename BData >
void plll::linalg::swap ( base_matrix< AT, ARows, ACols, AST, AMO > &  A,
const implementation::expressions::expr< BOp, BData > &  B 
)
noexcept

Swaps matrices A and B componentwise.

Parameters
AFirst matrix.
BSecond matrix.

Definition at line 119 of file matrix-ops2.hpp.

template<typename T , int ARows, int ACols, typename AST , bool AMO, int BRows, int BCols, typename BST , bool BMO>
void plll::linalg::swap ( base_matrix< T, ARows, ACols, AST, AMO > &  A,
base_matrix< T, BRows, BCols, BST, BMO > &  B 
)
noexcept

Swaps matrices A and B componentwise.

Parameters
AFirst matrix.
BSecond matrix.

Definition at line 128 of file matrix-ops2.hpp.

template<template< typename SourceData > class SourceOp, typename SourceData , template< typename DestData > class DestOp, typename DestData , bool move>
void plll::linalg::transpose ( const implementation::expressions::expr< DestOp, DestData > &  destination,
const implementation::expressions::expr< SourceOp, SourceData > &  source,
helper::BoolToType< move >  ittm 
)
inline

Transposes the content of matrix source and stores the result in the matrix destination. Allows to force move.

Parameters
sourceSource matrix, whose contents are transposed copied.
destinationDestination matrix, where the contents of the transposed source matrix are stored.
ittmIndicates whether a copy or move (if possible) should be executed.

Definition at line 337 of file matrix-ops2.hpp.

template<template< typename SourceData > class SourceOp, typename SourceData , template< typename DestData > class DestOp, typename DestData >
void plll::linalg::transpose ( const implementation::expressions::expr< DestOp, DestData > &  destination,
const implementation::expressions::expr< SourceOp, SourceData > &  source 
)
inline

Transposes the content of matrix source and stores the result in the matrix destination.

Parameters
sourceSource matrix, whose contents are transposed copied.
destinationDestination matrix, where the contents of the transposed source matrix are stored.

Definition at line 347 of file matrix-ops2.hpp.

template<typename SourceT , int SourceRows, int SourceCols, typename SourceST , bool SourceMO, template< typename DestData > class DestOp, typename DestData >
void plll::linalg::transpose ( const implementation::expressions::expr< DestOp, DestData > &  destination,
const base_matrix< SourceT, SourceRows, SourceCols, SourceST, SourceMO > &  source 
)
inline

Transposes the content of matrix source and stores the result in the matrix destination.

Parameters
sourceSource matrix, whose contents are transposed copied.
destinationDestination matrix, where the contents of the transposed source matrix are stored.

Definition at line 354 of file matrix-ops2.hpp.

template<template< typename SourceData > class SourceOp, typename SourceData , typename DestT , int DestRows, int DestCols, typename DestST , bool DestMO>
void plll::linalg::transpose ( base_matrix< DestT, DestRows, DestCols, DestST, DestMO > &  destination,
const implementation::expressions::expr< SourceOp, SourceData > &  source 
)
inline

Transposes the content of matrix source and stores the result in the matrix destination.

Parameters
sourceSource matrix, whose contents are transposed copied.
destinationDestination matrix, where the contents of the transposed source matrix are stored.

Definition at line 362 of file matrix-ops2.hpp.

template<typename SourceT , int SourceRows, int SourceCols, typename SourceST , bool SourceMO, typename DestT , int DestRows, int DestCols, typename DestST , bool DestMO>
void plll::linalg::transpose ( base_matrix< DestT, DestRows, DestCols, DestST, DestMO > &  destination,
const base_matrix< SourceT, SourceRows, SourceCols, SourceST, SourceMO > &  source 
)
inline

Transposes the content of matrix source and stores the result in the matrix destination.

Parameters
sourceSource matrix, whose contents are transposed copied.
destinationDestination matrix, where the contents of the transposed source matrix are stored.

Definition at line 371 of file matrix-ops2.hpp.