linbox
Public Types | Public Member Functions | Data Fields | Protected Attributes
TriangularBlasMatrix< _Field, _Storage > Class Template Reference

Triangular BLAS matrix. More...

#include <blas-matrix.h>

+ Inheritance diagram for TriangularBlasMatrix< _Field, _Storage >:
+ Collaboration diagram for TriangularBlasMatrix< _Field, _Storage >:

Public Types

typedef Field::Element Element
 Element type.
 
typedef Rep::pointer pointer
 pointer type to elements
 
typedef const pointer const_pointer
 const pointer type
 
typedef const BlasMatrix< Field, Rep > constSelf_t
 Self typeype.
 
typedef BlasSubmatrix< Self_tsubMatrixType
 Submatrix type.
 
typedef BlasSubmatrix< constSelf_tconstSubMatrixType
 Submatrix type.
 
typedef Self_t matrixType
 matrix type
 
typedef constSelf_t constMatrixType
 matrix type
 
typedef Self_t blasType
 blas matrix type
 

Public Member Functions

 TriangularBlasMatrix (const Field &F, const size_t m, const size_t n, Tag::Shape x=Tag::Shape::Upper, Tag::Diag y=Tag::Diag::NonUnit)
 Constructor for a new TriangularBlasMatrix.
 
 TriangularBlasMatrix (const BlasMatrix< Field, Rep > &A, Tag::Shape x=Tag::Shape::Upper, Tag::Diag y=Tag::Diag::NonUnit)
 Constructor from a BlasMatrix (copy).
 
 TriangularBlasMatrix (BlasMatrix< Field, Rep > &A, Tag::Shape x=Tag::Shape::Upper, Tag::Diag y=Tag::Diag::NonUnit)
 Constructor from a BlasMatrix (no copy).
 
 TriangularBlasMatrix (const TriangularBlasMatrix< Field, Rep > &A)
 Constructor from a TriangularBlasMatrix (copy).
 
template<class Matrix >
 TriangularBlasMatrix (const Matrix &A, Tag::Shape x=Tag::Shape::Upper, Tag::Diag y=Tag::Diag::NonUnit)
 Generic constructor from a Matrix (no copy).
 
Tag::Shape getUpLo () const
 get the shape of the matrix (upper or lower)
 
Tag::Diag getDiag () const
 Is the diagonal implicitly unit ?
 
template<class Matrix >
BlasMatrixcopy (const Matrix &B)
 Make this a (deep)copy of B.
 
size_t rowdim () const
 Get the number of rows in the matrix.
 
size_t coldim () const
 Get the number of columns in the matrix.
 
size_t getStride () const
  Get the stride of the matrix.
 
size_t & getWriteStride ()
 Get a reference to the stride of the matrix.
 
void resize (const size_t &m, const size_t &n, const Element &val=Element())
 Resize the matrix to the given dimensions.
 
pointer getPointer ()
  
 
pointergetWritePointer ()
  
 
const ElementsetEntry (size_t i, size_t j, const Element &a_ij)
 Set the entry at the (i, j) position to a_ij.
 
ElementrefEntry (size_t i, size_t j)
 Get a writeable reference to the entry in the (i, j) position.
 
const ElementgetEntry (size_t i, size_t j) const
 Get a read-only reference to the entry in the (i, j) position.
 
ElementgetEntry (Element &x, size_t i, size_t j) const
 Copy the (i, j) entry into x, and return a reference to x.
 
Self_t transpose (Self_t &tM) const
 Creates a transposed matrix of *this.
 
template<bool _IP>
void transpose ()
 Transpose (inplace).
 
void reverseRows ()
 Reverse the rows of a matrix.
 
void reverseCols ()
 Reverse the columns of a matrix.
 
void reverse ()
 Reverse the rows/columns of a matrix.
 
void random (const size_t &b)
 
std::istream & read (std::istream &file)
 Read the matrix from an input stream.
 
