mirror of
https://github.com/revarbat/BOSL2.git
synced 2025-08-26 07:24:27 +02:00
Merge pull request #229 from adrianVmariano/master
move submatrix to arrays and relax input restrictions
This commit is contained in:
@@ -853,22 +853,6 @@ module test_real_roots(){
|
||||
}
|
||||
test_real_roots();
|
||||
|
||||
// Need decision about behavior for out of bounds ranges, empty ranges
|
||||
module test_submatrix(){
|
||||
M = [[1,2,3,4,5],
|
||||
[6,7,8,9,10],
|
||||
[11,12,13,14,15],
|
||||
[16,17,18,19,20],
|
||||
[21,22,23,24,25]];
|
||||
assert_equal(submatrix(M,[1:2], [3:4]), [[9,10],[14,15]]);
|
||||
assert_equal(submatrix(M,[1], [3,4]), [[9,10]]);
|
||||
assert_equal(submatrix(M,1, [3,4]), [[9,10]]);
|
||||
assert_equal(submatrix(M, [3,4],1), [[17],[22]]);
|
||||
assert_equal(submatrix(M, [1,3],[2,4]), [[8,10],[18,20]]);
|
||||
}
|
||||
test_submatrix();
|
||||
|
||||
|
||||
|
||||
module test_qr_factor() {
|
||||
// Check that R is upper triangular
|
||||
|
Reference in New Issue
Block a user