update
This commit is contained in:
parent
9d8cf4d911
commit
633e52f32f
|
@ -47,12 +47,6 @@ namespace php_arma
|
|||
return Z_TYPE_P(zv) == IS_OBJECT && instanceof_function(Z_OBJCE_P(zv), PHP_ARMA_CE(complex, double));
|
||||
}
|
||||
|
||||
template <>
|
||||
struct scalar_type<cx_double>
|
||||
{
|
||||
static constexpr auto value = IS_OBJECT;
|
||||
};
|
||||
|
||||
template <>
|
||||
zend_always_inline
|
||||
const char *scalar_type_name<cx_double>()
|
||||
|
|
|
@ -203,21 +203,6 @@ namespace php_arma
|
|||
return Z_TYPE_P(zv) == IS_LONG;
|
||||
}
|
||||
|
||||
template <typename>
|
||||
struct scalar_type {};
|
||||
|
||||
template <>
|
||||
struct scalar_type<double>
|
||||
{
|
||||
static constexpr auto value = IS_DOUBLE;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct scalar_type<zend_long>
|
||||
{
|
||||
static constexpr auto value = IS_LONG;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
zend_always_inline
|
||||
const char *scalar_type_name()
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
namespace Arma\Internal;
|
||||
|
||||
/**
|
||||
* Interface for a dense matrix.
|
||||
* Interface for dense matrices.
|
||||
*
|
||||
* @package Arma
|
||||
*/
|
||||
|
@ -11,6 +11,15 @@ interface DenseMatrix extends Dense, Matrix
|
|||
{
|
||||
// Subview
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @param int $i
|
||||
* @param int $j[optional]
|
||||
* @return \Arma\MapVal
|
||||
*/
|
||||
function __invoke($i, $j);;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
|
|
|
@ -2,6 +2,11 @@
|
|||
|
||||
namespace Arma\Internal;
|
||||
|
||||
/**
|
||||
* Interface for non-resizable dense matrices (subview).
|
||||
*
|
||||
* @package Arma\Internal
|
||||
*/
|
||||
interface DenseNonResizableMatrix extends DenseMatrix, NonResizableMatrix
|
||||
{
|
||||
// Initialization
|
||||
|
|
|
@ -2,6 +2,11 @@
|
|||
|
||||
namespace Arma\Internal;
|
||||
|
||||
/**
|
||||
* Interface for non-resizable dense vectors (subview).
|
||||
*
|
||||
* @package Arma\Internal
|
||||
*/
|
||||
interface DenseNonResizableVector extends DenseVector, NonResizableVector
|
||||
{
|
||||
// Initialization
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
namespace Arma\Internal;
|
||||
|
||||
/**
|
||||
* Interface for a dense matrix which is resizable.
|
||||
* Interface for resizable (non-subview) dense matrices.
|
||||
*
|
||||
* @package Arma\Internal
|
||||
*/
|
||||
|
|
|
@ -2,6 +2,11 @@
|
|||
|
||||
namespace Arma\Internal;
|
||||
|
||||
/**
|
||||
* Interface for resizable (non-subview) dense vectors.
|
||||
*
|
||||
* @package Arma\Internal
|
||||
*/
|
||||
interface DenseResizableVector extends DenseVector, ResizableVector
|
||||
{
|
||||
// Initialization
|
||||
|
|
|
@ -3,13 +3,22 @@
|
|||
namespace Arma\Internal;
|
||||
|
||||
/**
|
||||
* Interface for vectors with a Dense Layout (Row and Col)
|
||||
* Interface for vectors with a Dense Layout (Row and Col).
|
||||
*
|
||||
* @package Arma\Internal
|
||||
*/
|
||||
interface DenseVector extends Dense, Vector
|
||||
{
|
||||
/// Subview
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @param int $idx
|
||||
* @return \Arma\MapVal
|
||||
*/
|
||||
function __invoke($idx);
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
namespace Arma\Internal;
|
||||
|
||||
/**
|
||||
* Interface for diagonal subview of matrix (Mat and SpMat).
|
||||
* Interface for diagonal subview of matrices (Mat and SpMat).
|
||||
*
|
||||
* @package Arma\Internal
|
||||
*/
|
||||
|
|
|
@ -94,6 +94,18 @@ interface Matrix
|
|||
* @param int $j[optional]
|
||||
* @return Scalar
|
||||
*/
|
||||
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 Scalar
|
||||
*/
|
||||
function at($i, $j);
|
||||
|
||||
/**
|
||||
|
|
|
@ -2,6 +2,11 @@
|
|||
|
||||
namespace Arma\Internal;
|
||||
|
||||
/**
|
||||
* Interface for non-resizable container objects.
|
||||
*
|
||||
* @package Arma\Internal
|
||||
*/
|
||||
interface NonResizable
|
||||
{
|
||||
/**
|
||||
|
|
|
@ -2,6 +2,11 @@
|
|||
|
||||
namespace Arma\Internal;
|
||||
|
||||
/**
|
||||
* Interface for non-resizable matrices (subview).
|
||||
*
|
||||
* @package Arma\Internal
|
||||
*/
|
||||
interface NonResizableMatrix extends NonResizable, Matrix
|
||||
{
|
||||
/**
|
||||
|
|
|
@ -2,6 +2,11 @@
|
|||
|
||||
namespace Arma\Internal;
|
||||
|
||||
/**
|
||||
* Interface for non-resizable vectors (subview).
|
||||
*
|
||||
* @package Arma\Internal
|
||||
*/
|
||||
interface NonResizableVector extends NonResizable, Vector
|
||||
{
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
namespace Arma\Internal;
|
||||
|
||||
/**
|
||||
* Interface for resizable matrices.
|
||||
* Interface for resizable (non-subview) matrices.
|
||||
*
|
||||
* @package Arma\Internal
|
||||
*/
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
namespace Arma\Internal;
|
||||
|
||||
/**
|
||||
* Interface for resizable vectors.
|
||||
* Interface for resizable (non-subview) vectors.
|
||||
*
|
||||
* @package Arma\Internal
|
||||
*/
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
namespace Arma\Internal;
|
||||
|
||||
/**
|
||||
* Interface for objects whose elements are stored in CSC format.
|
||||
* Interface for objects whose elements are stored in compressed sparse column (CSC) format.
|
||||
*
|
||||
* @package Arma\Internal
|
||||
*/
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
namespace Arma\Internal;
|
||||
|
||||
/**
|
||||
* Interface for a sparse matrix.
|
||||
* Interface for sparse matrices.
|
||||
*
|
||||
* @package Arma
|
||||
*/
|
||||
|
|
|
@ -2,10 +2,24 @@
|
|||
|
||||
namespace Arma\Internal;
|
||||
|
||||
/**
|
||||
* Interface for resizable (non-subview) sparse matrices.
|
||||
*
|
||||
* @package Arma\Internal
|
||||
*/
|
||||
interface SparseNonResizableMatrix extends SparseMatrix, NonResizableMatrix
|
||||
{
|
||||
// Subview
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @param int $i
|
||||
* @param int $j[optional]
|
||||
* @return \Arma\SpSvMapVal
|
||||
*/
|
||||
function __invoke($i, $j);
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
|
|
|
@ -6,6 +6,15 @@ interface SparseResizableMatrix extends SparseMatrix, ResizableMatrix
|
|||
{
|
||||
// Subview
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @param int $i
|
||||
* @param int $j[optional]
|
||||
* @return \Arma\SpMapVal
|
||||
*/
|
||||
function __invoke($i, $j);
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
|
|
|
@ -2,6 +2,11 @@
|
|||
|
||||
namespace Arma\Internal;
|
||||
|
||||
/**
|
||||
* Interface for resizable (non-subview) sparse vectors.
|
||||
*
|
||||
* @package Arma\Internal
|
||||
*/
|
||||
interface SparseResizableVector extends SparseVector, ResizableVector
|
||||
{
|
||||
|
||||
|
|
|
@ -6,6 +6,14 @@ interface SparseVector extends Sparse, Vector
|
|||
{
|
||||
/// Subview
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @param int $idx
|
||||
* @return \Arma\SpMapVal
|
||||
*/
|
||||
function __invoke($idx);
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
namespace Arma\Internal;
|
||||
|
||||
/**
|
||||
* Interface of object subview (Mat, Col, Row, SpMat).
|
||||
* Interface of object (Mat, Col, Row, SpMat) subview.
|
||||
*
|
||||
* @package Arma\Internal
|
||||
*/
|
||||
|
|
|
@ -38,6 +38,16 @@ interface Vector
|
|||
* @param int $idx
|
||||
* @return Scalar
|
||||
*/
|
||||
function __invoke($idx);
|
||||
|
||||
/**
|
||||
* Read/write access to the n-th element.
|
||||
*
|
||||
* Without a bounds check. Not recommended for use unless your code has been thoroughly debugged.
|
||||
*
|
||||
* @param int $idx
|
||||
* @return Scalar
|
||||
*/
|
||||
function at($idx);
|
||||
|
||||
/**
|
||||
|
|
Reference in New Issue
Block a user