Gradient Augmented Levelset Implementation in CPU & GPU
Vec3< T > Class Template Reference

#include <vec3.h>

Public Types

using value_type = T
 

Public Member Functions

 Vec3 (const T a, const T b, const T c)
 
 Vec3 (const std::vector< T > a)
 
 Vec3 ()
 
 ~Vec3 ()
 
const int size () const
 
const T min () const
 
const double mag () const
 
const T operator[] (const int idx) const
 
T & operator[] (const int idx)
 
void operator= (const Vec3< T > &vec)
 
bool operator== (const Vec3< T > &vec) const
 
const Vec3< T > operator- (const Vec3< T > &vec) const
 
const Vec3< T > operator* (const Vec3< T > &vec) const
 
const Vec3< T > operator* (const T var) const
 
const Vec3< T > operator/ (const Vec3< T > &vec) const
 

Static Public Attributes

static constexpr int SIZE = 3
 

Friends

std::ostream & operator<< (std::ostream &out, const Vec3< T > &vec)
 

Detailed Description

template<typename T>
class GALS::CPU::Vec3< T >

Class to create 3 component elements at a computational cell. For e.x. velocity, gradients, etc.

Definition at line 46 of file vec3.h.

Member Typedef Documentation

using value_type = T

Definition at line 49 of file vec3.h.

Constructor & Destructor Documentation

Vec3 ( const T  a,
const T  b,
const T  c 
)

Constructor with 3 input arguments.

Parameters
a
b
c

Definition at line 37 of file vec3.cc.

Vec3 ( const std::vector< T >  a)

Constructor with std::vector.

Parameters
avariable of type std::vector<double> and of size 3.

Definition at line 45 of file vec3.cc.

Vec3 ( )

Default constructor.

Definition at line 55 of file vec3.cc.

~Vec3 ( )

Destructor

Definition at line 60 of file vec3.cc.

Member Function Documentation

const double mag ( ) const

Returns magnitude.

Returns
magnitude.

Definition at line 71 of file vec3.cc.

const T min ( ) const

Returns minimum value from the array.

Returns
minimum value.

Definition at line 77 of file vec3.cc.

const GALS::CPU::Vec3< T > operator* ( const Vec3< T > &  vec) const

Multiplication operator.

Component wise multiplication.

Parameters
vecvariable to multiply.
Returns
(this * vec).

Definition at line 115 of file vec3.cc.

const GALS::CPU::Vec3< T > operator* ( const T  var) const

Multiplication operator.

Component wise multiplication with a scalar.

Parameters
varvariable to multiply.
Returns
(this * var).

Definition at line 121 of file vec3.cc.

const GALS::CPU::Vec3< T > operator- ( const Vec3< T > &  vec) const

Subtraction operator.

Parameters
vecvariable to be subtracted.
Returns
(this - vec).

Definition at line 109 of file vec3.cc.

const GALS::CPU::Vec3< T > operator/ ( const Vec3< T > &  vec) const

Division operator.

Component wise division.

Parameters
vecvariable under division.
Returns
(this / vec).

Definition at line 127 of file vec3.cc.

void operator= ( const Vec3< T > &  vec)

Overload assignment operator.

Parameters
vecvariable whose values will be assigned.

Definition at line 97 of file vec3.cc.

bool operator== ( const Vec3< T > &  vec) const

Equality operator.

Parameters
vecvariable to compare against.
Returns
true if equal, false otherwise.

Definition at line 103 of file vec3.cc.

const T operator[] ( const int  idx) const

Overloaded subscript operator that returns a const value.

Parameters
idxzero based index of element.
Returns
element at index (idx).

Definition at line 85 of file vec3.cc.

T & operator[] ( const int  idx)

Overloaded subscript operator that returns a reference.

Parameters
idxzero based index of element.
Returns
element at index (idx).

Definition at line 91 of file vec3.cc.

const int size ( ) const

Returns number of elements.

Returns
number of elements.

Definition at line 65 of file vec3.cc.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const Vec3< T > &  vec 
)
friend

Output operator overload.

Parameters
outoutput stream.
vecVec3 object to output stream.
Returns
reference to output stream.

Definition at line 168 of file vec3.h.

Field Documentation

constexpr int SIZE = 3
static

Definition at line 51 of file vec3.h.


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