PARTONS/NumA++
|
Numerical Analysis C++ routines
|
Vector of complex numbers of undefined size. More...
Public Member Functions | |
VectorComplexD () | |
Default constructor. More... | |
VectorComplexD (const unsigned int n) | |
Assignment constructor. More... | |
VectorComplexD (const VectorComplexD &v) | |
Copy constructor. More... | |
virtual | ~VectorComplexD () |
Destructor. More... | |
double | Mag () const |
Get magnitude of vector. More... | |
VectorComplexD | Conjunct () const |
Get conjunction of vector. More... | |
std::complex< double > | Dot (const VectorComplexD &v) const |
Scalar product of this and other vector. More... | |
void | Clear () |
Clear vector (set std::complex<double>(0., 0.) to all elements). More... | |
void | operator= (const VectorComplexD &rhs) |
Operator =. More... | |
VectorComplexD | operator+ (const VectorComplexD &rhs) |
Operator +. More... | |
VectorComplexD | operator- (const VectorComplexD &rhs) |
Operator -. More... | |
VectorComplexD | operator* (const double &rhs) |
Operator * by real number (rhs). More... | |
VectorComplexD | operator* (const std::complex< double > &rhs) |
Operator * by complex number (rhs). More... | |
unsigned int | GetNElements () const |
Get number of elements. More... | |
void | SetElement (const unsigned int i, const std::complex< double > &value) |
Set element. More... | |
std::complex< double > | GetElement (unsigned int i) const |
Get element. More... | |
Private Member Functions | |
void | CompareNElements (const VectorComplexD &v) const |
Compare number of elements of this and other vector. More... | |
Private Attributes | |
unsigned int | m_n |
Number of elements. More... | |
std::vector< std::complex< double > > | m_elements |
Elements. More... | |
Friends | |
VectorComplexD | operator* (const double &lhs, VectorComplexD &rhs) |
Operator * by real number (lhs). More... | |
VectorComplexD | operator* (const std::complex< double > &lhs, VectorComplexD &rhs) |
Operator * by complex number (lhs). More... | |
Vector of complex numbers of undefined size.
This class represents a vector of complex double precision numbers. The size of this vector should be defined by the user.
NumA::VectorComplexD::VectorComplexD | ( | ) |
Default constructor.
NumA::VectorComplexD::VectorComplexD | ( | const unsigned int | n | ) |
Assignment constructor.
Elements will be initialized with std::complex<double>(0., 0.).
n | Number of elements to be set. |
NumA::VectorComplexD::VectorComplexD | ( | const VectorComplexD & | v | ) |
Copy constructor.
v | Object to be copied. |
|
virtual |
Destructor.
void NumA::VectorComplexD::Clear | ( | ) |
Clear vector (set std::complex<double>(0., 0.)
to all elements).
|
private |
Compare number of elements of this and other vector.
Throw std::runtime_error
if the numbers are not equal.
v | Other vector. |
VectorComplexD NumA::VectorComplexD::Conjunct | ( | ) | const |
Get conjunction of vector.
Return: \(f^{*}\).
std::complex< double > NumA::VectorComplexD::Dot | ( | const VectorComplexD & | v | ) | const |
Scalar product of this and other vector.
Return: \(f \cdot g\).
v | Other vector. |
std::complex< double > NumA::VectorComplexD::GetElement | ( | unsigned int | i | ) | const |
Get element.
i | Index of element to be retrieved. |
unsigned int NumA::VectorComplexD::GetNElements | ( | ) | const |
Get number of elements.
double NumA::VectorComplexD::Mag | ( | ) | const |
Get magnitude of vector.
Return: \(\sqrt{f \cdot f^{*}}\).
VectorComplexD NumA::VectorComplexD::operator* | ( | const double & | rhs | ) |
Operator * by real number (rhs).
VectorComplexD NumA::VectorComplexD::operator* | ( | const std::complex< double > & | rhs | ) |
Operator * by complex number (rhs).
VectorComplexD NumA::VectorComplexD::operator+ | ( | const VectorComplexD & | rhs | ) |
Operator +.
VectorComplexD NumA::VectorComplexD::operator- | ( | const VectorComplexD & | rhs | ) |
Operator -.
void NumA::VectorComplexD::operator= | ( | const VectorComplexD & | rhs | ) |
Operator =.
void NumA::VectorComplexD::SetElement | ( | const unsigned int | i, |
const std::complex< double > & | value | ||
) |
Set element.
i | Index of element to be set. |
value | Value to be set. |
|
friend |
Operator * by real number (lhs).
|
friend |
Operator * by complex number (lhs).
|
private |
Elements.
|
private |
Number of elements.