8000 Generate initial guess and rhs instead of reading them by fritzgoebel · Pull Request #550 · ginkgo-project/ginkgo · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Generate initial guess and rhs instead of reading them #550

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions examples/ir-ilu-preconditioned-solver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,3 @@ add_executable(ir-ilu-preconditioned-solver ir-ilu-preconditioned-solver.cpp)
target_link_libraries(ir-ilu-preconditioned-solver ginkgo)
target_include_directories(ir-ilu-preconditioned-solver PRIVATE ${PROJECT_SOURCE_DIR})
configure_file(data/A.mtx data/A.mtx COPYONLY)
configure_file(data/b.mtx 10000 data/b.mtx COPYONLY)
configure_file(data/x0.mtx data/x0.mtx COPYONLY)
21 changes: 0 additions & 21 deletions examples/ir-ilu-preconditioned-solver/data/b.mtx

This file was deleted.

21 changes: 0 additions & 21 deletions examples/ir-ilu-preconditioned-solver/data/x0.mtx

This file was deleted.

4 changes: 2 additions & 2 deletions examples/ir-ilu-preconditioned-solver/doc/results.dox
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ Solution (x):
0.0121141
0.0123025
GMRES iteration count: 7
GMRES execution time [ms]: 5.49966
GMRES execution time [ms]: 2.64993
Residual norm sqrt(r^T r):
%%MatrixMarket matrix array real general
1 1
7.83607e-13
2.23805e-10

@endcode

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,16 @@ int main(int argc, char *argv[])

// Read data
auto A = gko::share(gko::read<mtx>(std::ifstream("data/A.mtx"), exec));
auto b = gko::read<vec>(std::ifstream("data/b.mtx"), exec);
auto x = gko::read<vec>(std::ifstream("data/x0.mtx"), exec);
// Create RHS and initial guess as 1
gko::size_type num_rows = A->get_size()[0];
auto host_x = vec::create(exec->get_master(), gko::dim<2>(num_rows, 1));
for (gko::size_type i = 0; i < num_rows; i++) {
host_x->at(i, 0) = 1.;
}
auto x = vec::create(exec);
auto b = vec::create(exec);
x->copy_from(host_x.get());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use x = zeros before but ones now. Is it correct?
if it changes the result, you also need to change the result.dox.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ones is the choice we took for the EuroPar paper, so it is correct now. I need to change the result.dox, thanks!

b->copy_from(host_x.get());
auto clone_x = vec::create(exec);
clone_x->copy_from(lend(x));

Expand Down
0