/// <summary>
/// Note: for Hopfield networks, you will usually want to call the "run"
/// method to compute the output.
/// This method can be used to copy the input data to the current state. A
/// single iteration is then run, and the new current state is returned.
/// </summary>
///
/// <param name="input">The input pattern.</param>
/// <returns>The new current state.</returns>
public override sealed IMLData Compute(IMLData input)
{
var result = new BiPolarMLData(input.Count);
EngineArray.ArrayCopy(input.Data, CurrentState.Data);
Run();
for (int i = 0; i < CurrentState.Count; i++)
{
result.SetBoolean(i,
BiPolarUtil.Double2bipolar(CurrentState[i]));
}
EngineArray.ArrayCopy(CurrentState.Data, result.Data);
return result;
}