OGS
EigenVector.cpp
Go to the documentation of this file.
1
11#include "EigenVector.h"
12
13#include "EigenMapTools.h"
14
15#ifndef NDEBUG
16#include <fstream>
17#endif
18
19namespace MathLib
20{
21void EigenVector::copyValues(std::vector<double>& u) const
22{
23 u.resize(size());
24 toVector(u) = vec_;
25}
26
27#ifndef NDEBUG
28void EigenVector::write(const std::string& filename) const
29{
30 std::ofstream os(filename);
31 os << vec_;
32}
33#endif
34
35} // namespace MathLib
void copyValues(std::vector< double > &u) const
RawVectorType vec_
IndexType size() const
return a vector length
Definition EigenVector.h:42
void set(IndexType rowId, double v)
set entry
Definition EigenVector.h:73
void write(const std::string &filename) const
write this vector to a file for debugging
Eigen::Map< const Vector > toVector(std::vector< double > const &data, Eigen::VectorXd::Index size)
Creates an Eigen mapped vector from the given data vector.
static const double u