plll  1.0
matrix.hpp File Reference

The matrix and vector template library. More...

#include "helper.hpp"
#include "matrix-mem.hpp"
#include <list>
#include <cctype>
#include <iostream>
#include "matrix-ops.hpp"
#include "matrix-ops2.hpp"

Go to the source code of this file.

Classes

class  plll::linalg::base_colvector< T, Rows, StorageTraits, MO >
 Represents a column vector with coefficients in T. More...
 
class  plll::linalg::base_colvector< T, Rows, StorageTraits, MO >
 Represents a column vector with coefficients in T. More...
 
class  plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >
 Represents a matrix with coefficients in T. More...
 
class  plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >
 Represents a matrix with coefficients in T. More...
 
class  plll::linalg::base_rowvector< T, Cols, StorageTraits, MO >
 Represents a row vector with coefficients in T. More...
 
class  plll::linalg::base_rowvector< T, Cols, StorageTraits, MO >
 Represents a row vector with coefficients in T. More...
 
class  plll::linalg::implementation::col_count_storage< Cols >
 
class  plll::linalg::implementation::col_count_storage< Flexible >
 
class  plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::ColEnumerator
 An enumerator for a matrix' column. More...
 
class  plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::ColsEnumerator
 Enumerates over all columns. For every column, a ColsEnumerator::ColEnumerator object is returned which allows to enumerate over that column. More...
 
class  plll::linalg::implementation::expressions::componentwise_operation< Operation >
 
class  plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::ConstColEnumerator
 An enumerator for a matrix' column. More...
 
class  plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::ConstColsEnumerator
 Enumerates over all columns. For every column, a ConstColsEnumerator::ColEnumerator object is returned which allows to enumerate over that column. More...
 
class  plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::ConstEnumerator
 An enumerator for matrix elements. More...
 
class  plll::linalg::implementation::expressions::ConstMatrixWrapper< MatrixType >
 
class  plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::ConstRowsEnumerator
 Enumerates over all rows. For every row, a ConstRowsEnumerator::RowEnumerator object is returned which allows to enumerate over that row. More...
 
class  plll::linalg::implementation::expressions::CWAdd< OpA, OpB >
 
class  plll::linalg::implementation::expressions::CWDiv< OpA, OpB >
 
class  plll::linalg::implementation::expressions::CWMod< OpA, OpB >
 
class  plll::linalg::implementation::expressions::CWMul< OpA, OpB >
 
class  plll::linalg::implementation::expressions::CWSub< OpA, OpB >
 
class  plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::Enumerator
 An enumerator for matrix elements. More...
 
class  plll::linalg::implementation::expressions::expr< Operator, Data >
 
class  plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::GetCoeffSteps_Type
 Allows to retrieve a coefficient of the matrix in two steps. More...
 
class  plll::linalg::implementation::expressions::identity_operation< Data >
 
class  plll::linalg::implementation::Initialize_Impl< S, def >
 
class  plll::linalg::implementation::Initialize_Impl< S, false >
 
class  plll::linalg::implementation::Initialize_Impl< S, true >
 
class  plll::linalg::math_colvector< T, Rows, StorageTraits >
 Represents a math column vector with coefficients in T. More...
 
class  plll::linalg::math_colvector< T, Rows, StorageTraits >
 Represents a math column vector with coefficients in T. More...
 
class  plll::linalg::math_matrix< T, Rows, Cols, StorageTraits >
 Represents a math matrix with coefficients in T. More...
 
class  plll::linalg::math_matrix< T, Rows, Cols, StorageTraits >
 Represents a math matrix with coefficients in T. More...
 
class  plll::linalg::math_rowvector< T, Cols, StorageTraits >
 Represents a math row vector with coefficients in T. More...
 
class  plll::linalg::math_rowvector< T, Cols, StorageTraits >
 Represents a math row vector with coefficients in T. More...
 
class  plll::linalg::implementation::expressions::matrix_matrix_multiplication< PairMatrices >
 
class  plll::linalg::implementation::expressions::matrix_negation< MTIn >
 
class  plll::linalg::implementation::expressions::matrix_scalar_operation< Operation >
 
struct  plll::linalg::implementation::MatrixInfo< MatrixType >
 
struct  plll::linalg::implementation::MatrixInfo< base_colvector< T, Rows, ST, MO > >
 
struct  plll::linalg::implementation::MatrixInfo< base_matrix< T, Rows, Cols, ST, MO > >
 
struct  plll::linalg::implementation::MatrixInfo< base_rowvector< T, Cols, ST, MO > >
 
struct  plll::linalg::implementation::MatrixInfo< const base_colvector< T, Rows, ST, MO > >
 
struct  plll::linalg::implementation::MatrixInfo< const base_matrix< T, Rows, Cols, ST, MO > >
 
struct  plll::linalg::implementation::MatrixInfo< const base_rowvector< T, Cols, ST, MO > >
 
struct  plll::linalg::implementation::MatrixInfo< const expressions::expr< Operator, Data > >
 
struct  plll::linalg::implementation::MatrixInfo< const math_colvector< T, Rows, ST > >
 
struct  plll::linalg::implementation::MatrixInfo< const math_matrix< T, Rows, Cols, ST > >
 
struct  plll::linalg::implementation::MatrixInfo< const math_rowvector< T, Cols, ST > >
 
struct  plll::linalg::implementation::MatrixInfo< expressions::expr< Operator, Data > >
 
struct  plll::linalg::implementation::MatrixInfo< math_colvector< T, Rows, ST > >
 
struct  plll::linalg::implementation::MatrixInfo< math_matrix< T, Rows, Cols, ST > >
 
struct  plll::linalg::implementation::MatrixInfo< math_rowvector< T, Cols, ST > >
 
class  plll::linalg::implementation::MatrixPrinter< MatrixType, Rows, Cols, forceGeneric >
 
class  plll::linalg::implementation::MatrixPrinter< MatrixType, Rows, 1, false >
 
class  plll::linalg::implementation::MatrixScanner< MatrixType, Rows, Cols >
 
class  plll::linalg::implementation::expressions::MatrixTemporaryWrapper< MatrixType >
 
class  plll::linalg::implementation::expressions::MatrixWrapper< MatrixType >
 
class  plll::linalg::implementation::expressions::MSDiv< OpA, OpB >
 
class  plll::linalg::implementation::expressions::MSMod< OpA, OpB >
 
class  plll::linalg::implementation::expressions::MSMul< OpA, OpB >
 
class  plll::linalg::implementation::expressions::sub_1d< Dim >::operation_col< Rows >
 
class  plll::linalg::implementation::expressions::sub< Rows, Cols >::operation_generic< Rows, Cols >
 
class  plll::linalg::implementation::expressions::sub_1d< Dim >::operation_row< Cols >
 
class  plll::linalg::implementation::row_count_storage< Rows >
 
class  plll::linalg::implementation::row_count_storage< Flexible >
 
class  plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::RowsEnumerator
 Enumerates over all rows. For every row, a RowsEnumerator::RowEnumerator object is returned which allows to enumerate over that row. More...
 
class  plll::linalg::implementation::expressions::ScalarWrapper< ScalarType >
 
class  plll::linalg::implementation::expressions::SMMul< OpA, OpB >
 
class  plll::linalg::implementation::expressions::sub< Rows, Cols >
 
class  plll::linalg::implementation::expressions::sub_1d< Dim >
 
class  plll::linalg::implementation::expressions::transpose< MT >
 

Namespaces

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

Typedefs

typedef unsigned int plll::linalg::size_type
 

Enumerations

enum  { plll::linalg::Flexible = -1 }
 

Functions

Initializers.
template<typename S >
implementation::Initialize_Impl
< S, false > 
plll::linalg::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 > 
plll::linalg::Initialize () PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(S()))
 Creates an initializer object to default-initialize with type S. More...
 
Swap functions.
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) 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 plll::linalg::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 plll::linalg::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 plll::linalg::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 plll::linalg::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 plll::linalg::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 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. More...
 
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)
 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 plll::linalg::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 plll::linalg::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 plll::linalg::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 plll::linalg::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 plll::linalg::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 plll::linalg::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 plll::linalg::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 plll::linalg::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...
 
Stream input/output
template<typename MatrixType , bool forceGeneric>
void plll::linalg::print_matrix (std::ostream &s, const MatrixType &mat)
 Prints the given matrix mat to the output stream s. More...
 
template<typename MatrixType >
void plll::linalg::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 & plll::linalg::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 & plll::linalg::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 plll::linalg::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 plll::linalg::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 plll::linalg::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 plll::linalg::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 & plll::linalg::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 & plll::linalg::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

The matrix and vector template library.

This header provides the matrix and vector template library for plll. It declares the main templates and includes the other header files related to the library. See Matrices and Vectors for documentation of the matrix and vector library.

Definition in file matrix.hpp.