59 m_vector = std::move(v.m_vector);
72 auto newVector = Eigen::VectorXcd(
n);
74 for (
size_t i = 0; i <
m; ++i) {
77 for (
size_t i =
m; i <
n; ++i) {
93 std::stringstream errmsg;
94 errmsg <<
"ComplexVector index = " << i <<
" is out of range = " <<
m_vector.size() <<
" in ComplexVector.set()";
95 throw std::out_of_range(errmsg.str());
104 std::stringstream errmsg;
105 errmsg <<
"ComplexVector index = " << i <<
" is out of range = " <<
m_vector.size() <<
" in ComplexVector.get()";
106 throw std::out_of_range(errmsg.str());
116 throw std::runtime_error(
"ComplexVectors have different sizes.");
126 throw std::runtime_error(
"ComplexVectors have different sizes.");
152 std::ios::fmtflags fflags(ostr.flags());
153 ostr << std::scientific << std::setprecision(6);
154 for (
size_t j = 0; j < v.
size(); ++j) {
156 ostr << std::setw(28) <<
value.real() <<
"+" <<
value.imag() <<
"j";
165 std::vector<ComplexType> temp_data(
size());
166 std::transform(indices.cbegin(), indices.cend(), temp_data.begin(),
double value
The value of the point.
A complex-valued vector for linear algebra computations.
ComplexType get(const size_t i) const
Get an element.
ComplexVector & operator=(const ComplexVector &v)
Copy assignment operator.
void sort(const std::vector< size_t > &indices)
Sort Vector by indicies provided.
ComplexVector & operator*=(const ComplexType d)
Multiply by a number.
ComplexVector & operator-=(const ComplexVector &v)
Subtract a vector.
size_t size() const
Size of the vector.
ComplexVector()
Constructor.
Eigen::VectorXcd & eigen()
Get the pointer to the GSL vector.
ComplexVector move()
Get index of the minimum element.
void set(const size_t i, const ComplexType &value)
Set an element.
Eigen::VectorXcd m_vector
The Eigen vector.
ComplexVector & operator+=(const ComplexVector &v)
Add a vector.
void resize(const size_t n)
Resize the vector.
MANTID_API_DLL std::ostream & operator<<(std::ostream &, const AlgorithmHistory &)
Prints a text representation.
std::complex< double > ComplexType
Eigen::Stride< Eigen::Dynamic, Eigen::Dynamic > dynamic_stride
Eigen::Map< Eigen::VectorXcd, 0, dynamic_stride > complex_vec_map_type