115 lines
2.6 KiB
PHP
115 lines
2.6 KiB
PHP
<?php
|
|
|
|
namespace Arma\Internal;
|
|
|
|
/**
|
|
* Interface for matrix-only operations.
|
|
*
|
|
* @package Arma\Internal
|
|
*/
|
|
interface MatBase
|
|
{
|
|
/**
|
|
* Set the elements of an object to zero, optionally first changing the size to specified dimensions.
|
|
*
|
|
* @param $n_rows[optional]
|
|
* @param $n_cols[optional]
|
|
* @return void
|
|
*/
|
|
function zeros($n_rows, $n_cols);
|
|
|
|
/**
|
|
* 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 the elements along the main diagonal to one and off-diagonal elements to zero, optionally
|
|
* first changing the size to specified dimensions.
|
|
*
|
|
* @param $n_rows[optional]
|
|
* @param $n_cols[optional]
|
|
* @return void
|
|
*/
|
|
function eye($n_rows, $n_cols);
|
|
|
|
/**
|
|
* Recreate the object according to given size specifications, with the elements taken from the
|
|
* previous version of the object in a column-wise manner.
|
|
*
|
|
* The elements in the generated object are placed column-wise.
|
|
*
|
|
* @param $n_rows[optional]
|
|
* @param $n_cols[optional]
|
|
* @return void
|
|
*/
|
|
function reshape($n_rows, $n_cols);
|
|
|
|
/**
|
|
* Recreate the object according to given size specifications, while preserving the elements
|
|
* as well as the layout of the elements.
|
|
*
|
|
* @param $n_rows[optional]
|
|
* @param $n_cols[optional]
|
|
* @return void
|
|
*/
|
|
function resize($n_rows, $n_cols);
|
|
|
|
/**
|
|
* Read/write access to a diagonal in a matrix.
|
|
*
|
|
* For k=0 the main diagonal is accessed. For k > 0, the k-th super-diagonal is accessed (top-right corner).
|
|
* For k < 0, the k-th sub-diagonal is accessed (bottom-left corner).
|
|
*
|
|
* @param int $k
|
|
* @return \Arma\Colvec
|
|
*/
|
|
function diag($k = 0);
|
|
|
|
/**
|
|
* Check whether the matrix has exactly one column or one row.
|
|
*
|
|
* @return bool
|
|
*/
|
|
function isVec();
|
|
|
|
/**
|
|
* Check whether the matrix has exactly one column.
|
|
*
|
|
* @return bool
|
|
*/
|
|
function isColvec();
|
|
|
|
/**
|
|
* Check whether the matrix has exactly one row.
|
|
*
|
|
* @return bool
|
|
*/
|
|
function isRowvec();
|
|
|
|
/**
|
|
* Check whether the matrix is square.
|
|
*
|
|
* @return bool
|
|
*/
|
|
function isSquare();
|
|
|
|
/**
|
|
* Check whether the matrix is symmetric.
|
|
*
|
|
* @return bool
|
|
*/
|
|
function isSymmetric();
|
|
|
|
/**
|
|
* Check whether the matrix is hermitian.
|
|
*
|
|
* @return bool
|
|
*/
|
|
function isHermitian();
|
|
}
|