linbox
DenseMat< _Element > Class Template Reference

to be used in standard matrix domain More...

#include <dense-matrix.h>

+ Inheritance diagram for DenseMat< _Element >:

Data Structures

struct  rebind
 

Public Types

typedef SubMatIterator< _Element > RawIterator
 
typedef ConstSubMatIterator< _Element > ConstRawIterator
 
typedef DenseMat< _Element > Self_t
 Self type.
 

Public Member Functions

size_t rowdim () const
 
size_t coldim () const
 
Entry & getEntry (Entry &x, size_t i, size_t j) const
 
Entry & setEntry (size_t i, size_t j, const Entry &x)
 
 DenseMat ()
 
void init (size_t m=0, size_t n=0)
 
void init (size_t m, size_t n, const Entry &filler)
 
 DenseMat (const DenseMat &A)
 
 ~DenseMat ()
 
DenseMatoperator= (const DenseMat &B)
 
void submatrix (const DenseMat &A, size_t i, size_t j, size_t m, size_t n)
 Set this to be an m by n submatrix of A with upper left corner at i,j position of A.
 
void size (size_t m, size_t n)
 
template<class vp>
int did_swapback (vp &swaps, size_t hot, size_t l, size_t r)
 
template<class vp>
void flocs (vp &tos, vp &swaps)
 
template<class vp>
size_t final_loc (vp &swaps, size_t j)
 
void randomColPermutation ()
 
void randomLowerTriangularColTransform ()
 
RawIterator rawBegin ()
 
RawIterator rawEnd ()
 
RawIterator rowBegin (size_t i)
 
RawIterator rowEnd (size_t i)
 
ConstRawIterator rawBegin () const
 
ConstRawIterator rawEnd () const
 
ConstRawIterator rowBegin (size_t i) const
 
ConstRawIterator rowEnd (size_t i) const
 
template<class Field>
std::istream & read (std::istream &file, const Field &field)
 Read the matrix from an input stream.
 
template<class Field>
std::ostream & write (std::ostream &os, const Field &field, bool mapleFormat=false) const
 Write the matrix to an output stream.
 
std::ostream & write (std::ostream &os, bool mapleFormat=false) const
 Write the matrix to an output stream.
 

Data Fields

Entry * _rep
 
bool _alloc
 
size_t _rows
 
size_t _cols
 
size_t _stride
 

Detailed Description

template<class _Element>
class LinBox::DenseMat< _Element >

to be used in standard matrix domain

Matrix variable declaration, sizing, entry initialization may involve one to 3 steps. Matrix ops are container ops. (sizing, copying)
Mathematically meaningful operations are to be found only in an associated matrix domain

A matrix may be allocated or not. A matrix initialized by a submatrix() call is not allocated. When an allocated matrix goes out of scope or is reinitialized with init(), the memory is released and all submatrices of it become invalid.

Allocating: DenseMat A(2, 3); // allocation of mem for 6 entries at construction DenseMat B; B.init(10, 10); // default constr and subsequent allocation for 100 entries.

Allocation of memory plus entry initialization: // a meaningful value of DenseMat::Entry x is set by a field or matrix domain. DenseMat A(10, 10, x); DenseMat B: B.init(10, 10, x); DenseMat C(A); // allocation at copy construction. A could be a submatrix of another. A.read(istream)

Nonallocation sizing: // assume D declared, A initialized, n = A.coldim(). D.submatrix(A, 0, 1, 2, n-1); // D is 2 by n-1 in upper right of A.

Entry initialization (and overwriting) in already sized matrices: A.setEntry(i, j, x); A = B; // A and B must have the same shape.

Entry read access. OK on const matrices getEntry, write

Under consideration: Require A.clear() on an allocated matrix before any action that would abandon the allocated mem (init or submatrix).

Member Typedef Documentation

◆ RawIterator

template<class _Element>
typedef SubMatIterator<_Element> RawIterator

◆ ConstRawIterator

template<class _Element>
typedef ConstSubMatIterator<_Element> ConstRawIterator

◆ Self_t

template<class _Element>
typedef DenseMat<_Element> Self_t

Self type.

Constructor & Destructor Documentation

◆ DenseMat() [1/2]

