diff --git a/nonclass.h b/nonclass.h index 8b99cdf..765ceb2 100644 --- a/nonclass.h +++ b/nonclass.h @@ -119,22 +119,25 @@ linear_solve(a,NULL,&det); return det; } -//general submatrix +//general submatrix, INDEX will typically be NRVec or even int* +//NOTE: in order to check consistency between nrows and rows in rows is a NRVec +//some advanced metaprogramming would be necessary + template -const NRMat::elementtype> submatrix(const MAT a, const INDEX rows, const INDEX cols, int indexshift=0, bool ignoresign=false) +const NRMat::elementtype> submatrix(const MAT a, const int nrows, const INDEX rows, const int ncols, const INDEX cols, int indexshift=0, bool ignoresign=false) { -NRMat::elementtype> r(rows.size(),cols.size()); +NRMat::elementtype> r(nrows,ncols); if(ignoresign) { -for(int i=0; i