Skip to content
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

how to implement matrix addition calculation #244

Open
hoseaaaa opened this issue Nov 3, 2022 · 2 comments
Open

how to implement matrix addition calculation #244

hoseaaaa opened this issue Nov 3, 2022 · 2 comments

Comments

@hoseaaaa
Copy link

hoseaaaa commented Nov 3, 2022

Hi Professor, I have a simple question
When I use amgcl to solve the problem, I have used mpi to read the two matrices A and B. How to realize the addition calculation of these two matrices?
auto A = std::make_shared<amgcl::mpi::distributed_matrix<DBackend>>( world, std::tie(chunk, ptr_A, col_A, val_A)); auto B = std::make_shared<amgcl::mpi::distributed_matrix<DBackend>>( world, std::tie(chunk, ptr_B, col_B, val_B));

@ddemidov
Copy link
Owner

ddemidov commented Nov 4, 2022

Summing of distributed matrices is outside of the library scope. There is an internal implementation that takes matrices as amgcl::backend::csr, so you could copy your local chunks into csr, add them, and use the result to construct the distributed matrix.

@hoseaaaa
Copy link
Author

hoseaaaa commented Nov 5, 2022

Thanks for your help.i will try it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants