about summary refs log tree commit diff
path: root/sourcecodes/bnt-master/KPMtools/subv2indTest.m
blob: e64ab947a5a46470cc4ca0edd9183ca0303d6574 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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))