This repository has been archived on 2020-06-07. You can view files and clone it, but cannot push or open issues or pull requests.
php-armadillo/stubs/internal/Matrix.php

216 lines
4.4 KiB
PHP
Raw Normal View History

2019-02-15 05:44:52 +00:00
<?php
namespace Arma\Internal;
/**
2019-03-18 14:49:42 +00:00
* Interface for matrices.
2019-02-15 05:44:52 +00:00
*
* @package Arma\Internal
*/
2019-03-08 14:15:02 +00:00
interface Matrix
2019-02-15 05:44:52 +00:00
{
2019-03-18 14:49:42 +00:00
// Characteristics
2019-02-15 05:44:52 +00:00
/**
2019-03-18 14:49:42 +00:00
* Get number of rows.
2019-02-15 05:44:52 +00:00
*
2019-03-18 14:49:42 +00:00
* @return int
2019-02-15 05:44:52 +00:00
*/
2019-03-18 14:49:42 +00:00
function nRows();
2019-02-15 05:44:52 +00:00
/**
2019-03-18 14:49:42 +00:00
* Get number of columns.
2019-02-15 05:44:52 +00:00
*
2019-03-18 14:49:42 +00:00
* @return int
2019-02-15 05:44:52 +00:00
*/
2019-03-18 14:49:42 +00:00
function nCols();
2019-02-15 05:44:52 +00:00
/**
* 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
*/
2019-03-08 14:15:02 +00:00
function isCol();
2019-02-15 05:44:52 +00:00
/**
* Check whether the matrix has exactly one row.
*
* @return bool
*/
2019-03-08 14:15:02 +00:00
function isRow();
2019-02-15 05:44:52 +00:00
/**
* Check whether the matrix is square.
*
* @return bool
*/
function isSquare();
/**
* Check whether the matrix is symmetric.
*
* @param number $tol[optional]
2019-02-15 05:44:52 +00:00
* @return bool
*/
function isSymmetric($tol);
2019-02-15 05:44:52 +00:00
/**
* Check whether the matrix is hermitian.
*
2019-03-21 10:49:11 +00:00
* @param number $tol[optional]
* @return bool
*/
function isHermitian($tol);
2019-03-21 10:49:11 +00:00
2019-03-18 14:49:42 +00:00
// Subview
/**
* 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]
2019-03-23 16:24:34 +00:00
* @return Scalar
2019-03-18 14:49:42 +00:00
*/
2019-03-27 08:29:00 +00:00
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
*/
2019-03-18 14:49:42 +00:00
function at($i, $j);
2019-03-10 15:23:11 +00:00
/**
* Read/write access to a certain column of the object.
*
* @param int $col_number
* @return Subview
*/
function col($col_number);
/**
* Read/write access to a certain row of the object.
*
* @param int $row_number
* @return Subview
*/
function row($row_number);
/**
* Read/write access to certain columns of the object.
*
* @param int $first_col
* @param int $last_col
* @return Subview
*/
function cols($first_col, $last_col);
/**
* Read/write access to certain rows of the object.
*
* @param int $first_row
* @param int $last_row
* @return Subview
*/
function rows($first_row, $last_row);
/**
* Read/write access to a matrix subview.
*
* @param int $first_row
* @param int $first_col
* @param int $last_row
* @param int $last_col
* @return Subview
*/
function submat($first_row, $first_col, $last_row, $last_col);
/**
* Read/write access to a matrix subview of first specified columns.
*
2019-03-13 15:19:05 +00:00
* @param int $n_cols
2019-03-10 15:23:11 +00:00
* @return Subview
*/
2019-05-25 18:20:02 +00:00
function headCols($n_cols);
2019-03-10 15:23:11 +00:00
/**
* Read/write access to a matrix subview of first specified rows.
*
* @param int $n_rows
* @return Subview
*/
2019-05-25 18:20:02 +00:00
function headRows($n_rows);
2019-03-10 15:23:11 +00:00
/**
* Read/write access to a matrix subview of last specified columns.
*
* @param int $n_cols
* @return Subview
*/
2019-05-25 18:20:02 +00:00
function tailCols($n_cols);
2019-03-10 15:23:11 +00:00
/**
* Read/write access to a matrix subview of last specified rows.
*
* @param int $n_rows
* @return Subview
*/
2019-05-25 18:20:02 +00:00
function tailRows($n_rows);
2019-03-10 15:23:11 +00:00
/**
* 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).
*
2019-03-18 14:49:42 +00:00
* @param int $k[optional]
2019-03-10 15:23:11 +00:00
* @return Subview
*/
function diag($k = 0);
2019-03-21 10:49:11 +00:00
// Swap
/**
* Swap the contents of specified rows.
*
* @param int $row_1
* @param int $row_2
* @return void
*/
function swapRows($row_1, $row_2);
/**
* Swap the contents of specified columns.
*
* @param int $col_1
* @param int $col_2
* @return void
*/
function swapCols($col_1, $col_2);
// Transform
/**
* Returns a transposed copy of the matrix.
*
* For complex matrices, $conj indicates whether the conjugate of the elements is taken during the transpose.
*
* @param bool $conj[optional]
* @return Matrix
*/
function t($conj = true);
2019-02-15 05:44:52 +00:00
}