JVM zeroes out new arrays by default, so you can just do 

    val weightPerLabel = new Array[Double](C)