add some stubs
This commit is contained in:
parent
c0fdb1fa5e
commit
ca30fcbef5
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
.idea/
|
||||
.vscode/
|
8
stubs/Colvec.php
Normal file
8
stubs/Colvec.php
Normal file
|
@ -0,0 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace Arma;
|
||||
|
||||
interface Colvec
|
||||
{
|
||||
|
||||
}
|
20
stubs/CxMat.php
Normal file
20
stubs/CxMat.php
Normal file
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
|
||||
namespace Arma;
|
||||
|
||||
/**
|
||||
* Interface for a dense matrix with complex numbers as elements.
|
||||
*
|
||||
* @package Arma
|
||||
*/
|
||||
interface CxMat extends Mat
|
||||
{
|
||||
/**
|
||||
* Construct a complex matrix out of two non-complex matrices.
|
||||
*
|
||||
* @param Mat $real
|
||||
* @param Mat $imag
|
||||
* @return CxMat
|
||||
*/
|
||||
static function fromMats($real, $imag);
|
||||
}
|
36
stubs/Fill.php
Normal file
36
stubs/Fill.php
Normal file
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
namespace Arma;
|
||||
|
||||
abstract class Fill
|
||||
{
|
||||
/**
|
||||
* Do not modify the elements.
|
||||
*/
|
||||
const NONE = 0;
|
||||
|
||||
/**
|
||||
* Set all elements to 0.
|
||||
*/
|
||||
const ZEROS = 1;
|
||||
|
||||
/**
|
||||
* Set all elements to 1.
|
||||
*/
|
||||
const ONES = 2;
|
||||
|
||||
/**
|
||||
* Set the elements along the main diagonal to 1 and off-diagonal elements to 0.
|
||||
*/
|
||||
const EYE = 3;
|
||||
|
||||
/**
|
||||
* Set each element to a random value from a uniform distribution in the [0,1] interval.
|
||||
*/
|
||||
const RANDU = 4;
|
||||
|
||||
/**
|
||||
* Set each element to a random value from a normal/Gaussian distribution with zero mean and unit variance.
|
||||
*/
|
||||
const RANDN = 5;
|
||||
}
|
46
stubs/Mat.php
Normal file
46
stubs/Mat.php
Normal file
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
|
||||
namespace Arma;
|
||||
|
||||
/**
|
||||
* Interface for a dense matrix.
|
||||
*
|
||||
* @package Arma
|
||||
*/
|
||||
interface Mat
|
||||
{
|
||||
/**
|
||||
* Construct the matrix to have user specified dimensions and fill with specified pattern.
|
||||
*
|
||||
* @param int $in_rows
|
||||
* @param int $in_cols
|
||||
* @param int $fill[optional]
|
||||
* @return Mat
|
||||
*/
|
||||
static function init($in_rows, $in_cols, $fill);
|
||||
|
||||
/**
|
||||
* Create the matrix from a textual description.
|
||||
*
|
||||
* @param string $text
|
||||
* @return Mat
|
||||
*/
|
||||
static function fromString($text);
|
||||
|
||||
/**
|
||||
* Create the matrix from a column or row vector.
|
||||
*
|
||||
* @param Colvec|Rowvec $vector
|
||||
* @return Mat
|
||||
*/
|
||||
static function fromVec($vector);
|
||||
|
||||
/**
|
||||
* Create the matrix from a sparse matrix.
|
||||
*
|
||||
* @param SpMat $sp_mat
|
||||
* @return Mat
|
||||
*/
|
||||
static function fromSparse($sp_mat);
|
||||
|
||||
}
|
8
stubs/Rowvec.php
Normal file
8
stubs/Rowvec.php
Normal file
|
@ -0,0 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace Arma;
|
||||
|
||||
interface Rowvec
|
||||
{
|
||||
|
||||
}
|
8
stubs/SpMat.php
Normal file
8
stubs/SpMat.php
Normal file
|
@ -0,0 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace Arma;
|
||||
|
||||
interface SpMat
|
||||
{
|
||||
|
||||
}
|
5
stubs/Vec.php
Normal file
5
stubs/Vec.php
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?php
|
||||
|
||||
namespace arma;
|
||||
|
||||
class_alias(Colvec::class, 'arma\\Vec');
|
2
stubs/a.php
Normal file
2
stubs/a.php
Normal file
|
@ -0,0 +1,2 @@
|
|||
<?php
|
||||
|
36
stubs/impl/CxDmat.php
Normal file
36
stubs/impl/CxDmat.php
Normal file
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
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) {}
|
||||
}
|
36
stubs/impl/CxImat.php
Normal file
36
stubs/impl/CxImat.php
Normal file
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
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) {}
|
||||
}
|
30
stubs/impl/Dmat.php
Normal file
30
stubs/impl/Dmat.php
Normal file
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
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) {}
|
||||
}
|
30
stubs/impl/Imat.php
Normal file
30
stubs/impl/Imat.php
Normal file
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
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) {}
|
||||
}
|
Reference in New Issue
Block a user