template<class _Element>
DenseMat ( )
inline

◆ DenseMat() [2/2]

template<class _Element>
DenseMat ( const DenseMat< _Element > & A)
inline

◆ ~DenseMat()

template<class _Element>
~DenseMat ( )
inline

Member Function Documentation

◆ rowdim()

template<class _Element>
size_t rowdim ( ) const
inline

◆ coldim()

template<class _Element>
size_t coldim ( ) const
inline

◆ getEntry()

template<class _Element>
Entry & getEntry ( Entry & x,
size_t i,
size_t j ) const
inline

◆ setEntry()

template<class _Element>
Entry & setEntry ( size_t i,
size_t j,
const Entry & x )
inline

◆ init() [1/2]

template<class _Element>
void init ( size_t m = 0,
size_t n = 0 )
inline

◆ init() [2/2]

template<class _Element>
void init ( size_t m,
size_t n,
const Entry & filler )
inline

◆ operator=()

template<class _Element>
DenseMat & operator= ( const DenseMat< _Element > & B)
inline

◆ submatrix()

template<class _Element>
void submatrix ( const DenseMat< _Element > & A,
size_t i,
size_t j,
size_t m,
size_t n )
inline

Set this to be an m by n submatrix of A with upper left corner at i,j position of A.

Requires i+m <= A.rowdim(), j+n <= A.coldim().

For instance, B.submatrix(A, i, 0, 1, A.coldim()) makes B the i-th row of A.

◆ size()

template<class _Element>
void size ( size_t m,
size_t n )
inline

◆ did_swapback()

template<class _Element>
template<class vp>
int did_swapback ( vp & swaps,
size_t hot,
size_t l,
size_t r )
inline

◆ flocs()

template<class _Element>
template<class vp>
void flocs ( vp & tos,
vp & swaps )
inline

◆ final_loc()

template<class _Element>
template<class vp>
size_t final_loc ( vp & swaps,
size_t j )
inline

◆ randomColPermutation()

template<class _Element>
void randomColPermutation ( )
inline

◆ randomLowerTriangularColTransform()

template<class _Element>
void randomLowerTriangularColTransform ( )
inline

◆ rawBegin() [1/2]

template<class _Element>
RawIterator rawBegin ( )
inline

◆ rawEnd() [1/2]

template<class _Element>
RawIterator rawEnd ( )
inline

◆ rowBegin() [1/2]

template<class _Element>
RawIterator rowBegin ( size_t i)
inline

◆ rowEnd() [1/2]

template<class _Element>
RawIterator rowEnd ( size_t i)
inline

◆ rawBegin() [2/2]

template<class _Element>
ConstRawIterator rawBegin ( ) const
inline

◆ rawEnd() [2/2]

template<class _Element>
ConstRawIterator rawEnd ( ) const
inline

◆ rowBegin() [2/2]

template<class _Element>
ConstRawIterator rowBegin ( size_t i) const
inline

◆ rowEnd() [2/2]

template<class _Element>
ConstRawIterator rowEnd ( size_t i) const
inline

◆ read()

template<class _Element>
template<class Field>
std::istream & read ( std::istream & file,
const Field & field )

Read the matrix from an input stream.

MatrixTraits.

Parameters
fileInput stream from which to read
field

◆ write() [1/2]

template<class _Element>
template<class Field>
std::ostream & write ( std::ostream & os,
const Field & field,
bool mapleFormat = false ) const

Write the matrix to an output stream.

Parameters
osOutput stream to which to write
field
mapleFormatwrite in Maple(r) format ?

◆ write() [2/2]

template<class _Element>
std::ostream & write ( std::ostream & os,
bool mapleFormat = false ) const

Write the matrix to an output stream.

This a raw version of write(os,F) (no field is given).

Parameters
osOutput stream to which to write
mapleFormatwrite in Maple(r) format ?

Field Documentation

◆ _rep

template<class _Element>
Entry* _rep

◆ _alloc

template<class _Element>
bool _alloc

◆ _rows

template<class _Element>
size_t _rows

◆ _cols

template<class _Element>
size_t _cols

◆ _stride

template<class _Element>
size_t _stride

The documentation for this class was generated from the following file: