51 #ifndef MERCURYDPM_NUMERICALVECTOR_H_
52 #define MERCURYDPM_NUMERICALVECTOR_H_
62 template<
typename T = M
double>
120 logger.assert_debug(
data_.size() == right.data_.size(),
"Vectors don't have the same size");
121 for (std::size_t
i = 0;
i <
data_.size();
i++)
122 result.data_[
i] += right.data_[
i];
129 logger.assert_debug(
data_.size() == right.data_.size(),
"Vectors don't have the same size");
130 for (std::size_t
i = 0;
i <
data_.size();
i++)
131 result.data_[
i] -= right.data_[
i];
138 for (T& d : result.data_)
146 logger.assert_debug(
data_.size() == right.
data_.size(),
"Vectors don't have equal length.");
148 for (std::size_t
i = 0;
i <
data_.size();
i++)
164 return (result /= right);
170 logger.assert_debug(
data_.size() == right.data_.size(),
"Vectors don't have the same size");
171 for (std::size_t
i = 0;
i <
data_.size();
i++)
179 logger.assert_debug(
data_.size() == right.data_.size(),
"Vectors don't have the same size");
180 for (std::size_t
i = 0;
i <
data_.size();
i++)
194 logger.assert_debug(
n <
data_.size(),
"Requested entry %, but there are only % entries",
n,
data_.size());
200 logger.assert_debug(
n <
data_.size(),
"Requested entry %, but there are only % entries",
n,
data_.size());
206 logger.assert_debug(
n <
data_.size(),
"Requested entry %, but there are only % entries",
n,
data_.size());
212 logger.assert_debug(
n <
data_.size(),
"Requested entry %, but there are only % entries",
n,
data_.size());
237 template<
typename T = M
double>
240 template<
typename T = M
double>
243 template<
typename T = M
double>
const unsigned n
Definition: CG3DPackingUnitTest.cpp:32
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
NumericalVector< T > operator-(const NumericalVector< T > &right)
NumericalVector< T > operator*(const T &left, const NumericalVector< T > &right)
std::ostream & operator<<(std::ostream &os, const NumericalVector< T > &A)
@ A
Definition: StatisticsVector.h:42
This is a vector of doubles.
Definition: NumericalVector.h:64
NumericalVector< T > & operator/=(const T &right)
Definition: NumericalVector.h:153
NumericalVector< T > & operator=(const NumericalVector< T > &right)
Definition: NumericalVector.h:105
NumericalVector< T > & operator=(const std::initializer_list< T > l)
Definition: NumericalVector.h:111
void resize(std::size_t size)
Definition: NumericalVector.h:97
const T & operator()(std::size_t n) const
Definition: NumericalVector.h:210
T & operator()(std::size_t n)
Definition: NumericalVector.h:204
T operator*(const NumericalVector &right) const
Definition: NumericalVector.h:144
NumericalVector< T > & operator-=(const NumericalVector< T > &right)
Definition: NumericalVector.h:177
NumericalVector< T > operator-(const NumericalVector< T > &right) const
Definition: NumericalVector.h:126
std::size_t size() const
Definition: NumericalVector.h:216
T * data()
Definition: NumericalVector.h:226
NumericalVector< T > & operator+=(const NumericalVector< T > &right)
Definition: NumericalVector.h:168
NumericalVector< T > operator/(const T &right) const
Definition: NumericalVector.h:161
const T * data() const
Definition: NumericalVector.h:221
std::vector< T > data_
Definition: NumericalVector.h:232
NumericalVector< T > operator+(const NumericalVector< T > &right) const
Definition: NumericalVector.h:117
T & operator[](std::size_t n)
Definition: NumericalVector.h:192
NumericalVector< T > operator*(const T &right) const
Definition: NumericalVector.h:135
const T & operator[](std::size_t n) const
Definition: NumericalVector.h:198
NumericalVector< T > & operator*=(const T &right)
Definition: NumericalVector.h:185
const std::complex< Mdouble > i
Definition: ExtendedMath.h:51