function Vector::count in Recommender API 7.6
Same name and namespace in other branches
- 6.2 Matrix.php \Vector::count()
Count the number of vectors. This works for SparseVector too. It only counts valid numbers, not the size the vector is supposed to be.
Parameters
$may_cache:
Return value
the count number
3 calls to Vector::count()
- Vector::covariance in classes/
Matrix.php - Compute covariance with $vector. No caching option. Works for RealVector. SparseVector needs additional handling.
- Vector::mean in classes/
Matrix.php - Calculate the mean. This works for SparseMatrix too.
- Vector::variance in classes/
Matrix.php - Calculate the variance. This works for SparseMatrix too.
File
- classes/
Matrix.php, line 193
Class
- Vector
- This is the Vector superclass. @author danithaca
Code
function count($may_cache = FALSE) {
if (!$may_cache || $this->count === NULL) {
// triggers counting
$this->count = count($this->values);
}
return $this->count;
}