NumPower / numpower

PHP extension for efficient scientific computing and array manipulation with GPU support
https://numpower.org
Other
185 stars 4 forks source link

N-dimensional slicing and element-wise iterator #40

Closed henrique-borba closed 11 months ago

henrique-borba commented 11 months ago

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

fix: stable N-dimensional slicing The slicing mechanism was broken for some N-dimensional matrices, this update uses a ported variation of the NumPy source code to correctly select slice indices and strides. This update also makes all returns from the slicing views instead os copies, avoiding copies in RAM memory and increasing performance.

feat: New element-wise strided iterator. An element-wise iterator was implemented in the C backend to centralize and facilitate element-wise operations that must consider strides to return a correct result. This iterator is a derivative work of the iterator used by NumPy.