rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
regular_submatrix_indices.m
1 function indices = regular_submatrix_indices(M,epsilon)
2 %function indices = regular_submatrix:indices(M,epsilon)
3 %
4 % function determining the indices of a submatrix of the square
5 % matrix M, such that M(indices,indices) is a regular matrix with
6 % determinant larger
7 % than epsilon. For this, simple matrix-growing is performed
8 % starting with the left upper element. If
9 % addition of a row/column leads to too-small determinant, this is skipped.
10 %
11 % this routine can be applied on gram-matrices to detect linear
12 % independent vectors.
13 
14 % Bernard Haasdonk 14.11.2007
15 
16 indices = 1;
17 
18 for j = 2:size(M,1);
19  ind_new = [indices, j];
20  B = M(ind_new,ind_new);
21  if abs(det(B))>=epsilon
22  % add j row/column
23  indices = ind_new;
24  end
25 end
26 
27 % TO BE ADJUSTED TO NEW SYNTAX
28 %| \docupdate