SIRIUS 7.5.0
Electronic structure library and applications
Public Member Functions | List of all members
sirius::r3::vector< T > Class Template Reference

Simple implementation of 3d vector. More...

#include <r3.hpp>

Inherits std::array< T, 3 >.

Public Member Functions

 vector ()
 Create zero vector. More...
 
 vector (T x, T y, T z)
 Create arbitrary vector. More...
 
 vector (std::initializer_list< T > v__)
 Create from std::initializer_list. More...
 
vectoroperator= (std::initializer_list< T > v__)
 
 vector (std::vector< T > const &v__)
 Create from std::vector. More...
 
vectoroperator= (std::vector< T > const &v__)
 
 vector (T const *ptr__)
 Create from raw pointer. More...
 
 vector (std::array< T, 3 > v__)
 Create from array. More...
 
 vector (vector< T > const &vec__)
 Copy constructor. More...
 
l1norm () const
 Return L1 norm of the vector. More...
 
double length () const
 Return vector length (L2 norm). More...
 
double length2 () const
 Return square length of the vector. More...
 
vector< T > & operator+= (vector< T > const &b)
 
vector< T > & operator-= (vector< T > const &b)
 

Detailed Description

template<typename T>
class sirius::r3::vector< T >

Simple implementation of 3d vector.

Definition at line 44 of file r3.hpp.

Constructor & Destructor Documentation

◆ vector() [1/7]

template<typename T >
sirius::r3::vector< T >::vector ( )
inline

Create zero vector.

Definition at line 48 of file r3.hpp.

◆ vector() [2/7]

template<typename T >
sirius::r3::vector< T >::vector ( x,
y,
z 
)
inline

Create arbitrary vector.

Definition at line 54 of file r3.hpp.

◆ vector() [3/7]

template<typename T >
sirius::r3::vector< T >::vector ( std::initializer_list< T >  v__)
inline

Create from std::initializer_list.

Definition at line 60 of file r3.hpp.

◆ vector() [4/7]

template<typename T >
sirius::r3::vector< T >::vector ( std::vector< T > const &  v__)
inline

Create from std::vector.

Definition at line 78 of file r3.hpp.

◆ vector() [5/7]

template<typename T >
sirius::r3::vector< T >::vector ( T const *  ptr__)
inline

Create from raw pointer.

Definition at line 96 of file r3.hpp.

◆ vector() [6/7]

template<typename T >
sirius::r3::vector< T >::vector ( std::array< T, 3 >  v__)
inline

Create from array.

Definition at line 104 of file r3.hpp.

◆ vector() [7/7]

template<typename T >
sirius::r3::vector< T >::vector ( vector< T > const &  vec__)
inline

Copy constructor.

Definition at line 112 of file r3.hpp.

Member Function Documentation

◆ operator=() [1/2]

template<typename T >
vector & sirius::r3::vector< T >::operator= ( std::initializer_list< T >  v__)
inline

Definition at line 68 of file r3.hpp.

◆ operator=() [2/2]

template<typename T >
vector & sirius::r3::vector< T >::operator= ( std::vector< T > const &  v__)
inline

Definition at line 86 of file r3.hpp.

◆ l1norm()

template<typename T >
T sirius::r3::vector< T >::l1norm ( ) const
inline

Return L1 norm of the vector.

Definition at line 120 of file r3.hpp.

◆ length()

template<typename T >
double sirius::r3::vector< T >::length ( ) const
inline

Return vector length (L2 norm).

Definition at line 126 of file r3.hpp.

◆ length2()

template<typename T >
double sirius::r3::vector< T >::length2 ( ) const
inline

Return square length of the vector.

Definition at line 132 of file r3.hpp.

◆ operator+=()

template<typename T >
vector< T > & sirius::r3::vector< T >::operator+= ( vector< T > const &  b)
inline

Definition at line 137 of file r3.hpp.

◆ operator-=()

template<typename T >
vector< T > & sirius::r3::vector< T >::operator-= ( vector< T > const &  b)
inline

Definition at line 145 of file r3.hpp.


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