GenericVector.h¶
Note
The documentation on this page was automatically extracted from the DOLFIN C++ code and may need to be edited or expanded.
-
class
GenericVector¶ Parent class(es)
This class defines a common interface for vectors.
-
void
resize(std::size_t rank, const std::size_t *dims)¶ Resize tensor with given dimensions
-
void
init(const TensorLayout &tensor_layout)¶ Initialize zero tensor using sparsity pattern
-
std::size_t
rank() const¶ Return tensor rank (number of dimensions)
-
std::size_t
size(std::size_t dim) const¶ Return size of given dimension
-
std::pair<std::size_t, std::size_t>
local_range(std::size_t dim) const¶ Return local ownership range
-
void
get(double *block, const dolfin::la_index *num_rows, const dolfin::la_index *const *rows) const¶ Get block of values
-
void
set(const double *block, const dolfin::la_index *num_rows, const dolfin::la_index *const *rows)¶ Set block of values
-
void
add(const double *block, const dolfin::la_index *num_rows, const dolfin::la_index *const *rows)¶ Add block of values
-
void
add(const double *block, const std::vector<const std::vector<dolfin::la_index> *> &rows)¶ Add block of values
-
void
add(const double *block, const std::vector<std::vector<dolfin::la_index>> &rows)¶ Add block of values
-
void
zero() = 0¶ Set all entries to zero and keep any sparse structure
-
void
apply(std::string mode) = 0¶ Finalize assembly of tensor
-
std::string
str(bool verbose) const = 0¶ Return informal string representation (pretty-print)
-
boost::shared_ptr<GenericVector>
copy() const = 0¶ Return copy of vector
-
void
resize(std::size_t N) = 0¶ Resize vector to global size N
-
void
resize(std::pair<std::size_t, std::size_t> range) = 0¶ Resize vector with given ownership range
-
void
resize(std::pair<std::size_t, std::size_t> range, const std::vector<la_index> &ghost_indices) = 0¶ Resize vector with given ownership range and with ghost values
-
bool
empty() const = 0¶ Return true if empty
-
std::size_t
size() const = 0¶ Return global size of vector
-
std::size_t
local_size() const = 0¶ Return local size of vector
-
std::pair<std::size_t, std::size_t>
local_range() const = 0¶ Return local ownership range of a vector
-
bool
owns_index(std::size_t i) const = 0¶ Determine whether global vector index is owned by this process
-
void
get(double *block, std::size_t m, const dolfin::la_index *rows) const¶ Get block of values (values may live on any process)
-
void
get_local(double *block, std::size_t m, const dolfin::la_index *rows) const = 0¶ Get block of values (values must all live on the local process)
-
void
set(const double *block, std::size_t m, const dolfin::la_index *rows) = 0¶ Set block of values
-
void
add(const double *block, std::size_t m, const dolfin::la_index *rows) = 0¶ Add block of values
-
void
get_local(std::vector<double> &values) const = 0¶ Get all values on local process
-
void
set_local(const std::vector<double> &values) = 0¶ Set all values on local process
-
void
gather(GenericVector &x, const std::vector<dolfin::la_index> &indices) const = 0¶ Gather entries into local vector x
-
void
gather(std::vector<double> &x, const std::vector<dolfin::la_index> &indices) const = 0¶ Gather entries into x
-
void
gather_on_zero(std::vector<double> &x) const = 0¶ Gather all entries into x on process 0
-
void
axpy(double a, const GenericVector &x) = 0¶ Add multiple of given vector (AXPY operation)
-
void
abs() = 0¶ Replace all entries in the vector by their absolute values
-
double
inner(const GenericVector &x) const = 0¶ Return inner product with given vector
-
double
norm(std::string norm_type) const = 0¶ Return norm of vector
-
double
min() const = 0¶ Return minimum value of vector
-
double
max() const = 0¶ Return maximum value of vector
-
double
sum() const = 0¶ Return sum of vector
-
double
sum(const Array<std::size_t> &rows) const = 0¶ Return sum of selected rows in vector. Repeated entries are only summed once.
-
const GenericVector &
operator*=(double a) = 0¶ Multiply vector by given number
-
const GenericVector &
operator*=(const GenericVector &x) = 0¶ Multiply vector by another vector pointwise
-
const GenericVector &
operator/=(double a) = 0¶ Divide vector by given number
-
const GenericVector &
operator+=(const GenericVector &x) = 0¶ Add given vector
-
const GenericVector &
operator+=(double a) = 0¶ Add number to all components of a vector
-
const GenericVector &
operator-=(const GenericVector &x) = 0¶ Subtract given vector
-
const GenericVector &
operator-=(double a) = 0¶ Subtract number from all components of a vector
-
const GenericVector &
operator=(const GenericVector &x) = 0¶ Assignment operator
-
const GenericVector &
operator=(double a) = 0¶ Assignment operator
-
const double *
data() const¶ Return pointer to underlying data (const version)
-
double *
data()¶ Return pointer to underlying data
-
void
update_ghost_values()¶ Update ghost values
-
double
operator[](dolfin::la_index i) const¶ Get value of given entry
-
double
getitem(dolfin::la_index i) const¶ Get value of given entry
-
void
setitem(dolfin::la_index i, double value)¶ Set given entry to value. apply(“insert”) should be called before using using the object.
-
void