Mantid
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
Mantid::CurveFitting::ComplexVector Class Reference

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...
 
ComplexVectoroperator*= (const ComplexType d)
 Multiply by a number. More...
 
ComplexVectoroperator+= (const ComplexType &d)
 Add a complex number. More...
 
ComplexVectoroperator+= (const ComplexVector &v)
 Add a vector. More...
 
ComplexVectoroperator-= (const ComplexVector &v)
 Subtract a vector. More...
 
ComplexVectoroperator= (ComplexVector &&v) noexcept
 Move assignment operator. More...
 
ComplexVectoroperator= (const ComplexVector &v)
 Copy assignment operator. More...
 
ComplexVectoroperator= (const Eigen::VectorXcd &v)
 Copy assignment operator. More...
 
const ComplexType operator[] (const size_t i) const
 Get a "const reference" to an element. More...
 
ComplexTypeoperator[] (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...
 

Detailed Description

A complex-valued vector for linear algebra computations.

Definition at line 28 of file EigenComplexVector.h.

Constructor & Destructor Documentation

◆ ComplexVector() [1/6]

Mantid::CurveFitting::ComplexVector::ComplexVector ( )

Constructor.

Definition at line 20 of file EigenComplexVector.cpp.

References zero().

Referenced by move().

◆ ComplexVector() [2/6]

Mantid::CurveFitting::ComplexVector::ComplexVector ( const size_t  n)
explicit

Constructor.

Parameters
n:: The length of the vector.

Definition at line 24 of file EigenComplexVector.cpp.

◆ ComplexVector() [3/6]

Mantid::CurveFitting::ComplexVector::ComplexVector ( const Eigen::VectorXcd  v)
explicit

Copy from a gsl vector.

Copy from an Eigen::Vector.

Parameters
v:: A vector to copy from.

Definition at line 36 of file EigenComplexVector.cpp.

◆ ComplexVector() [4/6]

Mantid::CurveFitting::ComplexVector::ComplexVector ( const ComplexVector v)

Copy constructor.

Parameters
v:: The other vector

Definition at line 28 of file EigenComplexVector.cpp.

◆ ComplexVector() [5/6]

Mantid::CurveFitting::ComplexVector::ComplexVector ( ComplexVector &&  v)

Move constructor.

Parameters
v:: The other vector

Definition at line 32 of file EigenComplexVector.cpp.

◆ ComplexVector() [6/6]

Mantid::CurveFitting::ComplexVector::ComplexVector ( Eigen::VectorXcd &&  v)
private

Constructor.

Move from an Eigen::Vector.

Parameters
v:: A vector to move.

Definition at line 40 of file EigenComplexVector.cpp.

Member Function Documentation

◆ eigen() [1/2]

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-=().

◆ eigen() [2/2]

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.

◆ get()

ComplexType Mantid::CurveFitting::ComplexVector::get ( const size_t  i) const

Get an element.

get an element

Parameters
i:: The element index

Definition at line 100 of file EigenComplexVector.cpp.

References m_vector, and size().

Referenced by Mantid::CurveFitting::operator<<().

◆ move()

ComplexVector Mantid::CurveFitting::ComplexVector::move ( )
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.

◆ operator*=()

ComplexVector & Mantid::CurveFitting::ComplexVector::operator*= ( const ComplexType  d)

Multiply by a number.

Parameters
d:: The number

Definition at line 134 of file EigenComplexVector.cpp.

References Mantid::Geometry::d, and m_vector.

◆ operator+=() [1/2]

ComplexVector & Mantid::CurveFitting::ComplexVector::operator+= ( const ComplexType d)

Add a complex number.

Parameters
d:: The complex number

Definition at line 141 of file EigenComplexVector.cpp.

References Mantid::Geometry::d, and m_vector.

◆ operator+=() [2/2]

ComplexVector & Mantid::CurveFitting::ComplexVector::operator+= ( const ComplexVector v)

Add a vector.

Parameters
v:: The other vector

Definition at line 114 of file EigenComplexVector.cpp.

References eigen(), m_vector, and size().

◆ operator-=()

ComplexVector & Mantid::CurveFitting::ComplexVector::operator-= ( const ComplexVector v)

Subtract a vector.

Parameters
v:: The other vector

Definition at line 124 of file EigenComplexVector.cpp.

References eigen(), m_vector, and size().

◆ operator=() [1/3]

ComplexVector & Mantid::CurveFitting::ComplexVector::operator= ( ComplexVector &&  v)
noexcept

Move assignment operator.

Parameters
v:: The other vector

Definition at line 58 of file EigenComplexVector.cpp.

◆ operator=() [2/3]

ComplexVector & Mantid::CurveFitting::ComplexVector::operator= ( const ComplexVector v)

Copy assignment operator.

Parameters
v:: The other vector

Definition at line 44 of file EigenComplexVector.cpp.

References m_vector.

◆ operator=() [3/3]

ComplexVector & Mantid::CurveFitting::ComplexVector::operator= ( const Eigen::VectorXcd &  v)

Copy assignment operator.

Parameters
v:: The other Eigen::vector

Definition at line 51 of file EigenComplexVector.cpp.

References m_vector.

◆ operator[]() [1/2]

const ComplexType Mantid::CurveFitting::ComplexVector::operator[] ( const size_t  i) const
inline

Get a "const reference" to an element.

Definition at line 64 of file EigenComplexVector.h.

◆ operator[]() [2/2]

ComplexType & Mantid::CurveFitting::ComplexVector::operator[] ( size_t  i)
inline

Get a "reference" to an element.

Definition at line 66 of file EigenComplexVector.h.

◆ resize()

void Mantid::CurveFitting::ComplexVector::resize ( const size_t  n)

Resize the vector.

Parameters
n:: The new length

Definition at line 71 of file EigenComplexVector.cpp.

References Mantid::Geometry::m, m_vector, n, and size().

Referenced by sort().

◆ set()

void Mantid::CurveFitting::ComplexVector::set ( const size_t  i,
const ComplexType value 
)

Set an element.

set an element

Parameters
i:: The element index
value:: The new value

Definition at line 89 of file EigenComplexVector.cpp.

References m_vector, size(), and value.

◆ size()

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().

◆ 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.

Parameters
indices:: Indices defining the order of elements in sorted vector.

Definition at line 164 of file EigenComplexVector.cpp.

References m_vector, resize(), and size().

◆ zero()

void Mantid::CurveFitting::ComplexVector::zero ( )

Definition at line 110 of file EigenComplexVector.cpp.

References m_vector.

Referenced by ComplexVector().

Member Data Documentation

◆ m_vector

Eigen::VectorXcd Mantid::CurveFitting::ComplexVector::m_vector
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().


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