Mantid
|
A complex-valued vector for linear algebra computations. More...
#include <EigenComplexVector.h>
Public Member Functions | |
ComplexVector () | |
Constructor. More... | |
ComplexVector (ComplexVector &&v) | |
Move constructor. More... | |
ComplexVector (const ComplexVector &v) | |
Copy constructor. More... | |
ComplexVector (const Eigen::VectorXcd v) | |
Copy from a gsl vector. More... | |
ComplexVector (const size_t n) | |
Constructor. More... | |
Eigen::VectorXcd & | eigen () |
Get the pointer to the GSL vector. More... | |
const Eigen::VectorXcd | eigen () const |
Get the pointer to the GSL vector. More... | |
ComplexType | get (const size_t i) const |
Get an element. More... | |
ComplexVector & | operator*= (const ComplexType d) |
Multiply by a number. More... | |
ComplexVector & | operator+= (const ComplexType &d) |
Add a complex number. More... | |
ComplexVector & | operator+= (const ComplexVector &v) |
Add a vector. More... | |
ComplexVector & | operator-= (const ComplexVector &v) |
Subtract a vector. More... | |
ComplexVector & | operator= (ComplexVector &&v) noexcept |
Move assignment operator. More... | |
ComplexVector & | operator= (const ComplexVector &v) |
Copy assignment operator. More... | |
ComplexVector & | operator= (const Eigen::VectorXcd &v) |
Copy assignment operator. More... | |
const ComplexType | operator[] (const size_t i) const |
Get a "const reference" to an element. More... | |
ComplexType & | operator[] (size_t i) |
Get a "reference" to an element. More... | |
void | resize (const size_t n) |
Resize the vector. More... | |
void | set (const size_t i, const ComplexType &value) |
Set an element. More... | |
size_t | size () const |
Size of the vector. More... | |
void | sort (const std::vector< size_t > &indices) |
Sort Vector by indicies provided. More... | |
void | zero () |
Protected Member Functions | |
ComplexVector | move () |
Get index of the minimum element. More... | |
Private Member Functions | |
ComplexVector (Eigen::VectorXcd &&gslVector) | |
Constructor. More... | |
Private Attributes | |
Eigen::VectorXcd | m_vector |
The Eigen vector. More... | |
A complex-valued vector for linear algebra computations.
Definition at line 28 of file EigenComplexVector.h.
Mantid::CurveFitting::ComplexVector::ComplexVector | ( | ) |
Constructor.
Definition at line 20 of file EigenComplexVector.cpp.
References zero().
Referenced by move().
|
explicit |
Constructor.
n | :: The length of the vector. |
Definition at line 24 of file EigenComplexVector.cpp.
|
explicit |
Copy from a gsl vector.
Copy from an Eigen::Vector.
v | :: A vector to copy from. |
Definition at line 36 of file EigenComplexVector.cpp.
Mantid::CurveFitting::ComplexVector::ComplexVector | ( | const ComplexVector & | v | ) |
Copy constructor.
v | :: The other vector |
Definition at line 28 of file EigenComplexVector.cpp.
Mantid::CurveFitting::ComplexVector::ComplexVector | ( | ComplexVector && | v | ) |
Move constructor.
v | :: The other vector |
Definition at line 32 of file EigenComplexVector.cpp.
|
private |
Constructor.
Move from an Eigen::Vector.
v | :: A vector to move. |
Definition at line 40 of file EigenComplexVector.cpp.
Eigen::VectorXcd & Mantid::CurveFitting::ComplexVector::eigen | ( | ) |
Get the pointer to the GSL vector.
Get the reference to the Eigen vector.
Definition at line 64 of file EigenComplexVector.cpp.
References m_vector.
Referenced by operator+=(), and operator-=().
const Eigen::VectorXcd Mantid::CurveFitting::ComplexVector::eigen | ( | ) | const |
Get the pointer to the GSL vector.
Get a const copy of the Eigen vector.
Definition at line 67 of file EigenComplexVector.cpp.
References m_vector.
ComplexType Mantid::CurveFitting::ComplexVector::get | ( | const size_t | i | ) | const |
Get an element.
get an element
i | :: The element index |
Definition at line 100 of file EigenComplexVector.cpp.
References m_vector, and size().
Referenced by Mantid::CurveFitting::operator<<().
|
protected |
Get index of the minimum element.
Create a new ComplexVector and move all data to it.
Create a new ComplexVector and move all data to it. Destroys this vector.
Destroys this vector.
Definition at line 148 of file EigenComplexVector.cpp.
References ComplexVector(), and m_vector.
ComplexVector & Mantid::CurveFitting::ComplexVector::operator*= | ( | const ComplexType | d | ) |
Multiply by a number.
d | :: The number |
Definition at line 134 of file EigenComplexVector.cpp.
References Mantid::Geometry::d, and m_vector.
ComplexVector & Mantid::CurveFitting::ComplexVector::operator+= | ( | const ComplexType & | d | ) |
Add a complex number.
d | :: The complex number |
Definition at line 141 of file EigenComplexVector.cpp.
References Mantid::Geometry::d, and m_vector.
ComplexVector & Mantid::CurveFitting::ComplexVector::operator+= | ( | const ComplexVector & | v | ) |
Add a vector.
v | :: The other vector |
Definition at line 114 of file EigenComplexVector.cpp.
ComplexVector & Mantid::CurveFitting::ComplexVector::operator-= | ( | const ComplexVector & | v | ) |
Subtract a vector.
v | :: The other vector |
Definition at line 124 of file EigenComplexVector.cpp.
|
noexcept |
Move assignment operator.
v | :: The other vector |
Definition at line 58 of file EigenComplexVector.cpp.
ComplexVector & Mantid::CurveFitting::ComplexVector::operator= | ( | const ComplexVector & | v | ) |
Copy assignment operator.
v | :: The other vector |
Definition at line 44 of file EigenComplexVector.cpp.
References m_vector.
ComplexVector & Mantid::CurveFitting::ComplexVector::operator= | ( | const Eigen::VectorXcd & | v | ) |
Copy assignment operator.
v | :: The other Eigen::vector |
Definition at line 51 of file EigenComplexVector.cpp.
References m_vector.
|
inline |
Get a "const reference" to an element.
Definition at line 64 of file EigenComplexVector.h.
|
inline |
Get a "reference" to an element.
Definition at line 66 of file EigenComplexVector.h.
void Mantid::CurveFitting::ComplexVector::resize | ( | const size_t | n | ) |
Resize the vector.
n | :: The new length |
Definition at line 71 of file EigenComplexVector.cpp.
References Mantid::Geometry::m, m_vector, n, and size().
Referenced by sort().
void Mantid::CurveFitting::ComplexVector::set | ( | const size_t | i, |
const ComplexType & | value | ||
) |
Set an element.
set an element
i | :: The element index |
value | :: The new value |
Definition at line 89 of file EigenComplexVector.cpp.
size_t Mantid::CurveFitting::ComplexVector::size | ( | ) | const |
Size of the vector.
Definition at line 84 of file EigenComplexVector.cpp.
References m_vector.
Referenced by get(), operator+=(), operator-=(), Mantid::CurveFitting::operator<<(), resize(), set(), and sort().
void Mantid::CurveFitting::ComplexVector::sort | ( | const std::vector< size_t > & | indices | ) |
Sort Vector by indicies provided.
Sort this vector in order defined by an index array.
indices | :: Indices defining the order of elements in sorted vector. |
Definition at line 164 of file EigenComplexVector.cpp.
void Mantid::CurveFitting::ComplexVector::zero | ( | ) |
Definition at line 110 of file EigenComplexVector.cpp.
References m_vector.
Referenced by ComplexVector().
|
private |
The Eigen vector.
Definition at line 88 of file EigenComplexVector.h.
Referenced by eigen(), get(), move(), operator*=(), operator+=(), operator-=(), operator=(), resize(), set(), size(), sort(), and zero().