ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
ModuleBase::Vector3< T > Class Template Reference

3 elements vector More...

#include <vector3.h>

Inheritance diagram for ModuleBase::Vector3< T >:
Collaboration diagram for ModuleBase::Vector3< T >:

Public Member Functions

 Vector3 (const T &x1=0, const T &y1=0, const T &z1=0)
 Construct a new Vector 3 object.
 
 Vector3 (const Vector3< T > &v)
 
 Vector3 (const std::array< T, 3 > &v)
 
template<typename U >
 Vector3 (const Vector3< U > &other)
 
 Vector3 (Vector3< T > &&v) noexcept
 
void set (const T &x1, const T &y1, const T &z1)
 set a 3d vector
 
Vector3< T > & operator= (const Vector3< T > &u)
 Overload operator "=" for Vector3.
 
Vector3< T > & operator= (const T &u)
 
Vector3< T > & operator+= (const Vector3< T > &u)
 Overload operator "+=" for Vector3.
 
Vector3< T > & operator-= (const Vector3< T > &u)
 Overload operator "-=" for Vector3.
 
Vector3< T > & operator*= (const T &s)
 Overload operator "*=" for (Vector3)*scalar.
 
Vector3< T > & operator/= (const T &s)
 Overload operator "/=" for (Vector3)/scalar.
 
Vector3< Toperator- () const
 Overload operator "-" to get (-Vector3)
 
T operator[] (int index) const
 Over load "[]" for accessing elements with pointers.
 
Toperator[] (int index)
 Overload operator "[]" for accesing elements.
 
T norm2 (void) const
 Get the square of nomr of a Vector3.
 
T norm (void) const
 Get the norm of a Vector3.
 
Vector3< T > & normalize (void)
 Normalize a Vector3.
 
Vector3< T > & reverse (void)
 Get (-Vector3)
 
void print (void) const
 Print a Vector3 on standard output with formats.
 

Public Attributes

T x
 
T y
 
T z
 

Detailed Description

template<class T>
class ModuleBase::Vector3< T >

3 elements vector

Template Parameters
T
Examples
/home/runner/work/abacus-develop/abacus-develop/source/source_basis/module_pw/pw_distributeg_method1.cpp.

Constructor & Destructor Documentation

◆ Vector3() [1/5]

template<class T >
ModuleBase::Vector3< T >::Vector3 ( const T x1 = 0,
const T y1 = 0,
const T z1 = 0 
)
inline

Construct a new Vector 3 object.

Parameters
x1
y1
z1

◆ Vector3() [2/5]

template<class T >
ModuleBase::Vector3< T >::Vector3 ( const Vector3< T > &  v)
inline

◆ Vector3() [3/5]

template<class T >
ModuleBase::Vector3< T >::Vector3 ( const std::array< T, 3 > &  v)
inlineexplicit

◆ Vector3() [4/5]

template<class T >
template<typename U >
ModuleBase::Vector3< T >::Vector3 ( const Vector3< U > &  other)
inlineexplicit

◆ Vector3() [5/5]

template<class T >
ModuleBase::Vector3< T >::Vector3 ( Vector3< T > &&  v)
inlinenoexcept

Member Function Documentation

◆ norm()

template<class T >
T ModuleBase::Vector3< T >::norm ( void  ) const
inline

Get the norm of a Vector3.

Returns
T
Here is the call graph for this function:
Here is the caller graph for this function:

◆ norm2()

template<class T >
T ModuleBase::Vector3< T >::norm2 ( void  ) const
inline

Get the square of nomr of a Vector3.

Returns
T
Here is the caller graph for this function:

◆ normalize()

template<class T >
Vector3< T > & ModuleBase::Vector3< T >::normalize ( void  )
inline

Normalize a Vector3.

Returns
Vector3<T>&
Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator*=()

template<class T >
Vector3< T > & ModuleBase::Vector3< T >::operator*= ( const T s)
inline

Overload operator "*=" for (Vector3)*scalar.

Parameters
s
Returns
Vector3<T>&

◆ operator+=()

template<class T >
Vector3< T > & ModuleBase::Vector3< T >::operator+= ( const Vector3< T > &  u)
inline

Overload operator "+=" for Vector3.

Parameters
u
Returns
Vector3<T>&

◆ operator-()

template<class T >
Vector3< T > ModuleBase::Vector3< T >::operator- ( ) const
inline

Overload operator "-" to get (-Vector3)

Returns
Vector3<T>

◆ operator-=()

template<class T >
Vector3< T > & ModuleBase::Vector3< T >::operator-= ( const Vector3< T > &  u)
inline

Overload operator "-=" for Vector3.

Parameters
u
Returns
Vector3<T>&

◆ operator/=()

template<class T >
Vector3< T > & ModuleBase::Vector3< T >::operator/= ( const T s)
inline

Overload operator "/=" for (Vector3)/scalar.

Parameters
s
Returns
Vector3<T>&

◆ operator=() [1/2]

template<class T >
Vector3< T > & ModuleBase::Vector3< T >::operator= ( const T u)
inline

◆ operator=() [2/2]

template<class T >
Vector3< T > & ModuleBase::Vector3< T >::operator= ( const Vector3< T > &  u)
inline

Overload operator "=" for Vector3.

Parameters
u
Returns
Vector3<T>&

◆ operator[]() [1/2]

template<class T >
T & ModuleBase::Vector3< T >::operator[] ( int  index)
inline

Overload operator "[]" for accesing elements.

Parameters
index
Returns
T&

◆ operator[]() [2/2]

template<class T >
T ModuleBase::Vector3< T >::operator[] ( int  index) const
inline

Over load "[]" for accessing elements with pointers.

Parameters
index
Returns
T

◆ print()

template<class T >
void ModuleBase::Vector3< T >::print ( void  ) const

Print a Vector3 on standard output with formats.

Here is the caller graph for this function:

◆ reverse()

template<class T >
Vector3< T > & ModuleBase::Vector3< T >::reverse ( void  )
inline

Get (-Vector3)

Returns
Vector3<T>&
Here is the caller graph for this function:

◆ set()

template<class T >
void ModuleBase::Vector3< T >::set ( const T x1,
const T y1,
const T z1 
)
inline

set a 3d vector

Parameters
x1
y1
z1
Here is the caller graph for this function:

Member Data Documentation

◆ x

template<class T >
T ModuleBase::Vector3< T >::x

◆ y

template<class T >
T ModuleBase::Vector3< T >::y

◆ z

template<class T >
T ModuleBase::Vector3< T >::z

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