-
Notifications
You must be signed in to change notification settings - Fork 49
Open
Description
batch_normalize currently documents this caveat:
This function will panic if
p.len() != q.len().
However, with const generics you can construct an output array that matches the input size with compile-time assurances:
fn batch_normalize_array<const N: usize>(points: &[Self, N]) -> [Self::AffineRepr; N] { ... }This issue is to suggest an addition, rather than a replacement, specifically for use cases where the number of points is fixed at compile-time.
Note that this approach is also useful for stack allocating all intermediate values (since you can size the arrays by N), allowing for efficient implementations on heapless targets.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels