The array1d_view class is a 1D vector container that wraps data from various iterators in a array1d datatype.
| RandomAccessIterator | The iterator type used to encapsulate the underlying data. |
#include <array1d.h>
Public Methods | |
| array1d_view (void) | |
| template<typename ArrayType > | |
| array1d_view (ArrayType &v) | |
| template<typename InputIterator > | |
| array1d_view (InputIterator begin, InputIterator end) | |
| array1d_view & | operator= (const array1d_view &v) |
| reference | front (void) const |
| reference | back (void) const |
| reference | operator[] (size_type n) const |
Subscript access to the data contained in this array1d_view. More... | |
| iterator | begin (void) const |
| iterator | end (void) const |
| size_type | size (void) const |
| size_type | capacity (void) const |
| void | resize (size_type new_size) |
Resizes this array1d_view to the specified number of elements. More... | |
| view | subarray (size_type start_index, size_type num_entries) |
| void | swap (array1d_view &v) |
Protected Members | |
| size_type | m_size |
| size_type | m_capacity |
Friends | |
| class | thrust::iterator_core_access |
|
inline |
This constructor creates an empty array1d_view vector.
|
inline |
|
inline |
This constructor builds a array1d_view vector from a range.
| begin | The beginning of the range. |
| end | The end of the range. |
| reference cusp::array1d_view< RandomAccessIterator >::back | ( | void | ) | const |
This method returns a reference referring to the last element of this array1d_view.
array1d_view. | iterator cusp::array1d_view< RandomAccessIterator >::begin | ( | void | ) | const |
This method returns an iterator pointing to the beginning of this array1d_view.
| size_type cusp::array1d_view< RandomAccessIterator >::capacity | ( | void | ) | const |
Returns the number of elements which have been reserved in this array1d_view.
| iterator cusp::array1d_view< RandomAccessIterator >::end | ( | void | ) | const |
This method returns an iterator pointing to one element past the last of this array1d_view.
| reference cusp::array1d_view< RandomAccessIterator >::front | ( | void | ) | const |
This method returns a reference pointing to the first element of this array1d_view.
array1d_view. | array1d_view& cusp::array1d_view< RandomAccessIterator >::operator= | ( | const array1d_view< RandomAccessIterator > & | v | ) |
Assign operator copies from an exemplar array1d_view vector.
| v | The array1d_view vector to copy. |
array1d_view copy of input vector | reference cusp::array1d_view< RandomAccessIterator >::operator[] | ( | size_type | n | ) | const |
Subscript access to the data contained in this array1d_view.
| n | The index of the element for which data should be accessed. |
This operator allows for easy, array-style, data access. Note that data access with this operator is unchecked and out_of_range lookups are not defined.
| void cusp::array1d_view< RandomAccessIterator >::resize | ( | size_type | new_size | ) |
Resizes this array1d_view to the specified number of elements.
| new_size | Number of elements this array1d_view should contain. |
| std::length_error | If n exceeds max_size9). |
This method will resize this vector_base to the specified number of elements. If the number is smaller than this array1d_view's current size this array1d_view is truncated, otherwise throws an error.
| size_type cusp::array1d_view< RandomAccessIterator >::size | ( | void | ) | const |
Returns the number of elements in this array1d_view.
| view cusp::array1d_view< RandomAccessIterator >::subarray | ( | size_type | start_index, |
| size_type | num_entries | ||
| ) |
Extract a small vector from a array1d_view vector.
| start_index | The starting index of the sub-array. |
| num_entries | The number of entries in the sub-array. |
array1d_view containing elements [start_index,...,start_index+num_entries)| void cusp::array1d_view< RandomAccessIterator >::swap | ( | array1d_view< RandomAccessIterator > & | v | ) |
This method swaps the contents of this array1d_view with another array1d_view.
| v | The array1d_view with which to swap. |
|
protected |
The capacity of this array1d_view, in number of elements.
|
protected |
The size of this array1d_view, in number of elements.
1.8.6