diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/toolboxes/FullBNT-1.0.7/KPMtools/subv2indTest.m	Tue Feb 10 15:05:51 2015 +0000
@@ -0,0 +1,15 @@
+function ndx = subv2indTest(siz,sub)
+%SUBV2IND   Linear index from subscript vector.
+% SUBV2IND(SIZ,SUB) returns an equivalent single index corresponding to a
+% subscript vector for an array of size SIZ.
+% If SUB is a matrix, with subscript vectors as rows, then the result is a 
+% column vector.
+%
+% This is the opposite of IND2SUBV, so that
+%   SUBV2IND(SIZ,IND2SUBV(SIZ,IND)) == IND.
+%
+% See also IND2SUBV, SUB2IND.
+
+ndx = subv2indMinka(siz,sub);
+ndx2 = subv2indKPM(siz,sub);
+assert(isequalKPM(ndx,ndx2))