Cardinality
Read onlyYes
FinalYes
Constants
- DEFAULT_RELATIVE_ERROR : float = 0.5
Properties
- $atMost : null|int<0, max>
- $estimate : null|int<0, max>
- $relativeError : float
Methods
- __construct() : mixed
- approximately() : self
- atMost() : self
- confident() : null|int<0, max>
- The estimate when it is known to at least $maxRelativeError, null when it is not.
- exact() : self
- exactly() : null|int<0, max>
- The count when it is guaranteed and known exactly, null otherwise.
- isUnknown() : bool
- merge() : self
- normalize() : array{at_most: null|int<0, max>, estimate: null|int<0, max>, relative_error: null|float}
- relative_error is null when it is not a finite number.
- unknown() : self
Constants
DEFAULT_RELATIVE_ERROR
public
float
DEFAULT_RELATIVE_ERROR
= 0.5
Properties
$atMost
public
null|int<0, max>
$atMost
$estimate
public
null|int<0, max>
$estimate
$relativeError
public
float
$relativeError
Methods
__construct()
public
__construct([null|int $atMost = null ][, null|int $estimate = null ][, float $relativeError = self::DEFAULT_RELATIVE_ERROR ]) : mixed
Parameters
- $atMost : null|int = null
-
a GUARANTEED upper bound; null when nothing is guaranteed
- $estimate : null|int = null
-
a best guess that may be wrong in either direction
- $relativeError : float = self::DEFAULT_RELATIVE_ERROR
-
rough 1-sigma relative error of $estimate; meaningless without one
approximately()
public
static approximately(int $rows[, float $relativeError = self::DEFAULT_RELATIVE_ERROR ]) : self
Parameters
- $rows : int
- $relativeError : float = self::DEFAULT_RELATIVE_ERROR
Return values
selfatMost()
public
static atMost(int $rows) : self
Parameters
- $rows : int
Return values
selfconfident()
The estimate when it is known to at least $maxRelativeError, null when it is not.
public
confident(float $maxRelativeError) : null|int<0, max>
A caller that needs a guarantee reads $atMost instead.
Parameters
- $maxRelativeError : float
Return values
null|int<0, max>exact()
public
static exact(int $rows) : self
Parameters
- $rows : int
Return values
selfexactly()
The count when it is guaranteed and known exactly, null otherwise.
public
exactly() : null|int<0, max>
Return values
null|int<0, max>isUnknown()
public
isUnknown() : bool
Return values
boolmerge()
public
merge(self $other) : self
Parameters
- $other : self
Return values
selfnormalize()
relative_error is null when it is not a finite number.
public
normalize() : array{at_most: null|int<0, max>, estimate: null|int<0, max>, relative_error: null|float}
Return values
array{at_most: null|int<0, max>, estimate: null|int<0, max>, relative_error: null|float}unknown()
public
static unknown() : self