77 lines
1.8 KiB
PHP
77 lines
1.8 KiB
PHP
<?php
|
|
|
|
namespace Arma;
|
|
|
|
/**
|
|
* Interface for a dense matrix.
|
|
*
|
|
* @package Arma
|
|
*/
|
|
interface Mat extends Internal\Dense, Internal\MatBase
|
|
{
|
|
/**
|
|
* Construct the matrix to have user specified dimensions and fill with specified pattern.
|
|
*
|
|
* @param int $n_rows
|
|
* @param int $n_cols
|
|
* @param int $fill[optional]
|
|
* @return static
|
|
*/
|
|
static function init($n_rows, $n_cols, $fill);
|
|
|
|
/**
|
|
* Create the matrix from a textual description.
|
|
*
|
|
* @param string $text
|
|
* @return static
|
|
*/
|
|
static function fromString($text);
|
|
|
|
/**
|
|
* Create the matrix from a column or row vector.
|
|
*
|
|
* @param Colvec|Rowvec $vector
|
|
* @return static
|
|
*/
|
|
static function fromVec($vector);
|
|
|
|
/**
|
|
* Create the matrix from a sparse matrix.
|
|
*
|
|
* @param SpMat $sp_mat
|
|
* @return static
|
|
*/
|
|
static function fromSparse($sp_mat);
|
|
|
|
/**
|
|
* Set all the elements of an object to one, optionally first changing the size to specified dimensions.
|
|
*
|
|
* @param $n_rows[optional]
|
|
* @param $n_cols[optional]
|
|
* @return void
|
|
*/
|
|
function ones($n_rows, $n_cols);
|
|
|
|
/**
|
|
* 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_rows
|
|
* @param int $n_cols
|
|
* @return void
|
|
*/
|
|
function randu($n_rows, $n_cols);
|
|
|
|
/**
|
|
* 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_rows
|
|
* @param int $n_cols
|
|
* @return void
|
|
*/
|
|
function randn($n_rows, $n_cols);
|
|
}
|