final class StackedArray(val values: Array[NDArray]) extends NDArray {
val ndim: Int = this.getShape.length
val getShape: Array[Int] = {
def func(res: Array[Int] = Array(), x: Array[NDArray]): Array[Int] = {
if (x(0).ndim == 1) res ++ Array(x.length) ++ Array(x(0).values.length)
else func(res ++ Array(x.length), x(0).values)
}
func(this.values)
}
def getArr(i: Int): NDArray = {
if (i >= values.length) NNException("OutOfRange")
else values(i)}
def get(i: Int): Float = {
if (this.ndim == 1) values(i)
else NNException("Not a Vector") //raise NNException
}
def reshape(shape: Int*): NDArray = ???
def reduceLeft[T](f: (Float, Float) => Float): T = ???
def binOp(f: (Float, Float) => Float, that: NDArray): NDArray = ???
def equals(that: NDArray): Boolean = ???
}
object StackedArray extends NDArrayOps[StackedArray] {
def apply(shape: Seq[Int], values: Seq[Float]): StackedArray = ???
def fill(shape: Seq[Int], value: Float): StackedArray = ???
def stack(values: Seq[NDArray]): StackedArray = ???