Not getting same result as The inverse-iteration program example #1861
-
Hello, I am currently trying to run the inverse-iteration example and am having toruble getting the posted result. My source code is pasted at the bottom of this discussion. After compiling:
`This is Ginkgo 1.10.0 (develop) '{ "system_residual": +1.59471978e-14, "eigenvalue": (-3.03897455e+00,-4.55595319e+00), "residual": (-2.49101122e+00,+3.73446053e+00) }, Here is the Matrix I ran the code with, directly from the examples directory within ginkgo. which is different from the values from the example in which it converges to ~19. Source code: ` #include <ginkgo/ginkgo.hpp> int main(int argc, char* argv[])
}` |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hello again, While trying to find an solution I realised I was on Gingko 1.10.0, so, I downloaded the latest version of Ginkgo (1.9.0). after
I ran
While in the exampels/inverse-iteration directory and got the same result as printed before.
|
Beta Was this translation helpful? Give feedback.
-
Hello, I have found the problem in the code. from the example code I have replaced
with
Which then gives the expected output
So, something might be wrong with compute_dot()? or how it was being used? I am not entirely sure. |
Beta Was this translation helpful? Give feedback.
Hello,
I have found the problem in the code.
from the example code I have replaced
x->compute_dot(tmp, g); auto g_val = clone(this_exec, g) ->get_values() [0];
with
precision g_val{0.0}; for (gko::size_type j = 0; j < x->get_size()[0]; ++j) { g_val += std::conj(x->get_values()[j]) * tmp->get_values()[j]; }
Which then gives the expected output
This is Ginkgo 1.10.0 (develop) running with core module 1.10.0 (develop) the reference module is 1.10.0 (develop) the OpenMP module is 1.10.0 (develop) the CUDA module is 1.10.0 (develop) the HIP module is not compiled the DPCPP module is not compiled
{ "system_residual": +1.59471978e-14, "eigenvalue": (+2.03741410e+01,+3.52582546e-16), "residual":…