OpenMPCD
|
Represents a vector whose data is stored elsewhere. More...
#include <RemotelyStoredVector.hpp>
Public Member Functions | |
OPENMPCD_CUDA_HOST_AND_DEVICE | RemotelyStoredVector (T *const storageBase, const std::size_t vectorID=0) |
The constructor. More... | |
OPENMPCD_CUDA_HOST_AND_DEVICE | RemotelyStoredVector (const RemotelyStoredVector< T, D > &rhs) |
The copy constructor. More... | |
OPENMPCD_CUDA_HOST_AND_DEVICE T | get (const unsigned int i) const |
Returns the coodinate with the given index. More... | |
OPENMPCD_CUDA_HOST_AND_DEVICE T | getX () const |
Returns the x coodinate. More... | |
OPENMPCD_CUDA_HOST_AND_DEVICE void | setX (const T val) |
Sets the x coordinate. More... | |
OPENMPCD_CUDA_HOST_AND_DEVICE void | addToX (const T val) |
Adds the given value to the x coordinate. More... | |
OPENMPCD_CUDA_HOST_AND_DEVICE T | getY () const |
Returns the y coodinate. More... | |
OPENMPCD_CUDA_HOST_AND_DEVICE void | setY (const FP val) |
Sets the y coordinate. More... | |
OPENMPCD_CUDA_HOST_AND_DEVICE FP | getZ () const |
Returns the z coodinate. More... | |
OPENMPCD_CUDA_HOST_AND_DEVICE void | setZ (const FP val) |
Sets the z coordinate. More... | |
OPENMPCD_CUDA_DEVICE void | atomicAdd (const RemotelyStoredVector< typename boost::add_const< T >::type, D > &rhs) |
Atomically adds the right-hand-side instance to this instance. More... | |
OPENMPCD_CUDA_DEVICE void | atomicAdd (const RemotelyStoredVector< typename boost::remove_const< T >::type, D > &rhs) |
Atomically adds the right-hand-side instance to this instance. More... | |
OPENMPCD_CUDA_DEVICE void | atomicAdd (const Vector3D< typename boost::remove_const< T >::type > &rhs) |
Atomically adds the right-hand-side instance to this instance. More... | |
OPENMPCD_CUDA_HOST_AND_DEVICE T | dot (const RemotelyStoredVector &rhs) const |
Returns the scalar product of this vector with the given vector. More... | |
OPENMPCD_CUDA_HOST_AND_DEVICE T | getMagnitudeSquared () const |
Returns the square of the magnitude of this vector. More... | |
OPENMPCD_CUDA_HOST_AND_DEVICE T | getMagnitude () const |
Returns the magnitude of this vector. More... | |
OPENMPCD_CUDA_HOST_AND_DEVICE bool | isFinite () const |
Returns whether all components are finite, i.e. More... | |
const OPENMPCD_CUDA_HOST_AND_DEVICE RemotelyStoredVector & | operator= (const RemotelyStoredVector &rhs) |
The assignment operator. More... | |
const OPENMPCD_CUDA_HOST_AND_DEVICE RemotelyStoredVector & | operator= (const Vector3D< T > &rhs) |
The assignment operator. More... | |
const OPENMPCD_CUDA_HOST_AND_DEVICE RemotelyStoredVector & | operator+= (const Vector3D< T > &rhs) |
The addition-and-assignment operator. More... | |
const OPENMPCD_CUDA_HOST_AND_DEVICE Vector3D< typename boost::remove_const< T >::type > | operator+ (const RemotelyStoredVector &rhs) const |
Addition operator. More... | |
const OPENMPCD_CUDA_HOST_AND_DEVICE Vector3D< typename boost::remove_const< T >::type > | operator+ (const Vector3D< typename boost::remove_const< T >::type > &rhs) const |
Addition operator. More... | |
const OPENMPCD_CUDA_HOST_AND_DEVICE Vector3D< typename boost::remove_const< T >::type > | operator- (const RemotelyStoredVector &rhs) const |
Substraction operator. More... | |
const OPENMPCD_CUDA_HOST_AND_DEVICE Vector3D< typename boost::remove_const< T >::type > | operator- (const Vector3D< typename boost::remove_const< T >::type > &rhs) const |
Substraction operator. More... | |
const OPENMPCD_CUDA_HOST_AND_DEVICE RemotelyStoredVector & | operator*= (const FP rhs) |
The scalar multiplication-and-assignment operator. More... | |
const OPENMPCD_CUDA_HOST_AND_DEVICE Vector3D< typename boost::remove_const< T >::type > | operator* (const FP rhs) const |
The scalar multiplication operator. More... | |
const OPENMPCD_CUDA_HOST_AND_DEVICE Vector3D< typename boost::remove_const< T >::type > | operator/ (const FP rhs) const |
Scalar division operator. More... | |
const OPENMPCD_CUDA_HOST_AND_DEVICE RemotelyStoredVector | operator/= (const FP rhs) |
Scalar division-and-assignment operator. More... | |
OPENMPCD_CUDA_HOST_AND_DEVICE | operator Vector3D< typename boost::remove_const< T >::type > () const |
Converts this instance into a Vector3D. More... | |
OPENMPCD_CUDA_HOST_AND_DEVICE bool | operator== (const Vector3D< typename boost::remove_const< T >::type > &rhs) const |
The comparison operator. More... | |
OPENMPCD_CUDA_HOST_AND_DEVICE bool | operator!= (const Vector3D< typename boost::remove_const< T >::type > &rhs) const |
The inequality operator. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &stream, const RemotelyStoredVector &vector) |
Output operator for streams. More... | |
Represents a vector whose data is stored elsewhere.
T | The type stored. |
D | The dimensionality of the vector. |
Definition at line 26 of file RemotelyStoredVector.hpp.
|
inline |
The constructor.
[in] | storageBase | The base address of the storage. |
[in] | vectorID | The ID of the vector in the given storage. |
Definition at line 37 of file RemotelyStoredVector.hpp.
|
inline |
The copy constructor.
[in] | rhs | The right-hand-side instance. |
Definition at line 47 of file RemotelyStoredVector.hpp.
|
inline |
Adds the given value to the x coordinate.
[in] | val | The value to add |
Definition at line 92 of file RemotelyStoredVector.hpp.
OPENMPCD_CUDA_DEVICE void OpenMPCD::RemotelyStoredVector< T, D >::atomicAdd | ( | const RemotelyStoredVector< typename boost::add_const< T >::type, D > & | rhs | ) |
Atomically adds the right-hand-side instance to this instance.
[in] | rhs | The right-hand-side. |
OPENMPCD_CUDA_DEVICE void OpenMPCD::RemotelyStoredVector< T, D >::atomicAdd | ( | const RemotelyStoredVector< typename boost::remove_const< T >::type, D > & | rhs | ) |
Atomically adds the right-hand-side instance to this instance.
[in] | rhs | The right-hand-side. |
OPENMPCD_CUDA_DEVICE void OpenMPCD::RemotelyStoredVector< T, D >::atomicAdd | ( | const Vector3D< typename boost::remove_const< T >::type > & | rhs | ) |
Atomically adds the right-hand-side instance to this instance.
[in] | rhs | The right-hand-side. |
|
inline |
Returns the scalar product of this vector with the given vector.
[in] | rhs | The right-hand-side. |
Definition at line 170 of file RemotelyStoredVector.hpp.
|
inline |
Returns the coodinate with the given index.
OutOfBoundsException | If OPENMPCD_DEBUG is defined, in Host code, throws if i >= D. |
[in] | i | The coordinate index. |
Definition at line 59 of file RemotelyStoredVector.hpp.
|
inline |
Returns the magnitude of this vector.
Definition at line 191 of file RemotelyStoredVector.hpp.
|
inline |
Returns the square of the magnitude of this vector.
Definition at line 182 of file RemotelyStoredVector.hpp.
|
inline |
Returns the x coodinate.
Definition at line 72 of file RemotelyStoredVector.hpp.
|
inline |
Returns the y coodinate.
Definition at line 101 of file RemotelyStoredVector.hpp.
|
inline |
Returns the z coodinate.
Definition at line 124 of file RemotelyStoredVector.hpp.
|
inline |
Returns whether all components are finite, i.e.
neither infinite nor NaN.
Definition at line 200 of file RemotelyStoredVector.hpp.
|
inline |
Converts this instance into a Vector3D.
Definition at line 395 of file RemotelyStoredVector.hpp.
|
inline |
The inequality operator.
[in] | rhs | The right-hand-side value. |
Definition at line 429 of file RemotelyStoredVector.hpp.
|
inline |
The scalar multiplication operator.
[in] | rhs | The scalar factor. |
Definition at line 350 of file RemotelyStoredVector.hpp.
|
inline |
The scalar multiplication-and-assignment operator.
[in] | rhs | The scalar factor. |
Definition at line 334 of file RemotelyStoredVector.hpp.
|
inline |
Addition operator.
[in] | rhs | The right-hand-side vector. |
Definition at line 270 of file RemotelyStoredVector.hpp.
|
inline |
Addition operator.
[in] | rhs | The right-hand-side vector. |
Definition at line 286 of file RemotelyStoredVector.hpp.
|
inline |
The addition-and-assignment operator.
[in] | rhs | The right-hand-side instance. |
Definition at line 253 of file RemotelyStoredVector.hpp.
|
inline |
Substraction operator.
[in] | rhs | The right-hand-side vector. |
Definition at line 302 of file RemotelyStoredVector.hpp.
|
inline |
Substraction operator.
[in] | rhs | The right-hand-side vector. |
Definition at line 318 of file RemotelyStoredVector.hpp.
|
inline |
Scalar division operator.
[in] | rhs | The right-hand-side scalar. |
Definition at line 365 of file RemotelyStoredVector.hpp.
|
inline |
Scalar division-and-assignment operator.
[in] | rhs | The right-hand-side scalar. |
Definition at line 380 of file RemotelyStoredVector.hpp.
|
inline |
The assignment operator.
[in] | rhs | The right-hand-side instance. |
Definition at line 222 of file RemotelyStoredVector.hpp.
|
inline |
The assignment operator.
[in] | rhs | The right-hand-side instance. |
Definition at line 236 of file RemotelyStoredVector.hpp.
|
inline |
The comparison operator.
[in] | rhs | The right-hand-side value. |
Definition at line 408 of file RemotelyStoredVector.hpp.
|
inline |
Sets the x coordinate.
[in] | val | The new value. |
Definition at line 82 of file RemotelyStoredVector.hpp.
|
inline |
Sets the y coordinate.
[in] | val | The new value. |
Definition at line 113 of file RemotelyStoredVector.hpp.
|
inline |
Sets the z coordinate.
[in] | val | The new value. |
Definition at line 136 of file RemotelyStoredVector.hpp.
|
friend |
Output operator for streams.
Appends vector.getX()
, vector.getY()
, and vector.getZ()
to the stream in that order, separated by single spaces (" "
).
[in] | stream | The stream to print to. |
[in] | vector | The vector to print. |
Definition at line 448 of file RemotelyStoredVector.hpp.