v0.3.0-dev-9 #324
@ -1,6 +1,5 @@
|
|||||||
package space.kscience.kmath.tensors.core
|
package space.kscience.kmath.tensors.core
|
||||||
|
|
||||||
import space.kscience.kmath.misc.UnstableKMathAPI
|
|
||||||
import space.kscience.kmath.nd.as1D
|
import space.kscience.kmath.nd.as1D
|
||||||
import space.kscience.kmath.samplers.GaussianSampler
|
import space.kscience.kmath.samplers.GaussianSampler
|
||||||
import space.kscience.kmath.stat.RandomGenerator
|
import space.kscience.kmath.stat.RandomGenerator
|
||||||
@ -72,7 +71,7 @@ internal inline fun format(value: Double, digits: Int = 4): String {
|
|||||||
val lead = value / ten.pow(order)
|
val lead = value / ten.pow(order)
|
||||||
val leadDisplay = round(lead*ten.pow(digits)) / ten.pow(digits)
|
val leadDisplay = round(lead*ten.pow(digits)) / ten.pow(digits)
|
||||||
val orderDisplay = if(order == 0) "" else if(order > 0) "E+$order" else "E$order"
|
val orderDisplay = if(order == 0) "" else if(order > 0) "E+$order" else "E$order"
|
||||||
val valueDisplay = "${leadDisplay}$orderDisplay"
|
val valueDisplay = "$leadDisplay$orderDisplay"
|
||||||
val res = if(value < 0.0) valueDisplay else " $valueDisplay"
|
val res = if(value < 0.0) valueDisplay else " $valueDisplay"
|
||||||
val fLength = digits + 6
|
val fLength = digits + 6
|
||||||
val endSpace = " ".repeat(fLength - res.length)
|
val endSpace = " ".repeat(fLength - res.length)
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
package space.kscience.kmath.tensors.core
|
package space.kscience.kmath.tensors.core
|
||||||
|
|
||||||
|
import kotlinx.coroutines.InternalCoroutinesApi
|
||||||
import space.kscience.kmath.nd.as1D
|
import space.kscience.kmath.nd.as1D
|
||||||
import space.kscience.kmath.nd.as2D
|
import space.kscience.kmath.nd.as2D
|
||||||
import space.kscience.kmath.structures.toDoubleArray
|
import space.kscience.kmath.structures.toDoubleArray
|
||||||
|
import kotlin.test.Ignore
|
||||||
import kotlin.test.Test
|
import kotlin.test.Test
|
||||||
import kotlin.test.assertEquals
|
import kotlin.test.assertEquals
|
||||||
import kotlin.test.assertTrue
|
import kotlin.test.assertTrue
|
||||||
@ -47,7 +49,7 @@ class TestDoubleTensor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test @Ignore
|
||||||
fun toStringTest() = DoubleTensorAlgebra {
|
fun toStringTest() = DoubleTensorAlgebra {
|
||||||
val tensor = randNormal(intArrayOf(2,3))
|
val tensor = randNormal(intArrayOf(2,3))
|
||||||
println(tensor)
|
println(tensor)
|
||||||
|
Loading…
Reference in New Issue
Block a user