Merge pull request #229 from adrianVmariano/master

move submatrix to arrays and relax input restrictions
This commit is contained in:
Revar Desmera
2020-08-04 00:38:23 -07:00
committed by GitHub
4 changed files with 53 additions and 29 deletions

View File

@@ -716,18 +716,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: