98 lines
2.3 KiB
PHP
98 lines
2.3 KiB
PHP
<?php
|
|
|
|
namespace Arma\Internal;
|
|
|
|
/**
|
|
* Interface for resizable (non-subview) matrices.
|
|
*
|
|
* @package Arma\Internal
|
|
*/
|
|
interface ResizableMatrix extends Resizable, Matrix
|
|
{
|
|
/**
|
|
* 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 void
|
|
*/
|
|
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 void
|
|
*/
|
|
function eye($n_rows, $n_cols);
|
|
|
|
// 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);
|
|
}
|