omega_h
Reliable mesh adaptation
Public Types | Public Member Functions | List of all members
Omega_h::HostWrite< T > Class Template Reference

Public Types

using value_type = T
 

Public Member Functions

 HostWrite (LO size_in, std::string const &name="")
 
 HostWrite (LO size_in, T offset, T stride, std::string const &name="")
 Constructs a HostWrite object with specified size, offset, and stride. More...
 
 HostWrite (Write< T > write_in)
 
 HostWrite (std::initializer_list< T > l, std::string const &name="")
 
Write< T > write () const
 
LO size () const OMEGA_H_NOEXCEPT
 
T & operator[] (LO i) const OMEGA_H_NOEXCEPT
 
T * data () const
 
OMEGA_H_INLINE bool exists () const OMEGA_H_NOEXCEPT
 
void set (LO i, T value)
 
get (LO i) const
 
T * begin () const noexcept
 
T * end () const OMEGA_H_NOEXCEPT
 

Constructor & Destructor Documentation

◆ HostWrite()

template<typename T >
Omega_h::HostWrite< T >::HostWrite ( LO  size_in,
offset,
stride,
std::string const &  name = "" 
)

Constructs a HostWrite object with specified size, offset, and stride.

Parameters
size_inThe number of entries in the array.
offsetThe initial value to set for the first entry of the array.
strideThe difference between the values of consecutive entries in the array.
nameThe name of the array for identification purposes (default is an empty string).

This constructor initializes a HostWrite array with the given size, setting the first entry to the specified offset, and each subsequent entry to the previous entry's value plus the stride. The array is given a name for identification. For example, HostWrite<Real> h_write(10, 7.0, 0.0); will create a write array of size 10 and all filled with 7.0.


The documentation for this class was generated from the following files: