|
static | reduce (array $n, array $m, $class) |
|
static | generateCustomReduction (PHP $m, $class) |
|
static | powModHelper (PHP $x, PHP $e, PHP $n, $class) |
|
static | prepareReduce (array $x, array $n, $class) |
|
static | multiplyReduce (array $x, array $y, array $n, $class) |
|
static | squareReduce (array $x, array $n, $class) |
|
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) |
|
|
static | generateInlineTrim ($name) |
|
static | generateInlineMultiply ($input, array $arr, $output, $class) |
|
static | generateInlineAdd ($x, $y, $result, $class) |
|
static | generateInlineSubtract2 ($known, $unknown, $result, $class) |
|
static | generateInlineSubtract1 ($unknown, array $known, $result, $class) |
|
static | generateInlineCompare (array $known, $unknown, $subcode) |
|
static | float2string ($num) |
|
◆ float2string()
static float2string |
( |
|
$num | ) |
|
|
staticprivate |
Convert a float to a string
If you do echo floatval(pow(2, 52)) you'll get 4.6116860184274E+18. It /can/ be displayed without a loss of precision but displayed in this way there will be precision loss, hence the need for this method.
- Paramètres
-
- Renvoie
- string
Références $temp, et PHP\abs().
◆ generateCustomReduction()
static generateCustomReduction |
( |
PHP |
$m, |
|
|
|
$class |
|
) |
| |
|
staticprotected |
Generate Custom Reduction
- Paramètres
-
- Renvoie
- callable
Références $class.
◆ generateInlineAdd()
static generateInlineAdd |
( |
|
$x, |
|
|
|
$y, |
|
|
|
$result, |
|
|
|
$class |
|
) |
| |
|
staticprivate |
Inline Addition
- Paramètres
-
string | $x | |
string | $y | |
string | $result | |
string | $class | |
- Renvoie
- string
Références $result.
◆ generateInlineCompare()
static generateInlineCompare |
( |
array |
$known, |
|
|
|
$unknown, |
|
|
|
$subcode |
|
) |
| |
|
staticprivate |
Inline Comparison
If $unknown >= $known then loop
- Paramètres
-
array | $known | |
string | $unknown | |
string | $subcode | |
- Renvoie
- string
Références $i.
◆ generateInlineMultiply()
static generateInlineMultiply |
( |
|
$input, |
|
|
array |
$arr, |
|
|
|
$output, |
|
|
|
$class |
|
) |
| |
|
staticprivate |
Inline Multiply (unknown, known)
- Paramètres
-
string | $input | |
array | $arr | |
string | $output | |
string | $class | |
- Renvoie
- string
Références $i, $input, et $output.
◆ generateInlineSubtract1()
static generateInlineSubtract1 |
( |
|
$unknown, |
|
|
array |
$known, |
|
|
|
$result, |
|
|
|
$class |
|
) |
| |
|
staticprivate |
Inline Subtraction 1
For when $unknown is more digits than $known. This is the easier use case to optimize for.
- Paramètres
-
string | $unknown | |
array | $known | |
string | $result | |
string | $class | |
- Renvoie
- string
Références $i, et $result.
◆ generateInlineSubtract2()
static generateInlineSubtract2 |
( |
|
$known, |
|
|
|
$unknown, |
|
|
|
$result, |
|
|
|
$class |
|
) |
| |
|
staticprivate |
Inline Subtraction 2
For when $known is more digits than $unknown. This is the harder use case to optimize for.
- Paramètres
-
string | $known | |
string | $unknown | |
string | $result | |
string | $class | |
- Renvoie
- string
Références $result.
◆ generateInlineTrim()
static generateInlineTrim |
( |
|
$name | ) |
|
|
staticprivate |
Inline Trim
Removes leading zeros
- Paramètres
-
- Renvoie
- string
Références $name.
◆ reduce()
static reduce |
( |
array |
$n, |
|
|
array |
$m, |
|
|
|
$class |
|
) |
| |
|
staticprotected |
Barrett Modular Reduction
This calls a dynamically generated loop unrolled function that's specific to a given modulo. Array lookups are avoided as are if statements testing for how many bits the host OS supports, etc.
- Paramètres
-
array | $n | |
array | $m | |
string | $class | |
- Renvoie
- array
Références $n.
◆ $custom_reduction
Custom Reduction Function
- Voir également
- self::generateCustomReduction
La documentation de cette classe a été générée à partir du fichier suivant :