Joomla CMS  4.2.2
Documentation des API du CMS Joomla en version 4.2.2
Référence de la classe Barrett
+ Graphe d'héritage de Barrett:

Fonctions membres protégées statiques

static reduce (array $n, array $m, $class)
 
- Fonctions membres protégées statiques hérités de Base
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)
 
- Fonctions membres protégées statiques hérités de PHP
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)
 
- Fonctions membres protégées statiques hérités de Engine
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)
 

Fonctions membres privées statiques

static regularBarrett (array $x, array $n, $class)
 
static multiplyLower (array $x_value, $x_negative, array $y_value, $y_negative, $stop, $class)
 

Membres hérités additionnels

- Fonctions membres publiques hérités de PHP
 __construct ($x=0, $base=10)
 
 toString ()
 
 toBytes ($twos_compliment=false)
 
 abs ()
 
 bitwise_rightShift ($shift)
 
 bitwise_leftShift ($shift)
 
 isOdd ()
 
 testBit ($x)
 
 isNegative ()
 
 negate ()
 
 bitwise_split ($split)
 
- Fonctions membres publiques hérités de Engine
 __construct ($x=0, $base=10)
 
 toHex ($twos_compliment=false)
 
 toBits ($twos_compliment=false)
 
 __sleep ()
 
 __wakeup ()
 
 jsonSerialize ()
 
 __toString ()
 
 __debugInfo ()
 
 setPrecision ($bits)
 
 getPrecision ()
 
 bitwise_not ()
 
 bitwise_leftRotate ($shift)
 
 bitwise_rightRotate ($shift)
 
 getLength ()
 
 getLengthInBytes ()
 
 isPrime ($t=false)
 
 root ($n=2)
 
 createRecurringModuloFunction ()
 
 bitwise_split ($split)
 
- Fonctions membres publiques statiques hérités de Base
static isValidEngine ()
 
- Fonctions membres publiques statiques hérités de PHP
static subtractHelper (array $x_value, $x_negative, array $y_value, $y_negative)
 
static scan1divide (PHP $r)
 
- Fonctions membres publiques statiques hérités de Engine
static setModExpEngine ($engine)
 
static minMaxBits ($bits)
 
- Champs de données hérités de Base
const VARIABLE = 0
 
const DATA = 1
 
- Champs de données hérités de PHP
const VALUE = 0
 
const SIGN = 1
 
const KARATSUBA_CUTOFF = 25
 
const FAST_BITWISE = true
 
const ENGINE_DIR = 'PHP'
 
- Champs de données hérités de Engine
const PRIMES
 
- Fonctions membres protégées hérités de PHP
 initialize ($base)
 
 pad ($str)
 
 divideHelper (PHP $y)
 
 convertToObj (array $arr)
 
 normalize (PHP $result)
 
 lshift ($shift)
 
 rshift ($shift)
 
 powModInner (PHP $e, PHP $n)
 
 make_odd ()
 
 testSmallPrimes ()
 
 powHelper (PHP $n)
 
- Fonctions membres protégées hérités de Engine
 toBytesHelper ()
 
 powModOuter (Engine $e, Engine $n)
 
 setupIsPrime ()
 
 testPrimality ($t)
 
 rootHelper ($n)
 
 rootInner ($n)
 
 extendedGCDHelper (Engine $n)
 
 bitwiseAndHelper (Engine $x)
 
 bitwiseOrHelper (Engine $x)
 
 bitwiseXorHelper (Engine $x)
 
- Attributs protégés hérités de Engine
 $value
 
 $is_negative
 
 $precision = -1
 
 $bitmask = false
 
 $reduce
 
 $hex
 
- Attributs protégés statiques hérités de Engine
static $zero = []
 
static $one = []
 
static $two = []
 
static $modexpEngine
 
static $isValidEngine
 

Documentation des fonctions membres

◆ multiplyLower()

static multiplyLower ( array  $x_value,
  $x_negative,
array  $y_value,
  $y_negative,
  $stop,
  $class 
)
staticprivate

Performs long multiplication up to $stop digits

If you're going to be doing array_slice($product->value, 0, $stop), some cycles can be saved.

Voir également
self::regularBarrett()
Paramètres
array$x_value
bool$x_negative
array$y_value
bool$y_negative
int$stop
string$class
Renvoie
array

Références $i, $temp, et false.

◆ reduce()

static reduce ( array  $n,
array  $m,
  $class 
)
staticprotected

Barrett Modular Reduction

See HAC 14.3.3 / MPM 6.2.5 for more information. Modified slightly, so as not to require negative numbers (initially, this script didn't support negative numbers).

Employs "folding", as described at thesis-149.pdf#page=66. To quote from it, "the idea [behind folding] is to find a value x' such that x (mod m) = x' (mod m), with x' being smaller than x."

Unfortunately, the "Barrett Reduction with Folding" algorithm described in thesis-149.pdf is not, as written, all that usable on account of (1) its not using reasonable radix points as discussed in MPM 6.2.2 and (2) the fact that, even with reasonable radix points, it only works when there are an even number of digits in the denominator. The reason for (2) is that (x >> 1) + (x >> 1) != x / 2 + x / 2. If x is even, they're the same, but if x is odd, they're not. See the in-line comments for details.

Paramètres
array$n
array$m
class-string<PHP>$class
Renvoie
array

Références $class, $key, $n, $result, et $temp.

◆ regularBarrett()

static regularBarrett ( array  $x,
array  $n,
  $class 
)
staticprivate

(Regular) Barrett Modular Reduction

For numbers with more than four digits BigInteger::_barrett() is faster. The difference between that and this is that this function does not fold the denominator into a smaller form.

Paramètres
array$x
array$n
string$class
Renvoie
array

Références $class, $key, $n, $result, et $temp.


La documentation de cette classe a été générée à partir du fichier suivant :