protected static void updateRaw(final float[] raw, final InstantaneousOutput state, final float integrationTime) throws StructuralException {
if (state instanceof RealOutput) {
float[] values = ((RealOutput) state).getValues();
if (values.length != raw.length) {
throw new StructuralException("State is length "
+ values.length + "; should be " + raw.length);
}
for (int i = 0; i < values.length; i++) {
raw[i] = values[i];
}
} else if (state instanceof SpikeOutput) {
boolean[] values = ((SpikeOutput) state).getValues();
if (values.length != raw.length) {
throw new StructuralException("State is length "
+ values.length + "; should be " + raw.length);
}
for (int i = 0; i < values.length; i++) {
raw[i] = values[i] ? integrationTime : 0.0f;
}