alex cole
01/17/2021, 2:59 AMclass ArrayND { // the class that I want to type
var elements: Array<Double> // the array that all my functions refer too.
var shape: Array<Int>
constructor (ndArray: Array<Double>, shape: Array<Int>) {
elements = ndArray
this.shape = shape
}
operator fun plus(other: ArrayND): ArrayND {}
operator fun plus(other: Double): ArrayND {}
}
I have a lot of functions that use array lists and convert them .toTypedArray()
to create ArrayND()
. This also has caused a problem when trying to be able to type the array and I would like to know if there is a way that if no type is given I could give it a default type of Double
?nanodeath
01/17/2021, 4:24 PMalex cole
01/18/2021, 12:37 AM