2019-03-18 14:49:42 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Arma\Internal;
|
|
|
|
|
2019-04-04 08:07:37 +00:00
|
|
|
use Arma\SortDirection;
|
|
|
|
|
2019-03-27 08:29:00 +00:00
|
|
|
/**
|
|
|
|
* Interface for resizable (non-subview) dense vectors.
|
|
|
|
*
|
|
|
|
* @package Arma\Internal
|
|
|
|
*/
|
2019-03-18 14:49:42 +00:00
|
|
|
interface DenseResizableVector extends DenseVector, ResizableVector
|
|
|
|
{
|
|
|
|
// Initialization
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set all the elements of an object to one, optionally first changing the size to specified dimensions.
|
|
|
|
*
|
|
|
|
* @param int $n_elem[optional]
|
2019-06-12 03:06:18 +00:00
|
|
|
* @return $this
|
2019-03-18 14:49:42 +00:00
|
|
|
*/
|
|
|
|
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]
|
2019-06-12 03:06:18 +00:00
|
|
|
* @return $this
|
2019-03-18 14:49:42 +00:00
|
|
|
*/
|
|
|
|
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]
|
2019-06-12 03:06:18 +00:00
|
|
|
* @return $this
|
2019-03-18 14:49:42 +00:00
|
|
|
*/
|
|
|
|
function randn($n_elem);
|
2019-03-21 10:49:11 +00:00
|
|
|
|
|
|
|
// 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
|
|
|
|
*/
|
2019-04-04 08:07:37 +00:00
|
|
|
function isSorted($sort_direction = SortDirection::ASCEND);
|
2019-03-18 14:49:42 +00:00
|
|
|
}
|