import org.encog.neural.networks.XOR;
public class TestExcel extends TestCase {
public void testXLSX() {
final ArrayDataCODEC codec = new ArrayDataCODEC(XOR.XOR_INPUT,
XOR.XOR_IDEAL);
final BinaryDataLoader loader = new BinaryDataLoader(codec);
loader.external2Binary(new File("encog.bin"));
final ExcelCODEC codec2 = new ExcelCODEC(new File("encog.xlsx"));
final BinaryDataLoader loader2 = new BinaryDataLoader(codec2);
loader2.binary2External(new File("encog.bin"));
final ExcelCODEC codec3 = new ExcelCODEC(new File("encog.xlsx"), 2, 1);
final BinaryDataLoader loader3 = new BinaryDataLoader(codec3);
loader3.external2Binary(new File("encog.bin"));
final ArrayDataCODEC codec4 = new ArrayDataCODEC();
final BinaryDataLoader loader4 = new BinaryDataLoader(codec4);
loader4.binary2External(new File("encog.bin"));
final double[][] input = codec4.getInput();
final double[][] ideal = codec4.getIdeal();
for (int i = 0; i < XOR.XOR_INPUT.length; i++) {
for (int j = 0; j < XOR.XOR_INPUT[i].length; j++) {
Assert.assertEquals(input[i][j], XOR.XOR_INPUT[i][j], 0.01);
}