kmath/test-utils/src/commonMain/kotlin/bufferEquality.kt

20 lines
748 B
Kotlin
Raw Normal View History

2022-09-11 15:27:38 +03:00
/*
* Copyright 2018-2022 KMath contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package space.kscience.kmath.testutils
2023-08-12 11:21:59 +03:00
import space.kscience.kmath.structures.Float64Buffer
2022-09-11 15:27:38 +03:00
import kotlin.jvm.JvmName
/**
2023-08-12 11:21:59 +03:00
* Simplified [Float64Buffer] to array comparison
2022-09-11 15:27:38 +03:00
*/
2023-08-12 11:21:59 +03:00
public fun Float64Buffer.contentEquals(vararg doubles: Double): Boolean = array.contentEquals(doubles)
2022-09-11 15:27:38 +03:00
@JvmName("contentEqualsArray")
2023-08-12 11:21:59 +03:00
public infix fun Float64Buffer.contentEquals(otherArray: DoubleArray): Boolean = array.contentEquals(otherArray)
2022-09-11 15:27:38 +03:00
@JvmName("contentEqualsBuffer")
2023-08-12 11:21:59 +03:00
public infix fun Float64Buffer.contentEquals(otherBuffer: Float64Buffer): Boolean = array.contentEquals(otherBuffer.array)