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

131 lines
3.1 KiB
PHP
Raw Normal View History

2019-03-18 14:49:42 +00:00
<?php
namespace Arma\Internal;
2019-04-04 08:07:37 +00:00
use Arma\SortDirection;
2019-07-08 07:17:38 +00:00
use Arma\SvMat;
2019-04-04 08:07:37 +00:00
2019-03-26 11:54:58 +00:00
/**
2019-03-27 08:29:00 +00:00
* Interface for resizable (non-subview) dense matrices.
2019-03-26 11:54:58 +00:00
*
* @package Arma\Internal
*/
2019-03-18 14:49:42 +00:00
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]
2019-06-12 03:06:18 +00:00
* @return $this
2019-03-18 14:49:42 +00:00
*/
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
2019-06-12 03:06:18 +00:00
* @return $this
2019-03-18 14:49:42 +00:00
*/
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
2019-06-12 03:06:18 +00:00
* @return $this
2019-03-18 14:49:42 +00:00
*/
function randn($n_rows, $n_cols);
2019-03-21 10:49:11 +00:00
// 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 DenseMatrix|int $rows
* @param bool $set_to_zero[optional]
2019-03-21 10:49:11 +00:00
* @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 DenseMatrix|int $cols
* @param bool $set_to_zero[optional]
2019-03-21 10:49:11 +00:00
* @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
*/
2019-04-04 08:07:37 +00:00
function isSorted($sort_direction = SortDirection::ASCEND, $dim = 0);
2019-07-08 07:17:38 +00:00
// Subview
/**
* {@inheritdoc}
*
* @param int $n_cols
* @return SvMat
*/
function headCols($n_cols);
/**
* {@inheritdoc}
*
* @param int $n_rows
* @return SvMat
*/
function headRows($n_rows);
/**
* {@inheritdoc}
*
* @param int $n_cols
* @return SvMat
*/
function tailCols($n_cols);
/**
* {@inheritdoc}
*
* @param int $n_rows
* @return SvMat
*/
function tailRows($n_rows);
2019-03-18 14:49:42 +00:00
}