std::ostream & write (std::ostream &os) const
 Write the matrix in MatrixMarket format.
 
std::ostream & write (std::ostream &os, Tag::FileFormat f) const
 Write the matrix to an output stream.
 
std::ostream & write (std::ostream &os, bool mapleFormat) const
 
Raw Indexed iterator

Like the raw iterator, the indexed iterator is a method for accessing all entries in the matrix in some unspecified order.

At each position of the the indexed iterator, it also provides the row and column indices of the currently referenced entry. This is provided through it's rowIndex() and colIndex() functions.

IndexedIterator IndexedBegin ()
 Retrieve a reference to a row.
 
ConstIndexedIterator IndexedBegin () const
 Retrieve a reference to a row.
 
IndexedIterator IndexedEnd ()
 Retrieve a reference to a row.
 
ConstIndexedIterator IndexedEnd () const
 Retrieve a reference to a row.
 
Row operator[] (size_t i)
 Retrieve a reference to a row.
 
ConstRow operator[] (size_t i) const
 Retrieve a reference to a row.
 
template<class Vector >
VectorcolumnDensity (Vector &v) const
 Compute column density.
 
size_t size () const
 Retrieve a reference to a row.
 
void finalize ()
 Retrieve a reference to a row.
 
template<class Vector1 , class Vector2 >
Vector1 & apply (Vector1 &y, const Vector2 &x) const
 Retrieve a reference to a row.
 
template<class _VRep >
BlasVector< Field, _VRep > & apply (BlasVector< Field, _VRep > &y, const BlasVector< Field, _VRep > &x) const
 Retrieve a reference to a row.
 
template<class Vector1 , class Vector2 >
Vector1 & applyTranspose (Vector1 &y, const Vector2 &x) const
 Retrieve a reference to a row.
 
subMatrixTypeapplyRight (subMatrixType &Y, const subMatrixType &X)
 Retrieve a reference to a row.
 
subMatrixTypeapplyLeft (subMatrixType &Y, const subMatrixType &X)
 Retrieve a reference to a row.
 
const _Field & field () const
 Retrieve a reference to a row.
 
template<class uselessTag >
void changeFieldSpecialised (_Field &G, VectorDomain< _Field > &VD, const _Field &F, const uselessTag &m)
 Retrieve a reference to a row.
 
void changeFieldSpecialised (_Field &G, VectorDomain< _Field > &VD, const _Field &F, const RingCategories::ModularTag &m)
 Retrieve a reference to a row.
 
void changeField (const _Field &F)
 Retrieve a reference to a row.
 

Data Fields

pointer _ptr
 
MatrixDomain< Field > _MD
 
VectorDomain< Field > _VD
 

Protected Attributes

Tag::Shape _uplo
 upper or lower triangular
 
Tag::Diag _diag
 unit or non unit diagonal
 

Detailed Description

template<class _Field, class _Storage>
class LinBox::TriangularBlasMatrix< _Field, _Storage >

Triangular BLAS matrix.

Constructor & Destructor Documentation

◆ TriangularBlasMatrix() [1/5]

template<class _Field , class _Rep >
TriangularBlasMatrix ( const Field &  F,
const size_t  m,
const size_t  n,
Tag::Shape  x = Tag::Shape::Upper,
Tag::Diag  y = Tag::Diag::NonUnit 
)

Constructor for a new TriangularBlasMatrix.

Parameters
F
mrows
ncols
y(non)unit diagonal
x(upp/low)er matrix

◆ TriangularBlasMatrix() [2/5]

template<class _Field , class _Storage >
TriangularBlasMatrix ( const BlasMatrix< Field, Rep > &  A,
Tag::Shape  x = Tag::Shape::Upper,
Tag::Diag  y = Tag::Diag::NonUnit 
)

Constructor from a BlasMatrix (copy).

Parameters
Amatrix
y(non)unit diagonal
x(upp/low)er matrix

◆ TriangularBlasMatrix() [3/5]

