ArrayView.h

Note

The documentation on this page was automatically extracted from the DOLFIN C++ code and may need to be edited or expanded.

class ArrayView

This class provides a wrapper for a pointer to an array. It never owns the data, and will not be valid if the underlying data goes out-of-scope.

ArrayView()

Constructor

ArrayView(std::size_t N, T *x)

Construct array from a pointer. Array does not take ownership.

explicit ArrayView(V &v)

Construct array from a container with the the data() and size() functions

ArrayView(const ArrayView &x)

Copy constructor

void set(std::size_t N, T *x)

Update object to point to new data

void set(V &v)

Update object to point to new container

std::size_t size() const

Return size of array

bool empty() const

Test if array view is empty

const T &operator[](std::size_t i) const

Access value of given entry (const version)

T &operator[](std::size_t i)

Access value of given entry (non-const version)

const T *data() const

Return pointer to data (const version)

T *data()

Return pointer to data (non-const version)