INGOR
|
Neighbor Node Sampling and Repeat algorithm. More...
#include <algo/NNSR.h>
Public Member Functions | |
ytNetwork * | NNSR_exec (Args *args) |
Performs the NNSR algorithm. | |
void | NNSR_setArgs (Args *args, NNSRWork *work) |
Sets the some params of Args to the NNSRWork instance. | |
int | NNSR_RandomWalk (int v, ytPCGraph *g, ytDoubleArray *paFreqs, ytDoubleArray *chFreqs, int size, int num, int *set, int setSize, int limit, int resetPosition, ytIntArray *W, ytDoubleArray *P, ytRNG *rng) |
Samples nodes by random walk. | |
int | NNSR_otoSampling (int i, int p, int MPI_size, int MPI_rank, int size, int num, int *set, int setSize, const double *oto, ytRNG *rng) |
Performs one-to-one sampling. | |
int | NNSR_nodeSampling (NNSRWork *work, int v, int *nodeSet, int nodeSetSize) |
Sampling nodes by random walk and one-to-one scores. | |
void | NNSR_collectData (Args *args, NNSRWork *work, int *nodeSet, int nodeSetSize) |
Collects the data of the selected nodes. | |
void | NNSR_shareNetwork (NNSRWork *work, double threshold) |
Shares a global network by collecting edges among processors. | |
Neighbor Node Sampling and Repeat algorithm.
See Neighbor Node Sampling and Repeat Algorithm for the usage of the algorithm.
Collects the data of the selected nodes.
This copies the samples of variables in nodeSet stored in NNSRWork::fullData, to Args::data given as work.
int NNSR_otoSampling | ( | int | i, |
int | p, | ||
int | MPI_size, | ||
int | MPI_rank, | ||
int | size, | ||
int | num, | ||
int * | set, | ||
int | setSize, | ||
const double * | oto, | ||
ytRNG * | rng | ||
) |
Performs one-to-one sampling.
i | index of the target node in this process such that i=0, 1, ..., args->subNodes - 1. | |
MPI_size | size of MPI processes. | |
size | maximum size of set (size of the array). | |
num | Number of nodes to sample. | |
[in,out] | set | |
setSize | current size of set . |
int NNSR_RandomWalk | ( | int | v, |
ytPCGraph * | g, | ||
ytDoubleArray * | paFreqs, | ||
ytDoubleArray * | chFreqs, | ||
int | size, | ||
int | num, | ||
int * | set, | ||
int | setSize, | ||
int | limit, | ||
int | resetPosition, | ||
ytIntArray * | W, | ||
ytDoubleArray * | P, | ||
ytRNG * | rng | ||
) |
Samples nodes by random walk.
g | global graph where we perform random walk. |
size | total (max) number of set. |
num | number of nodes to be sampled. |
set | |
resetPosition | if 1, reset the node position when the new node is selected. |
W | working array |
P | working array |
void NNSR_shareNetwork | ( | NNSRWork * | work, |
double | threshold | ||
) |
Shares a global network by collecting edges among processors.
work | |
threshold | cut off threshold for edges collected from processors. |