linbox
|
Triangular BLAS matrix. More...
#include <blas-matrix.h>
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_t > | subMatrixType |
Submatrix type. | |
typedef BlasSubmatrix< constSelf_t > | constSubMatrixType |
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 . More... | |
TriangularBlasMatrix (const BlasMatrix< Field, Rep > &A, Tag::Shape x=Tag::Shape::Upper, Tag::Diag y=Tag::Diag::NonUnit) | |
Constructor from a BlasMatrix (copy). More... | |
TriangularBlasMatrix (BlasMatrix< Field, Rep > &A, Tag::Shape x=Tag::Shape::Upper, Tag::Diag y=Tag::Diag::NonUnit) | |
Constructor from a BlasMatrix (no copy). More... | |
TriangularBlasMatrix (const TriangularBlasMatrix< Field, Rep > &A) | |
Constructor from a TriangularBlasMatrix (copy). More... | |
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). More... | |
Tag::Shape | getUpLo () const |
get the shape of the matrix (upper or lower) | |
Tag::Diag | getDiag () const |
Is the diagonal implicitly unit ? | |
void | init (const _Field &F, const size_t &r=0, const size_t &c=0) |
Allocates a new bare matrix (unshaped, unready). More... | |
template<class Matrix > | |
BlasMatrix & | copy (const Matrix &B) |
Make this a (deep)copy of B. More... | |
size_t | rowdim () const |
Get the number of rows in the matrix. More... | |
size_t | coldim () const |
Get the number of columns in the matrix. More... | |
size_t | getStride () const |
Get the stride of the matrix. | |
size_t & | getWriteStride () |
Get a reference to the stride of the matrix. More... | |
void | resize (const size_t &m, const size_t &n, const Element &val=Element()) |
Resize the matrix to the given dimensions. More... | |
pointer | getPointer () |
. | |
pointer & | getWritePointer () |
. | |
const Element & | setEntry (size_t i, size_t j, const Element &a_ij) |
Set the entry at the (i, j) position to a_ij. More... | |
Element & | refEntry (size_t i, size_t j) |
Get a writeable reference to the entry in the (i, j) position. More... | |
const Element & | getEntry (size_t i, size_t j) const |
Get a read-only reference to the entry in the (i, j) position. More... | |
Element & | getEntry (Element &x, size_t i, size_t j) const |
Copy the (i, j) entry into x, and return a reference to x. More... | |
Self_t | transpose (Self_t &tM) const |
Creates a transposed matrix of *this . More... | |
template<bool _IP> | |
void | transpose () |
Transpose (inplace). More... | |
void | reverseRows () |
Reverse the rows of a matrix. More... | |
void | reverseCols () |
Reverse the columns of a matrix. More... | |
void | reverse () |
Reverse the rows/columns of a matrix. More... | |
template<> | |
void | random (const size_t &b) |
std::istream & | read (std::istream &file) |
Read the matrix from an input stream. More... | |
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. More... | |
std::ostream & | write (std::ostream &os, bool mapleFormat) const |
template<class Vector > | |
Vector & | columnDensity (Vector &v) const |
Compute column density. More... | |
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 | |
IndexedIterator | IndexedBegin () |
ConstIndexedIterator | IndexedBegin () const |
IndexedIterator | IndexedEnd () |
ConstIndexedIterator | IndexedEnd () const |
Row | operator[] (size_t i) |
Retrieve a reference to a row. More... | |
ConstRow | operator[] (size_t i) const |
Retrieve a reference to a row. More... | |
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 | |
Column of rows iterator | |
The column of rows iterator traverses the rows of the matrix in ascending order. Dereferencing the iterator yields a row vector in dense format | |
typedef Subvector< typename Rep::iterator, typename Rep::const_iterator > | Row |
typedef Subvector< typename Rep::const_iterator > | ConstRow |
RowIterator | rowBegin () |
ConstRowIterator | rowBegin () const |
RowIterator | rowEnd () |
ConstRowIterator | rowEnd () const |
Row of columns iterator | |
The row of columns iterator traverses the columns of the matrix in ascending order. Dereferencing the iterator yields a column vector in dense format | |
typedef Subvector< Subiterator< typename Rep::iterator > > | Col |
typedef Subvector< Subiterator< typename Rep::const_iterator > > | ConstCol |
typedef Col | Column |
typedef ConstCol | ConstColumn |
ColIterator | colBegin () |
ConstColIterator | colBegin () const |
ColIterator | colEnd () |
ConstColIterator | colEnd () const |
Triangular BLAS matrix.
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
.
F | |
m | rows |
n | cols |
y | (non)unit diagonal |
x | (upp/low)er matrix |
TriangularBlasMatrix | ( | const BlasMatrix< Field, Rep > & | A, |
Tag::Shape | x = Tag::Shape::Upper , |
||
Tag::Diag | y = Tag::Diag::NonUnit |
||
) |
Constructor from a BlasMatrix
(copy).
A | matrix |
y | (non)unit diagonal |
x | (upp/low)er matrix |
TriangularBlasMatrix | ( | BlasMatrix< Field, Rep > & | A, |
Tag::Shape | x = Tag::Shape::Upper , |
||
Tag::Diag | y = Tag::Diag::NonUnit |
||
) |
Constructor from a BlasMatrix
(no copy).
A | matrix |
y | (non)unit diagonal |
x | (upp/low)er matrix |
TriangularBlasMatrix | ( | const TriangularBlasMatrix< Field, Rep > & | A | ) |
Constructor from a TriangularBlasMatrix
(copy).
A | matrix |
TriangularBlasMatrix | ( | const Matrix & | A, |
Tag::Shape | x = Tag::Shape::Upper , |
||
Tag::Diag | y = Tag::Diag::NonUnit |
||
) |
Generic constructor from a Matrix
(no copy).
A | matrix |
y | (non)unit diagonal |
x | (upp/low)er matrix |
|
inherited |
Allocates a new bare matrix (unshaped, unready).
(Re)allocates a new zero matrix (shaped and ready).
|
inlineinherited |
Make this a (deep)copy of B.
Assumes same shape. make sure we actually copy
|
inherited |
Get the number of rows in the matrix.
|
inherited |
Get the number of columns in the matrix.
|
inherited |
Get a reference to the stride of the matrix.
Modify stride this way.
Resize the matrix to the given dimensions.
The state of the matrix's entries after a call to this method is undefined
m | Number of rows |
n | Number of columns |
val |
|
inherited |
Set the entry at the (i, j) position to a_ij.
i | Row number, 0...rowdim () - 1 |
j | Column number 0...coldim () - 1 |
a_ij | Element to set |
|
inherited |
Get a writeable reference to the entry in the (i, j) position.
i | Row index of entry |
j | Column index of entry |
|
inherited |
Get a read-only reference to the entry in the (i, j) position.
i | Row index |
j | Column index |
|
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
x | Element in which to store result |
i | Row index |
j | Column index |
Creates a transposed matrix of *this
.
[in] | tM |
|
inherited |
Transpose (inplace).
If rows and columns agree, we can transpose inplace.
|
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;
|
inherited |
Reverse the columns of a matrix.
This is done inplace. This is A <- J.A
|
inherited |
Reverse the rows/columns of a matrix.
This is done inplace. This is A <- J.A.J
|
inherited |
|
inherited |
Read the matrix from an input stream.
The stream is in SMS, DENSE, or MatrixMarket format and is autodetected.
file | Input stream from which to read |
|
inlineinherited |
Write the matrix to an output stream.
os | Output stream to which to write |
f | write in some format (Tag::FileFormat::Format). Default is Maple's. |
|
inlineinherited |
|
inherited |
Retrieve a reference to a row.
Since rows may also be indexed, this allows A[i][j] notation to be used.
i | Row index |
|
inherited |
Retrieve a reference to a row.
Since rows may also be indexed, this allows A[i][j] notation to be used.
i | Row index |
|
inherited |
|
inherited |