diff --git a/kmath-tensors/src/commonMain/kotlin/space/kscience/kmath/tensors/api/StatisticTensorAlgebra.kt b/kmath-tensors/src/commonMain/kotlin/space/kscience/kmath/tensors/api/StatisticTensorAlgebra.kt index e3a2a1124..d0b17af97 100644 --- a/kmath-tensors/src/commonMain/kotlin/space/kscience/kmath/tensors/api/StatisticTensorAlgebra.kt +++ b/kmath-tensors/src/commonMain/kotlin/space/kscience/kmath/tensors/api/StatisticTensorAlgebra.kt @@ -9,16 +9,12 @@ import space.kscience.kmath.tensors.core.DoubleTensor /** * Common algebra with statistics methods. Operates on [Tensor]. - * - * @param T the type of items closed under division in the tensors. */ public interface StatisticTensorAlgebra: TensorAlgebra { /** * Returns the minimum value of all elements in the input tensor. - * - * @return the minimum value of all elements in the input tensor. */ public fun Tensor.min(): Double @@ -37,8 +33,6 @@ public interface StatisticTensorAlgebra: TensorAlgebra { /** * Returns the maximum value of all elements in the input tensor. - * - * @return the maximum value of all elements in the input tensor. */ public fun Tensor.max(): Double @@ -57,8 +51,6 @@ public interface StatisticTensorAlgebra: TensorAlgebra { /** * Returns the sum of all elements in the input tensor. - * - * @return the sum of all elements in the input tensor. */ public fun Tensor.sum(): Double @@ -77,8 +69,6 @@ public interface StatisticTensorAlgebra: TensorAlgebra { /** * Returns the mean of all elements in the input tensor. - * - * @return the mean of all elements in the input tensor. */ public fun Tensor.mean(): Double @@ -97,8 +87,6 @@ public interface StatisticTensorAlgebra: TensorAlgebra { /** * Returns the standard deviation of all elements in the input tensor. - * - * @return the standard deviation of all elements in the input tensor. */ public fun Tensor.std(): Double @@ -117,8 +105,6 @@ public interface StatisticTensorAlgebra: TensorAlgebra { /** * Returns the variance of all elements in the input tensor. - * - * @return the variance of all elements in the input tensor. */ public fun Tensor.variance(): Double @@ -134,4 +120,5 @@ public interface StatisticTensorAlgebra: TensorAlgebra { * @return the variance of each row of the input tensor in the given dimension [dim]. */ public fun Tensor.variance(dim: Int, keepDim: Boolean): DoubleTensor -} \ No newline at end of file + +} diff --git a/kmath-tensors/src/commonMain/kotlin/space/kscience/kmath/tensors/core/algebras/DoubleStatisticTensorAlgebra.kt b/kmath-tensors/src/commonMain/kotlin/space/kscience/kmath/tensors/core/algebras/DoubleStatisticTensorAlgebra.kt index 3914a0dfb..b455aff48 100644 --- a/kmath-tensors/src/commonMain/kotlin/space/kscience/kmath/tensors/core/algebras/DoubleStatisticTensorAlgebra.kt +++ b/kmath-tensors/src/commonMain/kotlin/space/kscience/kmath/tensors/core/algebras/DoubleStatisticTensorAlgebra.kt @@ -17,9 +17,8 @@ import space.kscience.kmath.tensors.core.algebras.DoubleStatisticTensorAlgebra.v public object DoubleStatisticTensorAlgebra : StatisticTensorAlgebra, DoubleTensorAlgebra() { - private fun Tensor.fold(foldFunction: (DoubleArray) -> Double): Double { - return foldFunction(this.tensor.toDoubleArray()) - } + private fun Tensor.fold(foldFunction: (DoubleArray) -> Double): Double = + foldFunction(this.tensor.toDoubleArray()) private fun Tensor.foldDim( foldFunction: (DoubleArray) -> Double, @@ -102,4 +101,4 @@ public object DoubleStatisticTensorAlgebra : StatisticTensorAlgebra, Dou keepDim ) -} \ No newline at end of file +}