FEniCS/basix

Move ifs out of loops in polyset.cpp

Closed this issue · 3 comments

In many loops in polyset.cpp, there are if statements that are only true for the first entry in the for loop. These can be moved out of the loops.

This was done for intervals, quads, and hexes in #393, but still needs doing for:

Any chance we could also add some documentation explaining what's going on in polyset?
For instance, what operations are being computed?

The heavy use of xtensor hides the fact that some operations within the innermost loops are also "matrix" operations (with the greatest dimension equal to X.shape(0) ) with non-zero strides, see for example:
https://github.com/FEniCS/basix/blob/main/cpp/basix/polyset.cpp#L325

So it's a little difficult to reverse-engineer the operations to simplify the code.

Any chance we could also add some documentation explaining what's going on in polyset? For instance, what operations are being computed?

The heavy use of xtensor hides the fact that some operations within the innermost loops are also "matrix" operations (with the greatest dimension equal to X.shape(0) ) with non-zero strides, see for example: https://github.com/FEniCS/basix/blob/main/cpp/basix/polyset.cpp#L325

So it's a little difficult to reverse-engineer the operations to simplify the code.

See #424

This is no longer desired