OGS
EigenMatrix.cpp
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2
// SPDX-License-Identifier: BSD-3-Clause
3
4
#include "
EigenMatrix.h
"
5
6
#include <fstream>
7
8
namespace
MathLib
9
{
10
12
void
EigenMatrix::write
(
const
std::string& filename)
const
13
{
14
std::ofstream of(filename);
15
if
(of)
16
{
17
write
(of);
18
}
19
}
20
22
void
EigenMatrix::write
(std::ostream& os)
const
23
{
24
for
(
int
k = 0; k <
mat_
.outerSize(); ++k)
25
{
26
for
(RawMatrixType::InnerIterator it(
mat_
, k); it; ++it)
27
{
28
os << it.row() <<
" "
<< it.col() <<
" "
<< it.value() <<
"\n"
;
29
}
30
}
31
os << std::endl;
32
}
33
}
// namespace MathLib
EigenMatrix.h
MathLib::EigenMatrix::write
void write(const std::string &filename) const
printout this matrix for debugging
Definition
EigenMatrix.cpp:12
MathLib::EigenMatrix::mat_
RawMatrixType mat_
Definition
EigenMatrix.h:142
MathLib
Definition
CreateComponent.h:23
MathLib
LinAlg
Eigen
EigenMatrix.cpp
Generated by
1.14.0