function GenericGF(primitive /*int*/, size /*int*/, generatorBase /*int*/) {
        var _this = _super.call(this) || this;
        _this.primitive = primitive;
        _this.size = size;
        _this.generatorBase = generatorBase;
        var expTable = new Int32Array(size);
        var x = 1;
        for (var i = 0; i < size; i++) {
            expTable[i] = x;
            x *= 2; // we're assuming the generator alpha is 2
            if (x >= size) {
                x ^= primitive;
                x &= size - 1;
            }
        }
        _this.expTable = expTable;
        var logTable = new Int32Array(size);
        for (var i = 0; i < size - 1; i++) {
            logTable[expTable[i]] = i;
        }
        _this.logTable = logTable;
        // logTable[0] == 0 but this should never be used
        _this.zero = new GenericGFPoly(_this, Int32Array.from([0]));
        _this.one = new GenericGFPoly(_this, Int32Array.from([1]));
        return _this;
    }
/**
     * Create a representation of GF(size) using the given primitive polynomial.
     *
     * @param primitive irreducible polynomial whose coefficients are represented by
     *  the bits of an int, where the least-significant bit represents the constant
     *  coefficient
     * @param size the size of the field
     * @param b the factor b in the generator polynomial can be 0- or 1-based
     *  (g(x) = (x+a^b)(x+a^(b+1))...(x+a^(b+2t-1))).
     *  In most cases it should be 1, but for QR code it is 0.
     */
Create a representation of GF(size) using the given primitive polynomial.
Create a representation of GF ( size ) using the given primitive polynomial .
function GenericGF(primitive , size , generatorBase ) {
        var _this = _super.call(this) || this;
        _this.primitive = primitive;
        _this.size = size;
        _this.generatorBase = generatorBase;
        var expTable = new Int32Array(size);
        var x = 1;
        for (var i = 0; i < size; i++) {
            expTable[i] = x;
            x *= 2; 
            if (x >= size) {
                x ^= primitive;
                x &= size - 1;
            }
        }
        _this.expTable = expTable;
        var logTable = new Int32Array(size);
        for (var i = 0; i < size - 1; i++) {
            logTable[expTable[i]] = i;
        }
        _this.logTable = logTable;
        _this.zero = new GenericGFPoly(_this, Int32Array.from([0]));
        _this.one = new GenericGFPoly(_this, Int32Array.from([1]));
        return _this;
    }
function GenericGF ( primitive , size , generatorBase ) { var _this = _super . call ( this ) || this ; _this . primitive = primitive ; _this . size = size ; _this . generatorBase = generatorBase ; var expTable = new Int32Array ( size ) ; var x = 1 ; for ( var i = 0 ; i < size ; i ++ ) { expTable [ i ] = x ; x *= 2 ; if ( x >= size ) { x ^= primitive ; x &= size - 1 ; } } _this . expTable = expTable ; var logTable = new Int32Array ( size ) ; for ( var i = 0 ; i < size - 1 ; i ++ ) { logTable [ expTable [ i ] ] = i ; } _this . logTable = logTable ; _this . zero = new GenericGFPoly ( _this , Int32Array . from ( [ 0 ] ) ) ; _this . one = new GenericGFPoly ( _this , Int32Array . from ( [ 1 ] ) ) ; return _this ; }
Create a representation of GF(size) using the given primitive polynomial.
Create a representation of GF ( size ) using the given primitive polynomial .
/*int*/ /*int*/ /*int*/ // we're assuming the generator alpha is 2 // logTable[0] == 0 but this should never be used