@Override
public void decodeFromArray(final double[] encoded) {
this.structure.requireFlat();
final double[] weights = this.structure.getFlat().getWeights();
if (weights.length != encoded.length) {
throw new NeuralNetworkError(
"Size mismatch, encoded array should be of length "
+ weights.length);
}
EngineArray.arrayCopy(encoded, weights);