update stubs

This commit is contained in:
CismonX 2019-02-24 17:01:11 +08:00
parent 58179a6d71
commit 9e5a1925b3
2 changed files with 43 additions and 4 deletions

View File

@ -100,4 +100,42 @@ interface Common
* @return void
*/
function copySize($other);
/**
* For all elements equal to $old_value, set them to $new_value.
*
* For SpMat, replacement is not done when $old_value == 0.
*
* @param number|\Arma\Complex $old_value
* @param number|\Arma\Complex $new_value
* @return void
*/
function replace($old_value, $new_value);
/**
* Transform each element using a callback function.
*
* Transformation is done column-by-column, and for SpMat only non-zero elements will be transformed.
*
* @param callable $callback ($old_value) => $new_value
* @return void
*/
function transform($callback);
/**
* For each element, pass its reference to a callback function.
*
* Processing is done column-by-column, and for SpMat only non-zero elements will be passed to callback.
*
* @param callable $callback
* @return void
*/
function forEach($callback);
/**
* Reset the size to zero. The object will have no elements.
*
* @return void
*/
function reset();
}

View File

@ -67,9 +67,10 @@ interface Dense extends Common
function notSmallerThan($other);
/**
* Sets the elements to a specified value.
* Sets the elements to a specified value. The type of value must match the type of elements used by
* the container object.
*
* The type of value must match the type of elements used by the container object.
* For matrices, filling is done column-by-column.
*
* @param number|\Arma\Complex $value
* @return void
@ -77,11 +78,11 @@ interface Dense extends Common
function fill($value);
/**
* Fill with values provided by a functor or lambda function.
* Fill with values provided by a callback function.
*
* For matrices, filling is done column-by-column.
*
* @param callable $callback
* @param callable $callback () => $fill_value
* @return void
*/
function imbue($callback);