Skip to content
Snippets Groups Projects
Commit 0e3ddd4c authored by Christian Engwer's avatar Christian Engwer
Browse files

[bugfix] "properly" from field_type to int

we have to retrieve an int which is stored in field_type. If the field_type is std::complex, we
have to access the real-component, if it is double/float, we don't have to do anything
special. We use std::real(.) to get the correct real value. This function (with its appropriate
overloads) is available from c++11 on, but this part was already supported by the ancient
g++ version we supprt ;-)
parent ee6e5f6c
No related branches found
No related tags found
No related merge requests found
......@@ -188,7 +188,9 @@ namespace Dune {
coliterator kj = ILU[(*ik).first].find((*ik).first); // diagonal in k
for (++kj; kj!=endk; ++kj) // row k eliminates in row i
{
int generation = (int) firstmatrixelement(*kj);
// we misuse the storage to store an int. If the field_type is std::complex, we have to access the real part
// starting from C++11, we can use std::real to always return a real value, even if it is double/float
int generation = (int) std::real( firstmatrixelement(*kj) );
if (generation<n)
{
mapiterator ij = rowpattern.find(kj.index());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment