-
Notifications
You must be signed in to change notification settings - Fork 110
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 deal with multiple right hand sides. #242
Comments
Hey, You should be able to use amgcl::make_iterator_range as in for(int i = 0; i < nv; ++i) {
auto b = make_iterator_range(&rhss[i*n], &rhss[i*(n+1)]);
auto x = make_iterator_range(&xs[i*n], &xs[i*(n+1)]);
solve(b, x);
} |
Thanks for your help. |
Sorry to bother you again, I was trying to do something like operator
I have tried converting it to |
The following works for me: #include <amgcl/backend/builtin.hpp>
int main() {
std::vector<double> x(10, 1), y(10, 2);
auto X = amgcl::make_iterator_range(x.begin(), x.end());
auto Y = amgcl::make_iterator_range(y.begin(), y.end());
// y = x
amgcl::backend::copy(X, Y);
std::cout << "1. y = " << y[0] << std::endl;
// y = y - x
amgcl::backend::axpby(-1, X, 1, Y);
std::cout << "2. y = " << y[0] << std::endl;
}
|
I will try that. Thanks for your time and patience. |
I don't know if I can implement this for several backends, such as Eigen backend or cuda. |
|
Really thanks for your comment. |
Hi Professor, I have a basic question.
If I have vectors
rhss
andxs
as arguments to solver operator()
as(rhss,xs)
, which are multiple right hand sides (continusly stored) and solutions, I want to handlerhss
andxs
inside the header file by changing the operator()
.Can I declare a vector reference to part of
rhss
orxs
without additional memory storage? or something alternative?How can i implement this in a elegant way for several backends?
With best regards.
The text was updated successfully, but these errors were encountered: