comparison toolboxes/FullBNT-1.0.7/KPMtools/subv2indTest.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:e9a9cd732c1e
1 function ndx = subv2indTest(siz,sub)
2 %SUBV2IND Linear index from subscript vector.
3 % SUBV2IND(SIZ,SUB) returns an equivalent single index corresponding to a
4 % subscript vector for an array of size SIZ.
5 % If SUB is a matrix, with subscript vectors as rows, then the result is a
6 % column vector.
7 %
8 % This is the opposite of IND2SUBV, so that
9 % SUBV2IND(SIZ,IND2SUBV(SIZ,IND)) == IND.
10 %
11 % See also IND2SUBV, SUB2IND.
12
13 ndx = subv2indMinka(siz,sub);
14 ndx2 = subv2indKPM(siz,sub);
15 assert(isequalKPM(ndx,ndx2))