update stubs

This commit is contained in:
CismonX 2019-02-14 19:11:36 +08:00
parent 2c16d01842
commit a861bf46d2
14 changed files with 140 additions and 112 deletions

View File

@ -6,3 +6,5 @@ interface Colvec extends Internal\Operable
{
}
class_alias(Colvec::class, 'Arma\\Vec');

View File

@ -14,7 +14,7 @@ interface CxMat extends Mat
*
* @param Mat $real
* @param Mat $imag
* @return CxMat
* @return static
*/
static function fromMats($real, $imag);
}

View File

@ -15,7 +15,7 @@ interface Mat extends Internal\Operable
* @param int $in_rows
* @param int $in_cols
* @param int $fill[optional]
* @return Mat
* @return static
*/
static function init($in_rows, $in_cols, $fill);
@ -23,7 +23,7 @@ interface Mat extends Internal\Operable
* Create the matrix from a textual description.
*
* @param string $text
* @return Mat
* @return static
*/
static function fromString($text);
@ -31,7 +31,7 @@ interface Mat extends Internal\Operable
* Create the matrix from a column or row vector.
*
* @param Colvec|Rowvec $vector
* @return Mat
* @return static
*/
static function fromVec($vector);
@ -39,7 +39,7 @@ interface Mat extends Internal\Operable
* Create the matrix from a sparse matrix.
*
* @param SpMat $sp_mat
* @return Mat
* @return static
*/
static function fromSparse($sp_mat);

View File

@ -2,7 +2,7 @@
namespace Arma;
interface SpMat
interface SpMat extends Internal\Accessible
{
}

View File

@ -1,5 +0,0 @@
<?php
namespace arma;
class_alias(Colvec::class, 'arma\\Vec');

View File

@ -4,33 +4,5 @@ namespace Arma;
class CxDMat implements CxMat
{
/**
* @inheritdoc
* @return CxDMat
*/
static function init($in_rows, $in_cols, $fill = null) {}
/**
* @inheritdoc
* @return CxDMat
*/
public static function fromMats($real, $imag) {}
/**
* @inheritdoc
* @return CxDMat
*/
static function fromSparse($sp_mat) {}
/**
* @inheritdoc
* @return CxDMat
*/
static function fromString($text) {}
/**
* @inheritdoc
* @return CxDMat
*/
static function fromVec($vector) {}
}

View File

@ -4,33 +4,5 @@ namespace Arma;
class CxIMat implements CxMat
{
/**
* @inheritdoc
* @return CxIMat
*/
static function init($in_rows, $in_cols, $fill = 0) {}
/**
* @inheritdoc
* @return CxIMat
*/
public static function fromMats($real, $imag) {}
/**
* @inheritdoc
* @return CxIMat
*/
static function fromSparse($sp_mat) {}
/**
* @inheritdoc
* @return CxIMat
*/
static function fromString($text) {}
/**
* @inheritdoc
* @return CxIMat
*/
static function fromVec($vector) {}
}

View File

@ -0,0 +1,10 @@
<?php
namespace Arma;
class DColvec implements Colvec
{
}
class_alias(DColvec::class, 'Arma\\DVec');

View File

@ -4,27 +4,5 @@ namespace Arma;
class DMat implements Mat
{
/**
* @inheritdoc
* @return DMat
*/
static function init($in_rows, $in_cols, $fill = null) {}
/**
* @inheritdoc
* @return DMat
*/
static function fromSparse($sp_mat) {}
/**
* @inheritdoc
* @return DMat
*/
static function fromString($text) {}
/**
* @inheritdoc
* @return DMat
*/
static function fromVec($vector) {}
}

View File

@ -0,0 +1,8 @@
<?php
namespace Arma;
class DRowvec implements Rowvec
{
}

View File

View File

@ -4,27 +4,5 @@ namespace Arma;
class IMat implements Mat
{
/**
* @inheritdoc
* @return IMat
*/
static function init($in_rows, $in_cols, $fill = 0) {}
/**
* @inheritdoc
* @return IMat
*/
static function fromSparse($sp_mat) {}
/**
* @inheritdoc
* @return IMat
*/
static function fromString($text) {}
/**
* @inheritdoc
* @return IMat
*/
static function fromVec($vector) {}
}

View File

@ -4,9 +4,46 @@ namespace Arma\Internal;
interface Accessible
{
/**
* Get number of rows.
*
* @return int
*/
function nRows();
/**
* Get number of columns.
*
* @return int
*/
function nCols();
/**
* Get number of elements.
*
* @return int
*/
function nElem();
/**
* If $j is not specified, access the n-th element. Otherwise, access the element stored at the i-th row
* and j-th column.
*
* @param int $i
* @param int $j[optional]
* @return mixed
*/
function &__invoke($i, $j);
/**
* If $j is not specified, access the n-th element. Otherwise, access the element stored at the i-th row
* and j-th column.
*
* Without a bounds check. Not recommended for use unless your code has been thoroughly debugged.
*
* @param int $i
* @param int $j[optional]
* @return mixed
*/
function &at($i, $j);
}

View File

@ -4,23 +4,99 @@ namespace Arma\Internal;
interface Operable extends Accessible
{
/**
* Addition of two objects.
*
* @param static $other
* @return static
*/
function add($other);
/**
* Subtraction of two objects.
*
* @param static $other
* @return static
*/
function sub($other);
/**
* Negation of the object.
*
* @return static
*/
function neg();
/**
* Matrix multiplication of two objects.
*
* @param static $other
* @return static
*/
function mul($other);
/**
* Element-wise multiplication of two objects.
*
* @param static $other
* @return static
*/
function dotMul($other);
/**
* Element-wise division of an object by another object or a scalar.
*
* @param static|number $other
* @return static
*/
function div($other);
function equals($others);
/**
* Element-wise equality evaluation of two objects.
*
*
* @param static $other
* @return \Arma\IMat
*/
function equals($other);
/**
* Element-wise non-equality evaluation of two objects.
*
* @param static $other
* @return \Arma\IMat
*/
function notEquals($other);
/**
* Element-wise "greater than" evaluation of two objects.
*
* @param static $other
* @return \Arma\IMat
*/
function greaterThan($other);
/**
* Element-wise "smaller than" evaluation of two objects.
*
* @param static $other
* @return \Arma\IMat
*/
function smallerThan($other);
/**
* Element-wise "not greater than" evaluation of two objects.
*
* @param static $other
* @return \Arma\IMat
*/
function notGreaterThan($other);
/**
* Element-wise "not smaller than" evaluation of two objects.
*
* @param static $other
* @return \Arma\IMat
*/
function notSmallerThan($other);
}