@@ -137,18 +137,17 @@ void CrossMap( SimplexClass & S,
137137 }
138138
139139 // Note that the embedding has NPartial invalid rows
140- // since the partial data vectors were not removed.
141- // Set library index limits for RNG
142- size_t N_row = S.embedding .NRows () - NPartial;
143- int RNGStart = 0 ;
144- int RNGStop;
145-
146- if ( S.parameters .tau > 0 ) {
147- RNGStop = *( end ( S.allLibRows .Row ( 0 ) ) - 1 );
148- }
149- else {
150- RNGStop = S.embedding .NRows () - NPartial - 1 ;
151- }
140+ // since partial data vectors were not removed.
141+ size_t N_row = S.embedding .NRows () - NPartial;
142+
143+ // Set index limits for RNG random library samples.
144+ // Note that allLibRows is a vector of lib indices into the embedding.
145+ // allLibRows defines the library. These indices will not start
146+ // at 0 and end at N_row - 1 if tau is non zero.
147+ // In CCM, the library is the entire lib domain allowed by tau and Tp.
148+ // Random library samples are selected from allLibRows.
149+ int RNGStart = 0 ;
150+ int RNGStop = (int ) S.allLibRows .NColumns () - 1 ;
152151
153152 // -----------------------------------------------------------------
154153 // Set number of samples
@@ -191,9 +190,8 @@ void CrossMap( SimplexClass & S,
191190
192191 size_t libSize = S.parameters .librarySizes [ libSize_i ];
193192
194- // Create RNG sampler for this libSize out of N_row
195- std::uniform_int_distribution< size_t >
196- distribution ( RNGStart, RNGStop );
193+ // Create RNG sampler into allLibRows for this libSize
194+ std::uniform_int_distribution< size_t > distribution (RNGStart, RNGStop);
197195
198196#ifdef DEBUG_ALL
199197 {
0 commit comments