This repository has been archived on 2020-06-07. You can view files and clone it, but cannot push or open issues or pull requests.
php-armadillo/stubs/internal/DenseResizableVector.php
2019-11-04 16:19:23 +08:00

75 lines
1.7 KiB
PHP

<?php
namespace Arma\Internal;
use Arma\SortDirection;
/**
* Interface for resizable (non-subview) dense vectors.
*
* @package Arma\Internal
*/
interface DenseResizableVector extends DenseVector, ResizableVector
{
// Initialization
/**
* Construct the vector to have user specified size and fill with specified pattern.
*
* @param int $n_elem[optional]
* @param int $fill[optional]
* @return static
*/
static function init($n_elem, $fill);
/**
* Set all the elements of an object to one, optionally first changing the size to specified dimensions.
*
* @param int $n_elem[optional]
* @return $this
*/
function ones($n_elem);
/**
* Set all the elements to random values, optionally first changing the size to specified dimensions.
*
* Uses a uniform distribution in the [0,1] interval.
*
* @param int $n_elem[optional]
* @return $this
*/
function randu($n_elem);
/**
* Set all the elements to random values, optionally first changing the size to specified dimensions.
*
* Uses a normal/Gaussian distribution with zero mean and unit variance.
*
* @param int $n_elem[optional]
* @return $this
*/
function randn($n_elem);
// Swap
/**
* Swap contents with another vector.
*
* @param DenseResizableVector $other
* @return void
*/
function swap($other);
// Characteristics
/**
* Check whether the vector is sorted.
*
* For vectors with complex numbers, order is checked via absolute values.
*
* @param int $sort_direction[optional]
* @return bool
*/
function isSorted($sort_direction = SortDirection::ASCEND);
}