SINTEF / Splipy

Spline modelling made easy.
GNU General Public License v3.0
100 stars 18 forks source link

Speed up the calculation of norms #142

Closed UnaiSan closed 3 years ago

UnaiSan commented 3 years ago

As it is shown here, there is an improvement in the calculation of norms if instead of

np.apply_along_axis(np.linalg.norm, -1, array)

we write

np.linalg.norm(array, axis=-1)

I have seen this in the following functions/methods: Curve.binormal, Curve.curvature, Curve.torsion, SplineObject.tangent, Surface.normal.

Could this be addressed in a future release?

VikingScientist commented 3 years ago

This is a great suggestion. I was not aware of this discrepancy. Thank you for bringing this to our attention.

VikingScientist commented 3 years ago

Fixed #144