96 lines
2.6 KiB
PHP
96 lines
2.6 KiB
PHP
<?php
|
|
|
|
namespace Arma\Internal;
|
|
|
|
use Arma\SortDirection;
|
|
|
|
/**
|
|
* Interface for resizable (non-subview) dense matrices.
|
|
*
|
|
* @package Arma\Internal
|
|
*/
|
|
interface DenseResizableMatrix extends DenseMatrix, ResizableMatrix
|
|
{
|
|
// Initialization
|
|
|
|
/**
|
|
* Set all the elements of an object to one, optionally first changing the size to specified dimensions.
|
|
*
|
|
* @param int $n_rows[optional]
|
|
* @param int $n_cols[optional]
|
|
* @return void
|
|
*/
|
|
function ones($n_rows, $n_cols);
|
|
|
|
/**
|
|
* Set all the elements to random values, optionally first changing the size to specified dimensions.
|
|
*
|
|
* Uses a uniform distribution in the [0,1] interval.
|
|
*
|
|
* @param int $n_rows
|
|
* @param int $n_cols
|
|
* @return void
|
|
*/
|
|
function randu($n_rows, $n_cols);
|
|
|
|
/**
|
|
* Set all the elements to random values, optionally first changing the size to specified dimensions.
|
|
*
|
|
* Uses a normal/Gaussian distribution with zero mean and unit variance.
|
|
*
|
|
* @param int $n_rows
|
|
* @param int $n_cols
|
|
* @return void
|
|
*/
|
|
function randn($n_rows, $n_cols);
|
|
|
|
// Insertion
|
|
|
|
/**
|
|
* At the given row index, insert given number of empty rows and optionally specify
|
|
* whether to initialize new elements to zero, or insert a copy of specified object
|
|
* (whose column size is the same as the recipient object),
|
|
*
|
|
* @param int $row_idx
|
|
* @param Dense|int $rows
|
|
* @param bool $set_to_zero[optional]
|
|
* @return void
|
|
*/
|
|
function insertRows($row_idx, $rows, $set_to_zero = true);
|
|
|
|
/**
|
|
* At the given column index, insert given number of empty columns and optionally specify
|
|
* whether to initialize new elements to zero, or insert a copy of specified object
|
|
* (whose row size is the same as the recipient object),
|
|
*
|
|
* @param int $col_idx
|
|
* @param Dense|int $cols
|
|
* @param bool $set_to_zero[optional]
|
|
* @return void
|
|
*/
|
|
function insertCols($col_idx, $cols, $set_to_zero = true);
|
|
|
|
// Swap
|
|
|
|
/**
|
|
* Swap contents with another matrix.
|
|
*
|
|
* @param DenseResizableMatrix $other
|
|
* @return void
|
|
*/
|
|
function swap($other);
|
|
|
|
// Characteristics
|
|
|
|
/**
|
|
* Check whether the matrix is sorted in each column (dim == 0) or each row (dim == 1).
|
|
*
|
|
* For matrices with complex numbers, order is checked via absolute values.
|
|
*
|
|
* @param int $sort_direction[optional]
|
|
* @param int $dim[optional]
|
|
* @return bool
|
|
*/
|
|
function isSorted($sort_direction = SortDirection::ASCEND, $dim = 0);
|
|
}
|