update stubs

This commit is contained in:
CismonX 2019-02-24 11:39:51 +08:00
parent b94bb13758
commit 58179a6d71
6 changed files with 48 additions and 54 deletions

View File

@ -7,7 +7,7 @@ namespace Arma;
*
* @package Arma
*/
interface Mat extends Internal\Common, Internal\Dense, Internal\MatBase
interface Mat extends Internal\Dense, Internal\MatBase
{
/**
* Construct the matrix to have user specified dimensions and fill with specified pattern.

View File

@ -7,7 +7,7 @@ namespace Arma;
*
* @package Arma
*/
interface SpMat extends Internal\Common, Internal\MatBase
interface SpMat extends Internal\MatBase
{
}

View File

@ -2,7 +2,12 @@
namespace Arma;
interface Vec extends Internal\Common, Internal\Dense, Internal\VecBase
/**
* Interface for vectors (Colvec and Rowvec).
*
* @package Arma\Internal
*/
interface Vec extends Internal\Dense
{
/**
* Construct the vector to have user specified size and fill with specified pattern.
@ -28,8 +33,44 @@ interface Vec extends Internal\Common, Internal\Dense, Internal\VecBase
*
* Elements should be separated by spaces.
*
* @param Mat mat
* @param Mat|SpMat $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);
}

View File

@ -7,7 +7,7 @@ namespace Arma\Internal;
*
* @package Arma\Internal
*/
interface Dense
interface Dense extends Common
{
/**
* Element-wise division of an object by another object or a scalar.

View File

@ -3,11 +3,11 @@
namespace Arma\Internal;
/**
* Interface for matrix-only(Mat and SpMat) operations.
* Interface for matrices (Mat and SpMat).
*
* @package Arma\Internal
*/
interface MatBase
interface MatBase extends Common
{
/**
* Set the elements of an object to zero, optionally first changing the size to specified dimensions.

View File

@ -1,47 +0,0 @@
<?php
namespace Arma\Internal;
/**
* Interface for vector-only objects.
*
* @package Arma\Internal
*/
interface VecBase
{
/**
* 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);
}