Moved submatrix to arrays.scad and relaxed requirement for numerical

input.  Added examples and tests.
This commit is contained in:
Adrian Mariano
2020-08-03 19:49:22 -04:00
parent a05509dc6d
commit 4e36eacca8
4 changed files with 51 additions and 28 deletions

View File

@@ -708,18 +708,6 @@ function matrix_inverse(A) =
linear_solve(A,ident(len(A)));
// Function: submatrix()
// Usage: submatrix(M, ind1, ind2)
// Description:
// Returns a submatrix with the specified index ranges or index sets.
function submatrix(M,ind1,ind2) =
assert( is_matrix(M), "Input must be a matrix." )
[for(i=ind1)
[for(j=ind2)
assert( ! is_undef(M[i][j]), "Invalid indexing." )
M[i][j] ] ];
// Function: qr_factor()
// Usage: qr = qr_factor(A)
// Description: