|
Feel++ 0.91.0
|
interface to ublas sparse matrix More...
#include <matrixublas.hpp>
Public Member Functions | |
Constructors, destructor | |
| MatrixUBlas () | |
| MatrixUBlas (MatrixUBlas const &m) | |
| ~MatrixUBlas () | |
Operator overloads | |
| value_type & | operator() (size_type i, size_type j) |
| value_type const & | operator() (size_type i, size_type j) const |
Accessors | |
| 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 () |
Methods | |
| 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) |
Typedefs | |
| 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 |
interface to ublas sparse matrix
| 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.
| void Feel::MatrixUBlas< T, LayoutType >::clear | ( | ) | [inline] |
Release all memory and return to a state just like after having called the default constructor.
| value_type Feel::MatrixUBlas< T, LayoutType >::energy | ( | ublas::vector_expression< VE1 > const & | __v, |
| ublas::vector_expression< VE2 > const & | __u | ||
| ) | const [inline] |
| void Feel::MatrixUBlas< T, LayoutType >::fill | ( | pattern_type const & | __pattern | ) |
fill sparse matrix with non zero entries
| 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).
| bool Feel::MatrixUBlas< T, LayoutType >::isInitialized | ( | ) | const [inline] |
| matrix_type& Feel::MatrixUBlas< T, LayoutType >::mat | ( | ) | [inline] |
Returns the raw ublas matrix.
| matrix_type const& Feel::MatrixUBlas< T, LayoutType >::mat | ( | ) | const [inline] |
Returns the raw ublas matrix.
| size_type Feel::MatrixUBlas< T, LayoutType >::nnz | ( | ) | const [inline] |
| 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.
| unsigned int Feel::MatrixUBlas< T, LayoutType >::rowStart | ( | ) | const [inline] |
return row_start, the index of the first matrix row stored on this processor
| unsigned int Feel::MatrixUBlas< T, LayoutType >::rowStop | ( | ) | const [inline] |
return row_stop, the index of the last matrix row (+1) stored on this processor
| 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.
| unsigned int Feel::MatrixUBlas< T, LayoutType >::size1 | ( | ) | const [inline] |
m, the row-dimension of the matrix where the marix is
. | unsigned int Feel::MatrixUBlas< T, LayoutType >::size2 | ( | ) | const [inline] |
n, the column-dimension of the matrix where the marix is
. | void Feel::MatrixUBlas< T, LayoutType >::zero | ( | ) | [inline] |
Set all entries to 0. This method retains sparsity structure.
const bool Feel::MatrixUBlas< T, LayoutType >::is_row_major [static] |
boost::is_same<ordering_type,
boost::numeric::bindings::traits::row_major_t>::value
1.7.4