Optimize reverse division for FP INDArrayAlgebra

This commit is contained in:
Iaroslav 2020-06-29 03:49:29 +07:00
parent 8a8b314d0a
commit 23b2ba9950
No known key found for this signature in database
GPG Key ID: 46E15E4A31B3BCD7

View File

@ -57,6 +57,7 @@ interface INDArrayRing<T, R, N> :
interface INDArrayField<T, F, N> : NDField<T, F, N>, interface INDArrayField<T, F, N> : NDField<T, F, N>,
INDArrayRing<T, F, N> where F : Field<T>, N : INDArrayStructure<T>, N : MutableNDStructure<T> { INDArrayRing<T, F, N> where F : Field<T>, N : INDArrayStructure<T>, N : MutableNDStructure<T> {
override fun divide(a: N, b: N): N = a.ndArray.divi(b.ndArray).wrap() override fun divide(a: N, b: N): N = a.ndArray.divi(b.ndArray).wrap()
override fun Number.div(b: N): N = b.ndArray.rdivi(this).wrap()
} }
class RealINDArrayField(override val shape: IntArray, override val elementContext: Field<Double> = RealField) : class RealINDArrayField(override val shape: IntArray, override val elementContext: Field<Double> = RealField) :