Graph Framework
Loading...
Searching...
No Matches
graph::vector_quantity< T, SAFE_MATH > Class Template Reference

Class to represent vector quantities. More...

#include <vector.hpp>

Inheritance diagram for graph::vector_quantity< T, SAFE_MATH >:

Public Member Functions

 vector_quantity (shared_leaf< T, SAFE_MATH > x, shared_leaf< T, SAFE_MATH > y, shared_leaf< T, SAFE_MATH > z)
 Construct a new vector_quantity.
 
shared_leaf< T, SAFE_MATHget_x () const
 Get the x component.
 
shared_leaf< T, SAFE_MATHget_y () const
 Get the y component.
 
shared_leaf< T, SAFE_MATHget_z () const
 Get the z component.
 
shared_leaf< T, SAFE_MATHdot (std::shared_ptr< vector_quantity< T, SAFE_MATH > > v2)
 Vector dot product.
 
std::shared_ptr< vector_quantity< T, SAFE_MATH > > cross (std::shared_ptr< vector_quantity< T, SAFE_MATH > > v2)
 Vector cross product.
 
shared_leaf< T, SAFE_MATHlength ()
 Get the length of the vector.
 
std::shared_ptr< vector_quantity< T, SAFE_MATH > > unit ()
 Get the unit vector.
 
std::shared_ptr< vector_quantity< T, SAFE_MATH > > df (shared_leaf< T, SAFE_MATH > arg)
 Take a derivative with respect to each component.
 
std::shared_ptr< vector_quantity< T, SAFE_MATH > > remove_pseudo ()
 Remove pseudo variables.
 

Protected Attributes

shared_leaf< T, SAFE_MATHx
 X component of the vector.
 
shared_leaf< T, SAFE_MATHy
 Y component of the vector.
 
shared_leaf< T, SAFE_MATHz
 Z component of the vector.
 

Detailed Description

template<jit::float_scalar T, bool SAFE_MATH = false>
class graph::vector_quantity< T, SAFE_MATH >

Class to represent vector quantities.

Template Parameters
TBase type of the calculation.
SAFE_MATHUse Safe Math operations.

Constructor & Destructor Documentation

◆ vector_quantity()

template<jit::float_scalar T, bool SAFE_MATH = false>
graph::vector_quantity< T, SAFE_MATH >::vector_quantity ( shared_leaf< T, SAFE_MATH x,
shared_leaf< T, SAFE_MATH y,
shared_leaf< T, SAFE_MATH z 
)
inline

Construct a new vector_quantity.

Parameters
[in]xX vector component.
[in]yY vector component.
[in]zZ Vector component.

Member Function Documentation

◆ cross()

template<jit::float_scalar T, bool SAFE_MATH = false>
std::shared_ptr< vector_quantity< T, SAFE_MATH > > graph::vector_quantity< T, SAFE_MATH >::cross ( std::shared_ptr< vector_quantity< T, SAFE_MATH > >  v2)
inline

Vector cross product.

Parameters
[in]v2Second vector.
Returns
v1 X v2

◆ df()

template<jit::float_scalar T, bool SAFE_MATH = false>
std::shared_ptr< vector_quantity< T, SAFE_MATH > > graph::vector_quantity< T, SAFE_MATH >::df ( shared_leaf< T, SAFE_MATH arg)
inline

Take a derivative with respect to each component.

Parameters
[in]argThe variable to take the derivative to.
Returns
A vector of the derivative components.

◆ dot()

template<jit::float_scalar T, bool SAFE_MATH = false>
shared_leaf< T, SAFE_MATH > graph::vector_quantity< T, SAFE_MATH >::dot ( std::shared_ptr< vector_quantity< T, SAFE_MATH > >  v2)
inline

Vector dot product.

Parameters
[in]v2Second vector.
Returns
v1.v2

◆ get_x()

template<jit::float_scalar T, bool SAFE_MATH = false>
shared_leaf< T, SAFE_MATH > graph::vector_quantity< T, SAFE_MATH >::get_x ( ) const
inline

Get the x component.

Returns
x

◆ get_y()

template<jit::float_scalar T, bool SAFE_MATH = false>
shared_leaf< T, SAFE_MATH > graph::vector_quantity< T, SAFE_MATH >::get_y ( ) const
inline

Get the y component.

Returns
y

◆ get_z()

template<jit::float_scalar T, bool SAFE_MATH = false>
shared_leaf< T, SAFE_MATH > graph::vector_quantity< T, SAFE_MATH >::get_z ( ) const
inline

Get the z component.

Returns
z

◆ length()

template<jit::float_scalar T, bool SAFE_MATH = false>
shared_leaf< T, SAFE_MATH > graph::vector_quantity< T, SAFE_MATH >::length ( )
inline

Get the length of the vector.

Returns
|V|

◆ remove_pseudo()

template<jit::float_scalar T, bool SAFE_MATH = false>
std::shared_ptr< vector_quantity< T, SAFE_MATH > > graph::vector_quantity< T, SAFE_MATH >::remove_pseudo ( )
inline

Remove pseudo variables.

Returns
the vector with pseudo variables removed.

◆ unit()

template<jit::float_scalar T, bool SAFE_MATH = false>
std::shared_ptr< vector_quantity< T, SAFE_MATH > > graph::vector_quantity< T, SAFE_MATH >::unit ( )
inline

Get the unit vector.

Returns
v_hat

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