DOLFIN
DOLFIN C++ interface
|
#include <ArrayView.h>
Public Member Functions | |
ArrayView () | |
Constructor. | |
ArrayView (std::size_t N, T *x) | |
Construct array from a pointer. Array does not take ownership. | |
template<typename V > | |
ArrayView (V &v) | |
ArrayView (const ArrayView &x) | |
Copy constructor. | |
~ArrayView () | |
Destructor. | |
void | set (std::size_t N, T *x) |
Update object to point to new data. | |
template<typename V > | |
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) | |
T * | begin () |
Pointer to start of array. | |
const T * | begin () const |
Pointer to start of array (const) | |
T * | end () |
Pointer to beyond end of array. | |
const T * | end () const |
Pointer to beyond end of array (const) | |
const T * | data () const |
Return pointer to data (const version) | |
T * | data () |
Return pointer to data (non-const version) | |
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.
|
inlineexplicit |