# EigenVector¶

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

This class provides a simple vector class based on Eigen. It is a simple wrapper for a Eigen vector implementing the GenericVector interface.

The interface is intentionally simple. For advanced usage, access the underlying Eigen vector and use the standard Eigen interface which is documented at http://eigen.tuxfamily.org

• EigenVector()

Create empty vector (on MPI_COMM_SELF)

• EigenVector(comm)

Create empty vector

• EigenVector(comm, N)

Create vector of size N

• EigenVector(x)

Copy constructor

• EigenVector(x)

Construct vector from an Eigen shared_ptr

add_local()

Add block of values using local indices

Add values to each entry on local process

data(deepcopy=True)

Return an array to underlaying data

This method is only available for the Eigen linear algebra backend.

Arguments
deepcopy
Return a copy of the data. If set to False a reference to the Matrix need to be kept, otherwise the data will be destroyed together with the destruction of the Matrix
gather()

• gather(x, indices)

Gather entries into local vector x

• gather(x, indices)

Gather entries into x

get_local()

• get_local(block, m, rows)

Get block of values using local indices

• get_local(values)

Get all values on local process

init()

• init(comm, N)

Initialize vector to size N

• init(comm, range)

Resize vector with given ownership range

• init(comm, range, local_to_global_map, ghost_indices)

Resize vector with given ownership range and with ghost values

resize()

Resize vector to size N

set_local()

• set_local(block, m, rows)

Set block of values using local indices

• set_local(values)

Set all values on local process

sum()

• sum()

Return sum of values of vector

• sum(rows)

Return sum of selected rows in vector. Repeated entries are only summed once.

thisown

The membership flag

vec()