Mojo function
prefix_product
prefix_product(a: IntTuple[origin]) -> IntTuple
Compute the exclusive prefix product of an IntTuple
.
This is a convenience wrapper that initializes the prefix product with 1.
Args:
- a (
IntTuple[origin]
): The inputIntTuple
to compute the prefix product for.
Returns:
A new IntTuple
containing the exclusive prefix product of the input.
prefix_product(a: IntTuple[origin], init: IntTuple[origin] = IntTuple(1)) -> IntTuple
Compute the exclusive prefix product of an IntTuple
with an initial value.
This function delegates to the implementation in prefix_product2.
Args:
- a (
IntTuple[origin]
): The inputIntTuple
to compute the prefix product for. - init (
IntTuple[origin]
): The initial value(s) for the prefix product, defaults to 1.
Returns:
A new IntTuple
containing the exclusive prefix product of the input.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!