|
static | addHelper (array $x_value, $x_negative, array $y_value, $y_negative) |
|
static | multiplyHelper (array $x_value, $x_negative, array $y_value, $y_negative) |
|
static | regularMultiply (array $x_value, array $y_value) |
|
static | compareHelper (array $x_value, $x_negative, array $y_value, $y_negative) |
|
static | trim (array $value) |
|
static | array_repeat ($input, $multiplier) |
|
static | square (array $x) |
|
static | baseSquare (array $value) |
|
static | karatsubaSquare (array $value) |
|
static | setBitmask ($bits) |
|
static | base256_lshift (&$x, $shift) |
|
static | slidingWindow (Engine $x, Engine $e, Engine $n, $class) |
|
static | randomRangePrimeOuter (Engine $min, Engine $max) |
|
static | randomRangeHelper (Engine $min, Engine $max) |
|
static | randomRangePrimeInner (Engine $x, Engine $min, Engine $max) |
|
static | minHelper (array $nums) |
|
static | maxHelper (array $nums) |
|
◆ __construct()
__construct |
( |
|
$x = 0 , |
|
|
|
$base = 10 |
|
) |
| |
◆ abs()
◆ addHelper()
static addHelper |
( |
array |
$x_value, |
|
|
|
$x_negative, |
|
|
array |
$y_value, |
|
|
|
$y_negative |
|
) |
| |
|
staticprotected |
◆ array_repeat()
static array_repeat |
( |
|
$input, |
|
|
|
$multiplier |
|
) |
| |
|
staticprotected |
Array Repeat
- Paramètres
-
- Renvoie
- array
Références $input.
◆ baseSquare()
static baseSquare |
( |
array |
$value | ) |
|
|
staticprotected |
Performs traditional squaring on two BigIntegers
Squaring can be done faster than multiplying a number by itself can be. See HAC 14.2.4 / MPM 5.3 for more information.
- Paramètres
-
- Renvoie
- array
Références $i, $temp, et Engine\$value.
◆ bitwise_leftShift()
bitwise_leftShift |
( |
|
$shift | ) |
|
◆ bitwise_rightShift()
bitwise_rightShift |
( |
|
$shift | ) |
|
◆ bitwise_small_split()
bitwise_small_split |
( |
|
$split | ) |
|
|
private |
◆ bitwise_split()
◆ compareHelper()
static compareHelper |
( |
array |
$x_value, |
|
|
|
$x_negative, |
|
|
array |
$y_value, |
|
|
|
$y_negative |
|
) |
| |
|
staticprotected |
◆ convertToObj()
convertToObj |
( |
array |
$arr | ) |
|
|
protected |
◆ divide_digit()
static divide_digit |
( |
array |
$dividend, |
|
|
|
$divisor |
|
) |
| |
|
staticprivate |
◆ divideHelper()
Divides two BigIntegers.
Returns an array whose first element contains the quotient and whose second element contains the "common residue". If the remainder would be positive, the "common residue" and the remainder are the same. If the remainder would be negative, the "common residue" is equal to the sum of the remainder and the divisor (basically, the "common residue" is the first positive modulo).
- Renvoie
- array{static, static}
Références $i, $r, $temp, $this, class, PHP\divide_digit(), PHP\normalize(), et value.
Référencé par PHP32\divide(), et PHP64\divide().
◆ initialize()
◆ int2bytes()
Converts 32-bit integers to bytes.
- Paramètres
-
- Renvoie
- string
Référencé par PHP\initialize().
◆ isNegative()
◆ isOdd()
Is Odd?
- Renvoie
- bool
Références value.
◆ karatsuba()
static karatsuba |
( |
array |
$x_value, |
|
|
array |
$y_value |
|
) |
| |
|
staticprivate |
◆ karatsubaSquare()
static karatsubaSquare |
( |
array |
$value | ) |
|
|
staticprotected |
◆ lshift()
◆ make_odd()
Make the current number odd
If the current number is odd it'll be unchanged. If it's even, one will be added to it.
- Voir également
- self::randomPrime()
Références value.
◆ multiplyHelper()
static multiplyHelper |
( |
array |
$x_value, |
|
|
|
$x_negative, |
|
|
array |
$y_value, |
|
|
|
$y_negative |
|
) |
| |
|
staticprotected |
Performs multiplication.
- Paramètres
-
array | $x_value | |
bool | $x_negative | |
array | $y_value | |
bool | $y_negative | |
- Renvoie
- array
Références false, et BigInteger\min().
◆ negate()
Negate
Given $k, returns -$k
- Renvoie
- static
Références $temp, et $this.
◆ normalize()
◆ pad()
Pads strings so that unpack may be used on them
- Paramètres
-
- Renvoie
- string
◆ powHelper()
◆ powModInner()
powModInner |
( |
PHP |
$e, |
|
|
PHP |
$n |
|
) |
| |
|
protected |
◆ regularMultiply()
static regularMultiply |
( |
array |
$x_value, |
|
|
array |
$y_value |
|
) |
| |
|
staticprotected |
Performs long multiplication on two BigIntegers
Modeled after 'multiply' in MutableBigInteger.java.
- Paramètres
-
array | $x_value | |
array | $y_value | |
- Renvoie
- array
Références $i, et $temp.
◆ rshift()
◆ scan1divide()
static scan1divide |
( |
PHP |
$r | ) |
|
|
static |
Scan for 1 and right shift by that amount
ie. $s = gmp_scan1($n, 0) and $r = gmp_div_q($n, gmp_pow(gmp_init('2'), $s));
- Paramètres
-
- Renvoie
- int
- Voir également
- self::isPrime()
Références $i, $r, et $temp.
◆ square()
static square |
( |
array |
$x | ) |
|
|
staticprotected |
Performs squaring
- Paramètres
-
- Renvoie
- list<static>
◆ subtractHelper()
static subtractHelper |
( |
array |
$x_value, |
|
|
|
$x_negative, |
|
|
array |
$y_value, |
|
|
|
$y_negative |
|
) |
| |
|
static |
Performs subtraction.
- Paramètres
-
array | $x_value | |
bool | $x_negative | |
array | $y_value | |
bool | $y_negative | |
- Renvoie
- array
Références $i, $temp, elseif, et false.
◆ testBit()
Tests if a bit is set
- Renvoie
- bool
Références value.
◆ testSmallPrimes()
Test the number against small primes.
- Voir également
- self::isPrime()
Références $r, Engine\$value, et value.
◆ toBytes()
toBytes |
( |
|
$twos_compliment = false | ) |
|
◆ toString()
◆ trim()
static trim |
( |
array |
$value | ) |
|
|
staticprotected |
Trim
Removes leading zeros
- Paramètres
-
- Renvoie
- list<static>
Références $i, et Engine\$value.
◆ ENGINE_DIR
Engine Directory
- Voir également
- parent::setModExpEngine protected
◆ FAST_BITWISE
const FAST_BITWISE = true |
Can Bitwise operations be done fast?
- Voir également
- parent::bitwise_leftRotate()
-
parent::bitwise_rightRotate() protected
◆ KARATSUBA_CUTOFF
const KARATSUBA_CUTOFF = 25 |
#- Karatsuba Cutoff
At what point do we switch between Karatsuba multiplication and schoolbook long multiplication?
private
◆ SIGN
$result[self::SIGN] contains the sign.
◆ VALUE
#+ Array constants
Rather than create a thousands and thousands of new BigInteger objects in repeated function calls to add() and multiply() or whatever, we'll just work directly on arrays, taking them in as parameters and returning them.
protected $result[self::VALUE] contains the value.
La documentation de cette classe a été générée à partir du fichier suivant :