public static ArrayList<PolyBase> getFieldElems(Integer st) { ArrayList<PolyBase> res = new ArrayList<>(); for (int i = 0; i < Math.pow(2, st); i++) { PolyBase t = new PolyBase(Integer.toBinaryString(i)); t.number = i; t.getBigger(); res.add(t); } return res; }
public static ArrayList<Integer> errorFlow(int n) { ArrayList<Integer> result = new ArrayList<>(); for (int i = 0; i < fl; i++) { int co = 0; for (int j = 0; j < elems.size(); j++) { PolyBase el = sum(elems.get(j), getEi(i)); el.getBigger(); co += (getf(n, j) + getf(n, elems.indexOf(el))) % 2; } result.add(co); } System.out.println("ErrorFlow counted"); return result; }
public static ArrayList<PolyBase> getFuncRes(ArrayList<PolyBase> elts, String fc) { ArrayList<PolyBase> result = new ArrayList<>(); int o = 0; int all = (int) Math.pow(2, fl); if (fc.equals("rev")) { for (PolyBase i : elts) { System.out.println("Element " + i + " started"); i.getBigger(); PolyBase t = revElem(i, fl); t.getBigger(); result.add(t); System.out.println("Element " + t + " added"); o++; System.out.println((all - o) + " elements to go"); } } if (fc.equals("sec")) { for (PolyBase i : elts) { i.getBigger(); PolyBase t = new PolyBase(i.toString()); t = gornerMeth2(t, (int) Math.pow(2, fl) - 3, fl); t.getBigger(); result.add(t); } } if (fc.equals("15")) { for (PolyBase i : elts) { i.getBigger(); PolyBase t = new PolyBase(i.toString()); t = gornerMeth2(t, 131, fl); t.getBigger(); result.add(t); } } return result; }