template<class _Field , class _Storage >
TriangularBlasMatrix ( BlasMatrix< Field, Rep > &  A,
Tag::Shape  x = Tag::Shape::Upper,
Tag::Diag  y = Tag::Diag::NonUnit 
)

Constructor from a BlasMatrix (no copy).

Parameters
Amatrix
y(non)unit diagonal
x(upp/low)er matrix

◆ TriangularBlasMatrix() [4/5]

template<class _Field , class _Storage >
TriangularBlasMatrix ( const TriangularBlasMatrix< Field, Rep > &  A)

Constructor from a TriangularBlasMatrix (copy).

Parameters
Amatrix

◆ TriangularBlasMatrix() [5/5]

template<class _Field , class _Rep >
template<class Matrix >
TriangularBlasMatrix ( const Matrix &  A,
Tag::Shape  x = Tag::Shape::Upper,
Tag::Diag  y = Tag::Diag::NonUnit 
)

Generic constructor from a Matrix (no copy).

Parameters
Amatrix
y(non)unit diagonal
x(upp/low)er matrix

Member Function Documentation

◆ copy()

template<class _Field , class _Storage >
template<class Matrix >
BlasMatrix & copy ( const Matrix &  B)
inlineinherited

Make this a (deep)copy of B.

Assumes same shape. make sure we actually copy

◆ rowdim()

template<class _Field , class _Rep >
size_t rowdim
inherited

Get the number of rows in the matrix.

Returns
Number of rows in matrix

◆ coldim()

template<class _Field , class _Rep >
size_t coldim
inherited

Get the number of columns in the matrix.

Returns
Number of columns in matrix

◆ getWriteStride()

template<class _Field , class _Rep >
size_t & getWriteStride
inherited

Get a reference to the stride of the matrix.

Modify stride this way.

◆ resize()

template<class _Field , class _Rep >
void resize ( const size_t &  m,
const size_t &  n,
const Element val = Element() 
)
inherited

Resize the matrix to the given dimensions.

The state of the matrix's entries after a call to this method is undefined

Parameters
mNumber of rows
nNumber of columns
val

◆ setEntry()

template<class _Field , class _Rep >
const _Field::Element & setEntry ( size_t  i,
size_t  j,
const Element a_ij 
)
inherited

Set the entry at the (i, j) position to a_ij.

Parameters
iRow number, 0...rowdim () - 1
jColumn number 0...coldim () - 1
a_ijElement to set

◆ refEntry()

template<class _Field , class _Rep >
_Field::Element & refEntry ( size_t  i,
size_t  j 
)
inherited

Get a writeable reference to the entry in the (i, j) position.

Parameters
iRow index of entry
jColumn index of entry
Returns
Reference to matrix entry

◆ getEntry() [1/2]

template<class _Field , class _Rep >
const _Field::Element & getEntry ( size_t  i,
size_t  j 
) const
inherited

Get a read-only reference to the entry in the (i, j) position.

Parameters
iRow index
jColumn index
Returns
Const reference to matrix entry

◆ getEntry() [2/2]

template<class _Field , class _Rep >
_Field::Element & getEntry ( Element x,
size_t  i,
size_t  j 
) const
inherited

Copy the (i, j) entry into x, and return a reference to x.

This form is more in the Linbox style and is provided for interface compatibility with other parts of the library

Parameters
xElement in which to store result
iRow index
jColumn index
Returns
Reference to x

◆ transpose() [1/2]

template<class _Field , class _Storage >
Self_t transpose ( Self_t tM) const
inherited

Creates a transposed matrix of *this.

Parameters
[in]tM
Returns
the transposed matrix of this.

◆ transpose() [2/2]

template<class _Field , class _Rep >
template<bool _IP>
void transpose
inherited

Transpose (inplace).

If rows and columns agree, we can transpose inplace.

◆ reverseRows()

template<class _Field , class _Rep >
void reverseRows
inherited

Reverse the rows of a matrix.

This is done inplace. Let J=antiDiag(1) (or the matrix of the reverse permutation or the matrix (i,j) = (i+j+1==m)). Then, we compute A <- J.A;

◆ reverseCols()

template<class _Field , class _Rep >
void reverseCols
inherited

Reverse the columns of a matrix.

This is done inplace. This is A <- J.A

◆ reverse()

template<class _Field , class _Rep >
void reverse
inherited

Reverse the rows/columns of a matrix.

This is done inplace. This is A <- J.A.J

◆ random()

void random< size_t > ( const size_t &  b)
inherited
Bug:
does not work for submatrices.
Todo:
b should be the random generator

◆ read()

template<class _Field , class _Rep >
std::istream & read ( std::istream &  file)
inherited

Read the matrix from an input stream.

The stream is in SMS, DENSE, or MatrixMarket format and is autodetected.

Parameters
fileInput stream from which to read

◆ write() [1/2]

template<class _Field , class _Storage >
std::ostream & write ( std::ostream &  os,
Tag::FileFormat  f 
) const
inlineinherited

Write the matrix to an output stream.

Parameters
osOutput stream to which to write
fwrite in some format (Tag::FileFormat::Format). Default is Maple's.

◆ write() [2/2]

template<class _Field , class _Storage >
std::ostream & write ( std::ostream &  os,
bool  mapleFormat 
) const
inlineinherited
Deprecated:
Only for compatiblity.

◆ IndexedBegin() [1/2]

template<class _Field , class _Rep >
BlasMatrix< _Field, _Rep >::IndexedIterator IndexedBegin
inherited

Retrieve a reference to a row.

Since rows may also be indexed, this allows A[i][j] notation to be used.

Parameters
iRow index
Bug:
Rows and Cols should be BlasVectors

◆ IndexedBegin() [2/2]

template<class _Field , class _Rep >
BlasMatrix< _Field, _Rep >::ConstIndexedIterator IndexedBegin
inherited

Retrieve a reference to a row.

Since rows may also be indexed, this allows A[i][j] notation to be used.

Parameters
iRow index
Bug:
Rows and Cols should be BlasVectors

◆ IndexedEnd() [1/2]

template<class _Field , class _Rep >
BlasMatrix< _Field, _Rep >::IndexedIterator IndexedEnd
inherited

Retrieve a reference to a row.

Since rows may also be indexed, this allows A[i][j] notation to be used.

Parameters
iRow index
Bug:
Rows and Cols should be BlasVectors

◆ IndexedEnd() [2/2]

template<class _Field , class _Rep >
BlasMatrix< _Field, _Rep >::ConstIndexedIterator IndexedEnd
inherited

Retrieve a reference to a row.

Since rows may also be indexed, this allows A[i][j] notation to be used.

Parameters
iRow index
Bug:
Rows and Cols should be BlasVectors

◆ operator[]() [1/2]

template<class _Field , class _Rep >
BlasMatrix< _Field, _Rep >::Row operator[] ( size_t  i)
inherited

Retrieve a reference to a row.

Since rows may also be indexed, this allows A[i][j] notation to be used.

Parameters
iRow index
Bug:
Rows and Cols should be BlasVectors

◆ operator[]() [2/2]

template<class _Field , class _Rep >
BlasMatrix< _Field, _Rep >::ConstRow operator[] ( size_t  i) const
inherited

Retrieve a reference to a row.

Since rows may also be indexed, this allows A[i][j] notation to be used.

Parameters
iRow index
Bug:
Rows and Cols should be BlasVectors

◆ columnDensity()

template<class _Field , class _Rep >
template<class Vector >
Vector & columnDensity ( Vector v) const
inherited

Compute column density.

Parameters
v

◆ size()

template<class _Field , class _Storage >
size_t size ( ) const
inlineinherited

Retrieve a reference to a row.

Since rows may also be indexed, this allows A[i][j] notation to be used.

Parameters
iRow index
Bug:
Rows and Cols should be BlasVectors

◆ finalize()

