#include <matrixublas.hpp>
template<typename T, typename LayoutType>
class Feel::MatrixUBlas< T, LayoutType >
interface to ublas sparse matrix
- Author
- Christophe Prud'homme
- See Also
|
|
|
| MatrixUBlas () |
| |
|
| MatrixUBlas (MatrixUBlas const &m) |
| |
|
| ~MatrixUBlas () |
| |
|
|
value_type & | operator() (size_type i, size_type j) |
| |
|
value_type const & | operator() (size_type i, size_type j) const |
| |
|
| unsigned int | size1 () const |
| |
| unsigned int | size2 () const |
| |
| size_type | nnz () const |
| |
| unsigned int | rowStart () const |
| |
| unsigned int | rowStop () const |
| |
| bool | isInitialized () const |
| |
| matrix_type const & | mat () const |
| |
| matrix_type & | mat () |
| |
|
| void | init (const unsigned int m, const unsigned int n, const unsigned int m_l, const unsigned int n_l, const unsigned int nnz=30, const unsigned int noz=10) |
| |
| void | clear () |
| |
| void | zero () |
| |
|
void | zero (size_type start1, size_type stop1, size_type start2, size_type stop2) |
| |
| void | add (const unsigned int i, const unsigned int j, const value_type value) |
| |
| void | set (const unsigned int i, const unsigned int j, const value_type value) |
| |
| void | printMatlab (const std::string name="NULL") const |
| |
| void | fill (pattern_type const &) |
| |
|
void | resize (size_type nr, size_type nc, bool preserve=false) |
| |
| template<typename VE1 , typename VE2 > |
| value_type | energy (ublas::vector_expression< VE1 > const &__v, ublas::vector_expression< VE2 > const &__u) const |
| |
|
void | diagonalize (size_type) |
| |
|
|
typedef T | value_type |
| |
typedef
ublas::compressed_matrix
< value_type, LayoutType > | matrix_type |
| |
typedef
boost::numeric::bindings::traits::sparse_matrix_traits
< matrix_type >::ordering_type | ordering_type |
| |
typedef
boost::numeric::bindings::traits::sparse_matrix_traits
< matrix_type >::layout_type | layout_type |
| |
typedef std::vector< std::set
< size_type > > | pattern_type |
| |
| static const bool | is_row_major |
| |
template<typename T , typename LayoutType >
| void Feel::MatrixUBlas< T, LayoutType >::add |
( |
const unsigned int |
i, |
|
|
const unsigned int |
j, |
|
|
const value_type |
value |
|
) |
| |
|
inline |
Add value to the element (i,j). Throws an error if the entry does not exist. Still, it is allowed to store zero values in non-existent fields.
template<typename T , typename LayoutType >
Release all memory and return to a state just like after having called the default constructor.
template<typename T , typename LayoutType >
template<typename VE1 , typename VE2 >
| value_type Feel::MatrixUBlas< T, LayoutType >::energy |
( |
ublas::vector_expression< VE1 > const & |
__v, |
|
|
ublas::vector_expression< VE2 > const & |
__u |
|
) |
| const |
|
inline |
- Returns
template<typename T , typename LayoutType >
fill sparse matrix with non zero entries
template<typename T , typename LayoutType >
| void Feel::MatrixUBlas< T, LayoutType >::init |
( |
const unsigned int |
m, |
|
|
const unsigned int |
n, |
|
|
const unsigned int |
m_l, |
|
|
const unsigned int |
n_l, |
|
|
const unsigned int |
nnz = 30, |
|
|
const unsigned int |
noz = 10 |
|
) |
| |
Initialize a Ublas matrix that is of global dimension
with local dimensions
. nnz is the number of on-processor nonzeros per row (defaults to 30). noz is the number of on-processor nonzeros per row (defaults to 30).
template<typename T , typename LayoutType >
- Returns
- true if matrix is initialized/usable, false otherwise
template<typename T , typename LayoutType >
Returns the raw ublas matrix.
template<typename T , typename LayoutType >
Returns the raw ublas matrix.
template<typename T , typename LayoutType >
- Returns
- the number of non-zeros entries in the matrix
template<typename T , typename LayoutType >
| void Feel::MatrixUBlas< T, LayoutType >::printMatlab |
( |
const std::string |
name = "NULL" | ) |
const |
Print the contents of the matrix in Matlab's sparse matrix format. Optionally prints the matrix to the file named name. If name is not specified it is dumped to the screen.
template<typename T , typename LayoutType >
return row_start, the index of the first matrix row stored on this processor
template<typename T , typename LayoutType >
return row_stop, the index of the last matrix row (+1) stored on this processor
template<typename T , typename LayoutType >
| void Feel::MatrixUBlas< T, LayoutType >::set |
( |
const unsigned int |
i, |
|
|
const unsigned int |
j, |
|
|
const value_type |
value |
|
) |
| |
|
inline |
Set value to the element (i,j). Throws an error if the entry does not exist. Still, it is allowed to store zero values in non-existent fields.
template<typename T , typename LayoutType >
- Returns
m, the row-dimension of the matrix where the marix is
.
template<typename T , typename LayoutType >
- Returns
n, the column-dimension of the matrix where the marix is
.
template<typename T , typename LayoutType >
Set all entries to 0. This method retains sparsity structure.
template<typename T , typename LayoutType >
Initial value:= boost::is_same<ordering_type,
boost::numeric::bindings::traits::row_major_t>::value
The documentation for this class was generated from the following file: