ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
LCAO_domain::ModuleBase::Vector3< T > Class Template Reference

3 elements vector More...

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

Public Member Functions

 Vector3 (const T &x1=0, const T &y1=0, const T &z1=0)
 Default constructor.
 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= (Vector3< T > &&u) noexcept
 Move assignment operator.
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.
Vector3< T > operator- () const
 Overload operator "-" to get (-Vector3).
T operator[] (int index) const
 Over load "[]" for accessing elements with pointers.
T & operator[] (int index)
 Overload operator "[]" for accesing elements.
T norm2 (void) const
 Get the square of norm 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 (const int precision=5) const
 Print a Vector3 on standard output with formats.

Public Attributes

T x
T y
T z

Detailed Description

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

3 elements vector

Template Parameters
T

Constructor & Destructor Documentation

◆ Vector3() [1/5]

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

Default constructor.

Parameters
x1
y1
z1

◆ Vector3() [2/5]

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

◆ Vector3() [3/5]

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

◆ Vector3() [4/5]

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

◆ Vector3() [5/5]

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

Member Function Documentation

◆ norm()

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

Get the norm of a Vector3.

Returns
T
Here is the caller graph for this function:

◆ norm2()

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

Get the square of norm of a Vector3.

Returns
T
Here is the caller graph for this function:

◆ normalize()

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

Normalize a Vector3.

Returns
Vector3<T>&

◆ operator*=()

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

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

Parameters
s
Returns
Vector3<T>&

◆ operator+=()

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

Overload operator "+=" for Vector3.

Parameters
u
Returns
Vector3<T>&

◆ operator-()

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

Overload operator "-" to get (-Vector3).

Returns
Vector3<T>

◆ operator-=()

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

Overload operator "-=" for Vector3.

Parameters
u
Returns
Vector3<T>&

◆ operator/=()

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

Overload operator "/=" for Vector3.

Parameters
s
Returns
Vector3<T>&

◆ operator=() [1/3]

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

◆ operator=() [2/3]

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

Overload operator "=" for Vector3.

Parameters
u
Returns
Vector3<T>&

◆ operator=() [3/3]

template<class T>
Vector3< T > & LCAO_domain::ModuleBase::Vector3< T >::operator= ( Vector3< T > && u)
inlinenoexcept

Move assignment operator.

Parameters
u
Returns
Vector3<T>&

◆ operator[]() [1/2]

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

Overload operator "[]" for accesing elements.

Parameters
index
Returns
T&

◆ operator[]() [2/2]

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

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

Parameters
index
Returns
T

◆ print()

template<class T>
void LCAO_domain::ModuleBase::Vector3< T >::print ( const int precision = 5) const

Print a Vector3 on standard output with formats.

Print a Vector3 on standard output with formats

Parameters
precisionThe number of decimal places to display (must be positive, default: 5)
precisionThe number of decimal places to display (must be positive, default: 5)
Here is the call graph for this function:

◆ reverse()

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

Get (-Vector3).

Returns
Vector3<T>&

◆ set()

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

set a 3d vector

Parameters
x1
y1
z1

Member Data Documentation

◆ x

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

◆ y

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

◆ z

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

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