private fun toDoubleAray(intArray: Array<Int>, skipIndex: HashSet<Int>): DoubleArray? { val res = DoubleArray(intArray.size - skipIndex.size()) var skip = 0 for (i in intArray.indices) { if (skipIndex.contains(i)) { skip++ continue } res[i - skip] = intArray[i].toDouble() } return res }
Converts an array into array of doubles skipping specified indeces .