30 #ifndef MERCURYDPM_SMALLVECTOR_H
31 #define MERCURYDPM_SMALLVECTOR_H
40 template<
unsigned int numberOfRows>
70 logger.assert_debug(
data.size() == numberOfRows,
"provided array has size %, but should have size %",
71 data.size(), numberOfRows);
105 std::placeholders::_1, right));
112 return std::inner_product(right.
data_.begin(), right.
data_.end(),
data_.begin(), 0.0);
118 std::placeholders::_1, right));
126 std::placeholders::_1, right));
132 for (
unsigned int i = 0;
i < numberOfRows; ++
i)
142 for (
unsigned int i = 0;
i < numberOfRows; ++
i)
156 for (
unsigned int i = 0;
i < numberOfRows; ++
i)
185 std::placeholders::_1, right));
191 logger.assert_debug(
n < numberOfRows,
"Requested entry %, but there are only % entries",
n, numberOfRows);
197 logger.assert_debug(
n < numberOfRows,
"Requested entry %, but there are only % entries",
n, numberOfRows);
203 logger.assert_debug(
n < numberOfRows,
"Requested entry %, but there are only % entries",
n, numberOfRows);
209 logger.assert_debug(
n < numberOfRows,
"Requested entry %, but there are only % entries",
n, numberOfRows);
246 return (*
this) /
length();
250 std::array<Mdouble, numberOfRows>
data_;
254 template<
unsigned int numberOfRows>
260 template<
unsigned int numberOfRows>
264 for (std::size_t
i = 0;
i < numberOfRows; ++
i)
AnnoyingScalar sqrt(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:134
int i
Definition: BiCGSTAB_step_by_step.cpp:9
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
double Mdouble
Definition: GeneralDefine.h:13
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
Matrix< SCALARA, Dynamic, Dynamic, opt_A > A
Definition: bench_gemm.cpp:47
std::ostream & operator<<(std::ostream &s, const DenseBase< Derived > &m)
Definition: IO.h:222
Definition: SmallVector.h:42
Mdouble operator*(const SmallVector &right) const
Computes inner product between two vectors.
Definition: SmallVector.h:110
SmallVector< numberOfRows > getNormalised() const
Definition: SmallVector.h:244
Mdouble length() const
Definition: SmallVector.h:233
const Mdouble & operator()(unsigned int n) const
Definition: SmallVector.h:207
bool operator<(const SmallVector &right) const
Definition: SmallVector.h:154
SmallVector & operator*=(const double &right)
Definition: SmallVector.h:182
unsigned int size() const
Definition: SmallVector.h:213
SmallVector(const Mdouble array[])
Definition: SmallVector.h:61
SmallVector operator*(const Mdouble &right) const
Definition: SmallVector.h:101
SmallVector operator/(const Mdouble &right) const
Definition: SmallVector.h:122
SmallVector & operator=(const std::array< Mdouble, numberOfRows > l)
Definition: SmallVector.h:81
Mdouble * data()
Definition: SmallVector.h:223
Mdouble & operator[](unsigned int n)
Definition: SmallVector.h:189
SmallVector(const SmallVector &other)
Definition: SmallVector.h:51
const Mdouble & operator[](unsigned int n) const
Definition: SmallVector.h:195
SmallVector(std::initializer_list< Mdouble > data)
Definition: SmallVector.h:67
SmallVector & operator=(const SmallVector &right)
Definition: SmallVector.h:75
std::array< Mdouble, numberOfRows > data_
Definition: SmallVector.h:250
SmallVector operator-() const
Definition: SmallVector.h:228
void axpy(Mdouble a, const SmallVector &x)
Definition: SmallVector.h:130
SmallVector(SmallVector &&other)
Definition: SmallVector.h:56
SmallVector & operator+=(const SmallVector &right)
Definition: SmallVector.h:170
Mdouble & operator()(unsigned int n)
Definition: SmallVector.h:201
SmallVector operator-(const SmallVector &right) const
Definition: SmallVector.h:94
const Mdouble * data() const
Definition: SmallVector.h:218
SmallVector & operator-=(const SmallVector &right)
Definition: SmallVector.h:176
SmallVector()
Definition: SmallVector.h:46
bool operator==(const SmallVector &right) const
Definition: SmallVector.h:140
SmallVector operator+(const SmallVector &right) const
Definition: SmallVector.h:87
SmallVector & operator/=(const Mdouble &right)
Definition: SmallVector.h:115
EIGEN_DONT_INLINE void transform(const Transformation &t, Data &data)
Definition: geometry.cpp:25
EIGEN_BLAS_FUNC() copy(int *n, RealScalar *px, int *incx, RealScalar *py, int *incy)
Definition: level1_impl.h:32
const Scalar * a
Definition: level2_cplx_impl.h:32
std::array< T, N > array
Definition: EmulateArray.h:231
list x
Definition: plotDoE.py:28