template<class _Field , class _Storage >
void finalize ( )
inlineinherited

Retrieve a reference to a row.

Since rows may also be indexed, this allows A[i][j] notation to be used.

Parameters
iRow index
Bug:
Rows and Cols should be BlasVectors

◆ apply() [1/2]

template<class _Field , class _Rep >
template<class Vector1 , class Vector2 >
Vector1 & apply ( Vector1 &  y,
const Vector2 &  x 
) const
inherited

Retrieve a reference to a row.

Since rows may also be indexed, this allows A[i][j] notation to be used.

Parameters
iRow index
Bug:
Rows and Cols should be BlasVectors

◆ apply() [2/2]

template<class _Field , class _Storage >
template<class _VRep >
BlasVector< Field, _VRep > & apply ( BlasVector< Field, _VRep > &  y,
const BlasVector< Field, _VRep > &  x 
) const
inherited

Retrieve a reference to a row.

Since rows may also be indexed, this allows A[i][j] notation to be used.

Parameters
iRow index
Bug:
Rows and Cols should be BlasVectors

◆ applyTranspose()

template<class _Field , class _Rep >
template<class Vector1 , class Vector2 >
Vector1 & applyTranspose ( Vector1 &  y,
const Vector2 &  x 
) const
inherited

Retrieve a reference to a row.

Since rows may also be indexed, this allows A[i][j] notation to be used.

Parameters
iRow index
Bug:
Rows and Cols should be BlasVectors

◆ applyRight()

template<class _Field , class _Storage >
subMatrixType & applyRight ( subMatrixType Y,
const subMatrixType X 
)
inlineinherited

Retrieve a reference to a row.

Since rows may also be indexed, this allows A[i][j] notation to be used.

Parameters
iRow index
Bug:
Rows and Cols should be BlasVectors

◆ applyLeft()

template<class _Field , class _Storage >
subMatrixType & applyLeft ( subMatrixType Y,
const subMatrixType X 
)
inlineinherited

Retrieve a reference to a row.

Since rows may also be indexed, this allows A[i][j] notation to be used.

Parameters
iRow index
Bug:
Rows and Cols should be BlasVectors

◆ field()

template<class _Field , class _Rep >
const _Field & field
inherited

Retrieve a reference to a row.

Since rows may also be indexed, this allows A[i][j] notation to be used.

Parameters
iRow index
Bug:
Rows and Cols should be BlasVectors

◆ changeFieldSpecialised() [1/2]

template<class _Field , class _Storage >
template<class uselessTag >
void changeFieldSpecialised ( _Field &  G,
VectorDomain< _Field > &  VD,
const _Field &  F,
const uselessTag &  m 
)
inlineinherited

Retrieve a reference to a row.

Since rows may also be indexed, this allows A[i][j] notation to be used.

Parameters
iRow index
Bug:
Rows and Cols should be BlasVectors

◆ changeFieldSpecialised() [2/2]

template<class _Field , class _Storage >
void changeFieldSpecialised ( _Field &  G,
VectorDomain< _Field > &  VD,
const _Field &  F,
const RingCategories::ModularTag m 
)
inlineinherited

Retrieve a reference to a row.

Since rows may also be indexed, this allows A[i][j] notation to be used.

Parameters
iRow index
Bug:
Rows and Cols should be BlasVectors

◆ changeField()

template<class _Field , class _Storage >
void changeField ( const _Field &  F)
inlineinherited

Retrieve a reference to a row.

Since rows may also be indexed, this allows A[i][j] notation to be used.

Parameters
iRow index
Bug:
Rows and Cols should be BlasVectors

Field Documentation

◆ _ptr

template<class _Field , class _Storage >
pointer _ptr
inherited
Bug:
why public ?

◆ _MD

template<class _Field , class _Storage >
MatrixDomain<Field> _MD
inherited
Bug:
why public ?

◆ _VD

template<class _Field , class _Storage >
VectorDomain<Field> _VD
inherited
Bug:
why public ?

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