MCPcopy Create free account
hub / github.com/DeepGraphLearning/graphvite / scatter

Method scatter

include/base/memory.h:208–217  ·  view source on GitHub ↗

Scatter data to a pool according to an index mapping */

Source from the content-addressed store, hash-verified

206
207 /** Scatter data to a pool according to an index mapping */
208 void scatter(std::vector<Data> &memory, const std::vector<Index> &mapping) {
209 if (!mapping.empty()) {
210 for (Index i = 0; i < count; i++)
211 memory[mapping[i]] = host_ptr[i];
212 }
213 else {
214 for (Index i = 0; i < count; i++)
215 memory[i] = host_ptr[i];
216 }
217 }
218
219 /** Scatter data to a pool by addition, according to an index mapping */
220 void scatter_add(std::vector<Data> &memory, const std::vector<Index> &mapping) {

Callers 4

visualizationMethod · 0.80
render_hierarchyFunction · 0.80
render_animationFunction · 0.80
write_embeddingMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected