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/ResizableMatrix.php

125 lines
2.8 KiB
PHP

<?php
namespace Arma\Internal;
/**
* Interface for resizable (non-subview) matrices.
*
* @package Arma\Internal
*/
interface ResizableMatrix extends Resizable, Matrix
{
/**
* Create the matrix from a textual description.
*
* @param string $text
* @return Mat
*/
static function fromString($text);
/**
* Create the matrix from a PHP array.
*
* @param array $arr
* @return Mat
*/
static function fromArray($arr);
/**
* 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 int $n_rows
* @param int $n_cols
* @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 int $n_rows
* @param int $n_cols
* @return void
*/
function resize($n_rows, $n_cols);
/**
* Change the size of an object, without explicitly preserving data and without initialising the elements.
*
* @param int $n_rows
* @param int $n_cols
* @return void
*/
function setSize($n_rows, $n_cols);
/**
* Set the elements of an object to zero, optionally first changing the size to specified dimensions.
*
* @param int $n_rows[optional]
* @param int $n_cols[optional]
* @return $this
*/
function zeros($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 int $n_rows[optional]
* @param int $n_cols[optional]
* @return $this
*/
function eye($n_rows, $n_cols);
// Characteristics
/**
* Check whether the given location is currently valid.
*
* @param int $row
* @param int $col[optional]
* @return bool
*/
function inRange($row, $col);
// Reduction
/**
* Remove the specified row from the matrix.
*
* @param int $row_idx
* @return void
*/
function shedRow($row_idx);
/**
* Remove the specified column from the matrix.
*
* @param int $col_idx
* @return void
*/
function shedCol($col_idx);
/**
* Remove the specified range of rows from the matrix.
*
* @param int $first_row
* @param int $last_row
* @return void
*/
function shedRows($first_row, $last_row);
/**
* Remove the specified range of columns from the matrix.
*
* @param int $first_col
* @param int $last_col
* @return void
*/
function shedCols($first_col, $last_col);
}