42 lines
838 B
PHP
42 lines
838 B
PHP
<?php
|
|
|
|
namespace Arma\Internal;
|
|
|
|
/**
|
|
* Interface for resizable (non-subview) sparse vectors.
|
|
*
|
|
* @package Arma\Internal
|
|
*/
|
|
interface SparseResizableVector extends SparseVector, ResizableVector
|
|
{
|
|
/**
|
|
* Construct the vector to have user specified size and fill with specified pattern.
|
|
*
|
|
* $density should be specified when filling the vector with random values.
|
|
*
|
|
* @param int $n_elem[optional]
|
|
* @param int $fill[optional]
|
|
* @param double $density[optional]
|
|
* @return static
|
|
*/
|
|
static function init($n_elem, $fill, $density);
|
|
|
|
/// Subview
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*
|
|
* @param int $idx
|
|
* @return SpMapVal
|
|
*/
|
|
function __invoke($idx);
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*
|
|
* @param int $idx
|
|
* @return SpMapVal
|
|
*/
|
|
function at($idx);
|
|
}
|