uBLASSparseMatrix

class dolfin.cpp.la.uBLASSparseMatrix(*args)

Bases: dolfin.cpp.la.GenericMatrix

This class provides a simple matrix class based on uBLAS. It is a simple wrapper for a uBLAS matrix implementing the GenericMatrix interface.

The interface is intentionally simple. For advanced usage, access the underlying uBLAS matrix and use the standard uBLAS interface which is documented at http://www.boost.org/libs/numeric/ublas/doc/index.htm.

Developer note: specialised member functions must be inlined to avoid link errors.

Overloaded versions

  • uBLASMatrix()

    Create empty matrix

  • uBLASMatrix(M, N)

    Create M x N matrix

  • uBLASMatrix(A)

    Copy constructor

  • uBLASMatrix(A)

    Create matrix from given uBLAS matrix expression

assign()

Overloaded versions

  • operator=(A)

    Assignment operator

  • operator=(A)

    Assignment operator

invert()

Compute inverse of matrix

lump()

Lump matrix into vector m

mat()

Overloaded versions

  • mat()

    Return reference to uBLAS matrix (const version)

  • mat()

    Return reference to uBLAS matrix (non-const version)

resize()

Overloaded versions

  • resize(M, N)

    Resize matrix to M x N

  • resize(z, dim)

    Resize 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

solve()

Solve Ax = b out-of-place using uBLAS (A is not destroyed)

solve_in_place()

Overloaded versions

  • solve_in_place(x, b)

    Solve Ax = b in-place using uBLAS(A is destroyed)

  • solve_in_place(X)

    General uBLAS LU solver which accepts both vector and matrix right-hand sides

thisown

The membership flag

zero()

Overloaded versions

  • zero()

    Set all entries to zero and keep any sparse structure

  • zero(m, rows)

    Set given rows to zero