OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
Public Member Functions | List of all members
Vector< T > Class Template Reference

Vector. More...

#include <Vector.h>

Inheritance diagram for Vector< T >:
Inheritance graph
[legend]
Collaboration diagram for Vector< T >:
Collaboration graph
[legend]

Public Member Functions

 Vector ()
 Default constructor. More...
 
 Vector (int n)
 Constructor. More...
 
 Vector (int n, const T &t)
 Constructor. More...
 
 Vector (const Array1D< T > &)
 Conversion. More...
 
 Vector (const Vector< T > &)
 
 ~Vector ()
 
Vector< T > & operator= (const Vector< T > &)
 
Vector< T > operator- () const
 Change sign of vector. More...
 
Vector< T > & operator*= (const T &)
 Multiply by scalar and assign. More...
 
Vector< T > & operator/= (const T &)
 Divide by scalar and assign. More...
 
Vector< T > & operator+= (const Vector< T > &)
 Add vector and assign. More...
 
Vector< T > & operator-= (const Vector< T > &)
 Subtract vector and assign. More...
 
- Public Member Functions inherited from Array1D< T >
 Array1D ()
 Default constructor. More...
 
 Array1D (int n)
 Constructor. More...
 
 Array1D (int n, const T &t)
 Constructor. More...
 
 Array1D (const Array1D< T > &)
 
 ~Array1D ()
 
Array1D< T > & operator= (const Array1D< T > &)
 
T & operator() (int n)
 Get reference to element. More...
 
const T & operator() (int n) const
 Get value of element. More...
 
T & operator[] (int)
 Get reference to element. More...
 
const T & operator[] (int) const
 Get value of element. More...
 
iterator begin ()
 Get beginning of data. More...
 
iterator end ()
 Get end of data. More...
 
const_iterator begin () const
 Get beginning of data. More...
 
const_iterator end () const
 Get end of data. More...
 
int size () const
 Get array size. More...
 
void resize (int size)
 Change array size. More...
 

Additional Inherited Members

- Public Types inherited from Array1D< T >
typedef T value_type
 The value type of this array. More...
 
typedef T * iterator
 The iterator type for the array. More...
 
typedef const T * const_iterator
 The iterator type for constant array. More...
 
- Protected Attributes inherited from Array1D< T >
int len
 
T * data
 

Detailed Description

template<class T>
class Vector< T >

Vector.

Definition at line 37 of file Vector.h.

Constructor & Destructor Documentation

◆ Vector() [1/5]

template<class T >
Vector< T >::Vector

Default constructor.

Definition at line 109 of file Vector.h.

◆ Vector() [2/5]

template<class T >
Vector< T >::Vector ( int  n)
explicit

Constructor.

Definition at line 115 of file Vector.h.

◆ Vector() [3/5]

template<class T >
Vector< T >::Vector ( int  n,
const T &  t 
)

Constructor.

Definition at line 121 of file Vector.h.

◆ Vector() [4/5]

template<class T >
Vector< T >::Vector ( const Array1D< T > &  array)

Conversion.

Definition at line 133 of file Vector.h.

◆ Vector() [5/5]

template<class T >
Vector< T >::Vector ( const Vector< T > &  array)

Definition at line 127 of file Vector.h.

◆ ~Vector()

template<class T >
Vector< T >::~Vector

Definition at line 139 of file Vector.h.

Member Function Documentation

◆ operator*=()

template<class T >
Vector< T > & Vector< T >::operator*= ( const T &  val)

Multiply by scalar and assign.

Definition at line 159 of file Vector.h.

References begin(), and end().

Here is the call graph for this function:

◆ operator+=()

template<class T >
Vector< T > & Vector< T >::operator+= ( const Vector< T > &  array)

Add vector and assign.

Definition at line 175 of file Vector.h.

References Array1D< T >::begin(), begin(), and end().

Here is the call graph for this function:

◆ operator-()

template<class T >
Vector< T > Vector< T >::operator-

Change sign of vector.

Definition at line 151 of file Vector.h.

References Array1D< T >::begin(), begin(), and end().

Here is the call graph for this function:

◆ operator-=()

template<class T >
Vector< T > & Vector< T >::operator-= ( const Vector< T > &  array)

Subtract vector and assign.

Definition at line 183 of file Vector.h.

References Array1D< T >::begin(), begin(), and end().

Here is the call graph for this function:

◆ operator/=()

template<class T >
Vector< T > & Vector< T >::operator/= ( const T &  val)

Divide by scalar and assign.

Definition at line 167 of file Vector.h.

References begin(), and end().

Here is the call graph for this function:

◆ operator=()

template<class T >
Vector< T > & Vector< T >::operator= ( const Vector< T > &  right)

Definition at line 144 of file Vector.h.

References Array1D< T >::operator=().

Here is the call graph for this function:

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