CUSP
Loading...
Searching...
No Matches
cusp::constant_array< ValueType > Class Template Reference

#include <array1d.h>

Inheritance diagram for cusp::constant_array< ValueType >:
cusp::array1d_view< thrust::constant_iterator< ValueType > >

Public Methods

 constant_array (size_type size, ValueType value)
 
- Public Methods inherited from cusp::array1d_view< thrust::constant_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.
 
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.
 
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::constant_iterator< ValueType > >
size_type m_size
 
size_type m_capacity
 

Detailed description

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

Specialized array1d_view wrapping thrust::constant_iterator.

Template Parameters
ValueTypeconstant array element type.
Overview
The constant_array view is a simple wrapper around constant_iterator.
See also
http://thrust.github.io/doc/classthrust_1_1constant__iterator.html
Example
// include cusp array1d header file
#include <cusp/array1d.h>
#include <cusp/print.h>
int main()
{
// Define the constant array of length 4 with value 3
// [3,3,3,3]
}
1D array of elements that may reside in "host" or "device" memory space
Specialized array1d_view wrapping thrust::constant_iterator.
Definition array1d.h:616
void print(const Printable &p)
print a textual representation of an object
Print textual representation of an object.

Definition at line 614 of file array1d.h.

Constructor & Destructor Documentation

◆ constant_array()

template<typename ValueType >
cusp::constant_array< ValueType >::constant_array ( size_type  size,
ValueType  value 
)
inline

This constructor creates a constant_array with a given size starting and value

Parameters
sizeThe number of entries.
valueThe constant value to repeat.

Definition at line 633 of file array1d.h.