77 lines
1.8 KiB
PHP
77 lines
1.8 KiB
PHP
<?php
|
|
|
|
namespace Arma\Internal;
|
|
|
|
/**
|
|
* Interface for vectors (Colvec and Rowvec).
|
|
*
|
|
* @package Arma\Internal
|
|
*/
|
|
interface VecBase extends Dense
|
|
{
|
|
/**
|
|
* Construct the vector to have user specified size and fill with specified pattern.
|
|
*
|
|
* @param int $n_elem
|
|
* @param int $fill[optional]
|
|
* @return static
|
|
*/
|
|
static function init($n_elem, $fill);
|
|
|
|
/**
|
|
* Create the vector from a textual description.
|
|
*
|
|
* Elements should be separated by spaces.
|
|
*
|
|
* @param string $text
|
|
* @return static
|
|
*/
|
|
static function fromString($text);
|
|
|
|
/**
|
|
* Create the vector from a matrix.
|
|
*
|
|
* Elements should be separated by spaces.
|
|
*
|
|
* @param MatBase $mat
|
|
* @return static
|
|
*/
|
|
static function fromMat($mat);
|
|
|
|
/**
|
|
* Set the elements of an object to zero, optionally first changing the size to specified dimensions.
|
|
*
|
|
* @param $n_elem[optional]
|
|
* @return void
|
|
*/
|
|
function zeros($n_elem);
|
|
|
|
/**
|
|
* Set all the elements of an object to one, optionally first changing the size to specified dimensions.
|
|
*
|
|
* @param $n_elem[optional]
|
|
* @return void
|
|
*/
|
|
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 $n_elem[optional]
|
|
* @return void
|
|
*/
|
|
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 $n_elem[optional]
|
|
* @return void
|
|
*/
|
|
function randn($n_elem);
|
|
}
|