INGOR
Loading...
Searching...
No Matches
Public Member Functions | List of all members
NNSR Class Reference

Neighbor Node Sampling and Repeat algorithm. More...

#include <algo/NNSR.h>

Public Member Functions

ytNetworkNNSR_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.
 

Detailed Description

Neighbor Node Sampling and Repeat algorithm.

See Neighbor Node Sampling and Repeat Algorithm for the usage of the algorithm.

Member Function Documentation

◆ NNSR_collectData()

void NNSR_collectData ( Args args,
NNSRWork work,
int *  nodeSet,
int  nodeSetSize 
)

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.

Parameters
argsArgs instance.
workNNSRWork instance.
nodeSetset of node IDs to collect.
nodeSetSizesize of nodeSet.

◆ NNSR_exec()

ytNetwork * NNSR_exec ( Args args)

Performs the NNSR algorithm.

This performs the Neighbor Node Sampling and Repeat (NNSR) algorithm, that searches for the Bayesian network structure by the MPI-based parallel algorithm. Thus, this requires MPI.

Only the root rank returns the final result of the network estimation.

◆ NNSR_otoSampling()

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.

Parameters
iindex of the target node in this process such that i=0, 1, ..., args->subNodes - 1.
MPI_sizesize of MPI processes.
sizemaximum size of set (size of the array).
numNumber of nodes to sample.
[in,out]set
setSizecurrent size of set.

◆ NNSR_RandomWalk()

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.

Parameters
gglobal graph where we perform random walk.
sizetotal (max) number of set.
numnumber of nodes to be sampled.
set
resetPositionif 1, reset the node position when the new node is selected.
Wworking array
Pworking array

◆ NNSR_shareNetwork()

void NNSR_shareNetwork ( NNSRWork work,
double  threshold 
)

Shares a global network by collecting edges among processors.

Parameters
work
thresholdcut off threshold for edges collected from processors.

The documentation for this class was generated from the following file: