Cyclops Tensor Framework
parallel arithmetic on multidimensional arrays

code for maximal 2-independent set More...

Collaboration diagram for mis2:

Functions

Vector< float > mis2 (Matrix< float > &undir_A)
 
bool test_mis2 (int n, double sp_frac)
 
char * getCmdOption (char **begin, char **end, const std::string &option)
 
int main (int argc, char **argv)
 

Detailed Description

code for maximal 2-independent set

Function Documentation

char* getCmdOption ( char **  begin,
char **  end,
const std::string &  option 
)

Definition at line 141 of file mis2.cxx.

Referenced by main().

int main ( int  argc,
char **  argv 
)

Definition at line 152 of file mis2.cxx.

References getCmdOption(), ctf.core::np(), ctf.core::rank(), and test_mis2().

Vector<float> mis2 ( Matrix< float > &  undir_A)

compute a maximal 2-independent set of a graph with a given adjacency matrix (any pair of vertices in a 2-MIS should be at leasdt 3 edges apart

Parameters
[in]undir_Aadjacency matrix of undirected graph (symmetric, sparse with values A_{ij}=1.0 if (i,j) is in graph)
Returns
sparse vector v (v_i = 1.0 if vertex is in 2-independent set)

Definition at line 16 of file mis2.cxx.

References ctf.core::a, ctf.core::b, CTF::Pair< dtype >::d, CTF::Tensor< dtype >::get_local_pairs(), CTF::Pair< dtype >::k, CTF_int::tensor::nnz_tot, CTF::Matrix< dtype >::nrow, NS, CTF::World::rank, SH, SP, CTF::Tensor< dtype >::sparsify(), CTF::Matrix< dtype >::symm, ctf.core::w, CTF::Tensor< dtype >::write(), and CTF_int::tensor::wrld.

Referenced by test_mis2().

bool test_mis2 ( int  n,
double  sp_frac 
)