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.
2019-07-23 16:55:42 +00:00
|
|
|
--TEST--
|
|
|
|
Test for methods `fill()` and `imbue()`.
|
|
|
|
--SKIPIF--
|
|
|
|
<?php
|
|
|
|
require_once 'includes/loaded.php';
|
|
|
|
is_php_arma_loaded();
|
|
|
|
?>
|
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
|
|
|
|
require_once 'includes/assert.php';
|
|
|
|
|
|
|
|
$mat = Arma\IMat::init(2, 2, Arma\Fill::ZEROS);
|
|
|
|
|
|
|
|
$mat->fill(5);
|
|
|
|
batch_assert('method `fill()`',
|
|
|
|
[5, $mat->max()],
|
|
|
|
[5, $mat->min()]
|
|
|
|
);
|
|
|
|
|
|
|
|
$cnt = 0;
|
|
|
|
$mat1 = Arma\IMat::fromArray([
|
|
|
|
[1, 3],
|
|
|
|
[2, 4]
|
|
|
|
]);
|
|
|
|
$mat->imbue(function () use (&$cnt) {
|
|
|
|
return ++$cnt;
|
|
|
|
});
|
2019-07-28 16:28:46 +00:00
|
|
|
batch_assert_mat('method `imbue()`',
|
2019-07-23 16:55:42 +00:00
|
|
|
[$mat1, $mat]
|
|
|
|
);
|
|
|
|
|
|
|
|
?>
|
|
|
|
--EXPECT--
|