@@ -0,0 +1,2154 @@
+package algorithms;%0Aimport algorithms.interfaces.IGenerator;%0A%0A@SuppressWarnings(%22ALL%22)%0A%0Apublic class LaggedFibonacciGenerator%7B%0A%0A    /* Definicje wspolczynnikow j, k oraz m */%0A    private static final int j = 22;%0A    private static final int k = 43;%0A    /* Tablica x - rejestr cykliczny oraz jej aktualny wskaznik */%0A    private static long x%5B%5D = new long%5Bk%5D;%0A    private static final long m = ((long) 2 %3C%3C 31); /* 2%5E32 */%0A    /* Definicja wspolczynnika a dla generatora LCG dla zainicjowania tablicy */%0A    private static final long a = 69069;%0A    private static int i;%0A%0A    /* Zainicjuj tablice X - uzyj gneratora LCG o wspolczynnikach:%0Am = 2%5E32, a = 69069, c = 0.%0Adla takiego generatora wszystkie posrednie wyniki mieszcza sie w 49 bitach */%0A    public static void initX(long seed) %7B%0A        x%5B0%5D = seed;%0A        for (int ii = 1; ii %3C k; ii++)%0A            x%5Bii%5D = (a * x%5Bii - 1%5D) %25 m;%0A        i = 0;%0A    %7D%0A%0A    //Calculate a*x mod m%0A    private static long mult(long a, long x, long m) %7B%0A        long b, n, r;%0A%0A        r = 0;%0A        n = 1;%0A        b = 1;%0A        while (n %3C= 64) %7B%0A            if ((a & b) != 0)%0A                r = (r + x) %25 m;%0A            x = (x + x) %25 m;%0A            b *= 2;%0A            n++;%0A        %7D%0A%0A        return r;%0A    %7D%0A%0A    /* Generator ALFG */%0A    public static long genRandALFG() %7B%0A        long result;%0A%0A        x%5Bi%5D = (x%5B(k + i - j) %25 k%5D + x%5Bi%5D) %25 m;%0A        result = x%5Bi%5D;%0A        i = (i + 1) %25 k;%0A%0A        return result;%0A    %7D%0A%0A    /* Generator MLFG */%0A    public static long genRandMLFG() %7B%0A        long result;%0A%0A        x%5Bi%5D = mult(x%5B(k + i - j) %25 k%5D, x%5Bi%5D, m);%0A        result = x%5Bi%5D;%0A        i = (i + 1) %25 k;%0A%0A        return result;%0A    %7D%0A%0A    /* Generator TGFSR */%0A    public static long genRandTGFSR() %7B%0A        long result;%0A%0A        x%5Bi%5D = (x%5B(k + i - j) %25 k%5D %5E x%5Bi%5D) %25 m;%0A        result = x%5Bi%5D;%0A        i = (i + 1) %25 k;%0A%0A        return result;%0A    %7D%0A%0A/*%0ASystem.out.println(%221-ALFG - Addytywny Opozniony Generator Fibonacciego%22);%0ASystem.out.println(%222-MLFG - Multiplikatywny Opozniony Generator Fibonacciego%22);%0ASystem.out.println(%223-TGFSR - Dwupunktowy uogolniony rejestr przesuwny ze sprzezeniem zwrotnym%22);%0A*/%0A%7D%0A

Create LaggedFibonacciGenerator.java