Fork me on GitHub
 All Classes Files Functions Variables Groups Pages
Public Methods | List of all members
cusp::counting_array< ValueType > Class Template Reference

Detailed description

template<typename ValueType>
class cusp::counting_array< ValueType >

Specialized array1d_view wrapping thrust::counting_iterator.

Template Parameters
ValueTypecounting array element type.
Overview
The counting_array view is a simple wrapper around thrust::counting_iterator.
See Also
http://thrust.github.io/doc/classthrust_1_1counting__iterator.html
Example
// include cusp array1d header file
#include <cusp/array1d.h>
#include <cusp/print.h>
int main()
{
// Define the counting array from 0 to 4
// Define the counting array from 6 to 9
// [0,1,2,3,4]
// [6,7,8,9]
}

Definition at line 562 of file array1d.h.

#include <array1d.h>

Inheritance diagram for cusp::counting_array< ValueType >:
cusp::array1d_view< thrust::counting_iterator< ValueType > >

Public Methods

 counting_array (size_type size, ValueType init=ValueType(0))
 
- Public Methods inherited from cusp::array1d_view< thrust::counting_iterator< ValueType > >
 array1d_view (void)
 
 array1d_view (ArrayType &v)
 
 array1d_view (InputIterator begin, InputIterator end)
 
array1d_viewoperator= (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)
 

Additional Inherited Members

- Protected Members inherited from cusp::array1d_view< thrust::counting_iterator< ValueType > >
size_type m_size
 
size_type m_capacity
 

Constructor & Destructor Documentation

template<typename ValueType>
cusp::counting_array< ValueType >::counting_array ( size_type  size,
ValueType  init = ValueType(0) 
)
inline

This constructor creates a counting_array with a given size starting from a given initial value

Parameters
sizeThe number of entries
initThe initial starting index to start counting

Definition at line 581 of file array1d.h.