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/DenseResizableMatrix.php
2019-06-12 11:06:18 +08:00

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 $this
*/
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 $this
*/
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 $this
*/
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);
}