forked from kscience/kmath
Override toString and contentEquals
This commit is contained in:
parent
2f2315f6cd
commit
09b82a8910
@ -2,6 +2,7 @@ package scientifik.kmath.ejml
|
|||||||
|
|
||||||
import org.ejml.simple.SimpleMatrix
|
import org.ejml.simple.SimpleMatrix
|
||||||
import scientifik.kmath.linear.Point
|
import scientifik.kmath.linear.Point
|
||||||
|
import scientifik.kmath.structures.Buffer
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents point over EJML [SimpleMatrix].
|
* Represents point over EJML [SimpleMatrix].
|
||||||
@ -27,4 +28,11 @@ class EjmlVector internal constructor(val origin: SimpleMatrix) : Point<Double>
|
|||||||
|
|
||||||
override fun hasNext(): Boolean = cursor < origin.numCols() * origin.numRows()
|
override fun hasNext(): Boolean = cursor < origin.numCols() * origin.numRows()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun contentEquals(other: Buffer<*>): Boolean {
|
||||||
|
if (other is EjmlVector) return origin.isIdentical(other.origin, 0.0)
|
||||||
|
return super.contentEquals(other)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun toString(): String = "EjmlVector(origin=$origin)"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user