Encog.ML.Data.Specific.BiPolarMLData.SetBoolean C# (CSharp) Method

SetBoolean() public method

Set the value as a boolean.
public SetBoolean ( int index, bool b ) : void
index int The index.
b bool The boolean value.
return void
        public void SetBoolean(int index, bool b)
        {
            _data[index] = b;
        }

Usage Example

Example #1
0
        /// <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;
        }
All Usage Examples Of Encog.ML.Data.Specific.BiPolarMLData::SetBoolean