jeffheaton / encog-java-core

http://www.heatonresearch.com/encog
Other
742 stars 268 forks source link

Missing check in Equilateral.encode() #100

Closed PetrToman closed 12 years ago

PetrToman commented 12 years ago

If Equilateral.encode(final int set) is called with set = negative number, an exception is thrown. There should be a check:

   if (set < 0 || set>this.matrix.length)
      throw new EncogError("Class out of range for equilateral: " + set);

Note: In C# code, this statement is missing completely, which may cause IndexOutOfRangeException.

jeffheaton commented 12 years ago

Corrected in both 3.1 and 3.2.

jeffheaton commented 12 years ago

Ported to C#.