GenericMatrix¶
-
class
dolfin.cpp.la.GenericMatrix(*args, **kwargs)¶ Bases:
dolfin.cpp.la.GenericTensor,dolfin.cpp.la.GenericLinearOperatorThis class defines a common interface for matrices.
-
add()¶ Overloaded versions
add(block, num_rows, rows)
Add block of values using global indices
add(block, rows)
Add block of values using global indices
add(block, m, rows, n, cols)
Add block of values using global indices
-
add_local()¶ Overloaded versions
add_local(block, num_rows, rows)
Add block of values using local indices
add_local(block, rows)
Add block of values using local indices
add_local(block, m, rows, n, cols)
Add block of values using local indices
-
array()¶ Return a numpy array representation of Matrix
-
assign()¶ Assignment operator
-
axpy()¶ Add multiple of given matrix (AXPY operation)
-
copy()¶ Return copy of matrix
-
get()¶ Overloaded versions
get(block, num_rows, rows)
Get block of values
get(block, m, rows, n, cols)
Get block of values
-
get_diagonal()¶ Get diagonal of a matrix
-
getrow()¶ Get non-zero values of given row (global index) on local process
-
ident()¶ Set given rows (global row indices) to identity matrix
-
ident_local()¶ Set given rows (local row indices) to identity matrix
-
ident_zeros()¶ Insert one on the diagonal for all zero rows
-
init_vector()¶ Initialize vector z to be compatible with the matrix-vector product y = Ax. In the parallel case, both size and layout are important.
- Arguments
- dim (int)
- The dimension (axis): dim = 0 –> z = y, dim = 1 –> z = x
-
is_symmetric()¶ Test if matrix is symmetric
-
nnz()¶ Return number of non-zero entries in matrix (collective)
-
norm()¶ Return norm of matrix
-
set()¶ Overloaded versions
set(block, num_rows, rows)
Set block of values using global indices
set(block, m, rows, n, cols)
Set block of values using global indices
-
set_diagonal()¶ Set diagonal of a matrix
-
set_local()¶ Overloaded versions
set_local(block, num_rows, rows)
Set block of values using local indices
set_local(block, m, rows, n, cols)
Set block of values using local indices
-
setrow()¶ Set values for given row (global index) on local process
-
thisown¶ The membership flag
-
transpmult()¶ Matrix-vector product, y = A^T x. The y vector must either be zero-sized or have correct size and parallel layout.
-
zero()¶ Overloaded versions
zero()
Set all entries to zero and keep any sparse structure
zero(m, rows)
Set given rows (global row indices) to zero
-
zero_local()¶ Set given rows (local row indices) to zero
-