37 lines
762 B
PHP
37 lines
762 B
PHP
--TEST--
|
|
Test for methods `insertRows()` and `insertCols()`.
|
|
--SKIPIF--
|
|
<?php
|
|
require_once 'includes/loaded.php';
|
|
is_php_arma_loaded();
|
|
?>
|
|
--FILE--
|
|
<?php
|
|
|
|
require_once 'includes/assert.php';
|
|
|
|
$mat = Arma\IMat::init(3, 3, Arma\Fill::RANDN);
|
|
$rows = Arma\Imat::init(2, 3, Arma\Fill::RANDN);
|
|
$cols = Arma\Imat::init(5, 2, Arma\Fill::RANDN);
|
|
|
|
$mat->insertRows(1, $rows);
|
|
batch_assert('method `insertRows()`',
|
|
[5, $mat->nRows()],
|
|
[3, $mat->nCols()]
|
|
);
|
|
batch_assert_mat('method `insertRows()`',
|
|
[$rows->rows(0, 1), $mat->rows(1, 2)]
|
|
);
|
|
|
|
$mat->insertCols(2, $cols);
|
|
batch_assert('method `insertCols()`',
|
|
[5, $mat->nRows()],
|
|
[5, $mat->nCols()]
|
|
);
|
|
batch_assert_mat('method `insertCols()`',
|
|
[$cols->cols(0, 1), $mat->cols(2, 3)]
|
|
);
|
|
|
|
?>
|
|
--EXPECT--
|