forked from kscience/kmath
ColumnarData returns nullable column
This commit is contained in:
parent
6eb95f26eb
commit
fff7377687
@ -29,6 +29,7 @@
|
|||||||
- Separated benchmarks and examples
|
- Separated benchmarks and examples
|
||||||
- Rewritten EJML module without ejml-simple
|
- Rewritten EJML module without ejml-simple
|
||||||
- Stability of kmath-ast and kmath-kotilngrad promoted to EXPERIMENTAL.
|
- Stability of kmath-ast and kmath-kotilngrad promoted to EXPERIMENTAL.
|
||||||
|
- ColumnarData returns nullable column
|
||||||
|
|
||||||
### Deprecated
|
### Deprecated
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ import space.kscience.kmath.structures.Buffer
|
|||||||
public interface ColumnarData<out T> {
|
public interface ColumnarData<out T> {
|
||||||
public val size: Int
|
public val size: Int
|
||||||
|
|
||||||
public operator fun get(symbol: Symbol): Buffer<T>
|
public operator fun get(symbol: Symbol): Buffer<T>?
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -27,10 +27,10 @@ public interface XYColumnarData<T, out X : T, out Y : T> : ColumnarData<T> {
|
|||||||
*/
|
*/
|
||||||
public val y: Buffer<Y>
|
public val y: Buffer<Y>
|
||||||
|
|
||||||
override fun get(symbol: Symbol): Buffer<T> = when (symbol) {
|
override fun get(symbol: Symbol): Buffer<T>? = when (symbol) {
|
||||||
Symbol.x -> x
|
Symbol.x -> x
|
||||||
Symbol.y -> y
|
Symbol.y -> y
|
||||||
else -> error("A column for symbol $symbol not found")
|
else -> null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,10 +17,10 @@ import space.kscience.kmath.structures.Buffer
|
|||||||
public interface XYZColumnarData<T, out X : T, out Y : T, out Z : T> : XYColumnarData<T, X, Y> {
|
public interface XYZColumnarData<T, out X : T, out Y : T, out Z : T> : XYColumnarData<T, X, Y> {
|
||||||
public val z: Buffer<Z>
|
public val z: Buffer<Z>
|
||||||
|
|
||||||
override fun get(symbol: Symbol): Buffer<T> = when (symbol) {
|
override fun get(symbol: Symbol): Buffer<T>? = when (symbol) {
|
||||||
Symbol.x -> x
|
Symbol.x -> x
|
||||||
Symbol.y -> y
|
Symbol.y -> y
|
||||||
Symbol.z -> z
|
Symbol.z -> z
|
||||||
else -> error("A column for symbol $symbol not found")
|
else -> null
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user