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

Lazy semantics for compile/assemble/compute in Tensors #90

Open
fredrikbk opened this issue May 25, 2017 · 0 comments
Open

Lazy semantics for compile/assemble/compute in Tensors #90

fredrikbk opened this issue May 25, 2017 · 0 comments
Labels

Comments

@fredrikbk
Copy link
Contributor

fredrikbk commented May 25, 2017

The current state machine semantics for TensorBase::operator(), TensorBase::compile, TensorBase::compute and TensorBase::assemble can be difficult to get right. They can also cause code to be less clear since you have to build and compile expressions outside the loop where you want to do the computation:

a(i) = B(i,j)*c(j);
a.compile();
a.assemble();
while (!converged(a)) {
  a.compute();
}

We should consider lazy semantics, where you can write:

while (!converged(a)) {
  a(i) = B(i,j)*c(j);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant