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/Vector.php

98 lines
2.0 KiB
PHP
Raw Normal View History

2019-02-21 10:49:25 +00:00
<?php
2019-02-25 13:56:43 +00:00
namespace Arma\Internal;
2019-02-21 10:49:25 +00:00
2019-02-24 03:39:51 +00:00
/**
2019-03-12 10:14:12 +00:00
* Interface for vectors (Col, Row, SpCol and SpRow).
2019-02-24 03:39:51 +00:00
*
* @package Arma\Internal
*/
2019-03-08 14:15:02 +00:00
interface Vector
2019-02-21 10:49:25 +00:00
{
2019-03-12 10:14:12 +00:00
// Constructors
2019-02-22 01:54:21 +00:00
/**
* Construct the vector to have user specified size and fill with specified pattern.
*
2019-03-12 10:14:12 +00:00
* @param int $n_elem[optional]
2019-02-22 01:54:21 +00:00
* @param int $fill[optional]
* @return static
*/
static function init($n_elem, $fill);
2019-02-21 10:49:25 +00:00
2019-02-22 01:54:21 +00:00
/**
* Create the vector from a textual description.
*
* Elements should be separated by spaces.
*
* @param string $text
* @return static
*/
static function fromString($text);
/**
* Create the vector from a PHP array.
*
* @param array $arr
* @return static
*/
static function fromArray($arr);
2019-03-18 14:49:42 +00:00
// Vector subview
2019-03-12 10:14:12 +00:00
2019-02-24 03:39:51 +00:00
/**
2019-03-18 14:49:42 +00:00
* Read/write access to the n-th element.
2019-02-24 03:39:51 +00:00
*
2019-03-18 14:49:42 +00:00
* @param int $idx
2019-03-23 16:24:34 +00:00
* @return Scalar
2019-02-24 03:39:51 +00:00
*/
2019-03-27 08:29:00 +00:00
function __invoke($idx);
/**
* Read/write access to the n-th element.
*
* Without a bounds check. Not recommended for use unless your code has been thoroughly debugged.
*
* @param int $idx
* @return Scalar
*/
2019-03-18 14:49:42 +00:00
function at($idx);
2019-03-10 15:23:11 +00:00
/**
* Read/write access to a vector subview.
*
* @param int $first_idx
* @param int $last_idx
* @return Subview
*/
function subvec($first_idx, $last_idx);
/**
* Read/write access to first specified elements of a vector.
*
* @param int $n_elem
* @return Subview
*/
function head($n_elem);
/**
* Read/write access to last specified elements of a vector.
*
* @param int $n_elem
* @return Subview
*/
function tail($n_elem);
2019-03-21 10:49:11 +00:00
// Transform
/**
* Returns a transposed copy of the vector.
*
* For complex vectors, $conj indicates whether the conjugate of the elements is taken during the transpose.
*
* @param bool $conj[optional]
* @return Vector
*/
function t($conj = true);
2019-02-22 01:54:21 +00:00
}