#include <kronecker.h>
|
static int | RemoveNodeNoise (PNGraph &Graph, const int &NNodes, const bool Random=true) |
| !!!!! MYUNGHWAN, CHECK! More...
|
|
static int | RemoveNodeNoise (PNGraph &Graph, const double &Rate, const bool Random=true) |
|
static int | FlipEdgeNoise (PNGraph &Graph, const int &NEdges, const bool Random=true) |
|
static int | FlipEdgeNoise (PNGraph &Graph, const double &Rate, const bool Random=true) |
|
static int | RemoveEdgeNoise (PNGraph &Graph, const int &NEdges) |
|
static int | RemoveEdgeNoise (PNGraph &Graph, const double &Rate) |
|
Definition at line 251 of file kronecker.h.
TKronNoise::TKronNoise |
( |
| ) |
|
|
inline |
int TKronNoise::FlipEdgeNoise |
( |
PNGraph & |
Graph, |
|
|
const int & |
NEdges, |
|
|
const bool |
Random = true |
|
) |
| |
|
static |
Definition at line 2229 of file kronecker.cpp.
2230 IAssert(NEdges > 0 && NEdges < Graph->GetEdges());
2232 const int Nodes = Graph->GetNodes();
2233 const int Edges = Graph->GetEdges();
2238 Graph->GetNIdV(NIdV);
2240 ToAdd.
Gen(NEdges / 2, 0);
2241 for(
int i = 0; i < NEdges / 2; i++) {
2244 if(Graph->IsEdge(Src, Dst)) { i--;
continue; }
2249 ToDel.
Gen(Edges, 0);
2251 ToDel.
Add(
TIntPr(EI.GetSrcNId(), EI.GetDstNId()));
2255 for(
int i = 0; i < NEdges / 2; i++) {
2256 Graph->DelEdge(ToDel[i].Val1, ToDel[i].Val2);
2257 Graph->AddEdge(ToAdd[i].Val1, ToAdd[i].Val2);
2260 return Graph->GetEdges();
TPair< TInt, TInt > TIntPr
Edge iterator. Only forward iteration (operator++) is supported.
void Shuffle(TRnd &Rnd)
Randomly shuffles the elements of the vector.
void Gen(const TSizeTy &_Vals)
Constructs a vector (an array) of _Vals elements.
int GetUniDevInt(const int &Range=0)
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
int TKronNoise::FlipEdgeNoise |
( |
PNGraph & |
Graph, |
|
|
const double & |
Rate, |
|
|
const bool |
Random = true |
|
) |
| |
|
static |
Definition at line 2263 of file kronecker.cpp.
2264 IAssert(Rate > 0 && Rate < 0.5);
static int FlipEdgeNoise(PNGraph &Graph, const int &NEdges, const bool Random=true)
int TKronNoise::RemoveEdgeNoise |
( |
PNGraph & |
Graph, |
|
|
const int & |
NEdges |
|
) |
| |
|
static |
Definition at line 2268 of file kronecker.cpp.
2269 IAssert(NEdges > 0 && NEdges < Graph->GetEdges());
2273 ToDel.
Gen(Graph->GetEdges(), 0);
2275 if(EI.GetSrcNId() != EI.GetDstNId()) {
2276 ToDel.
Add(
TIntPr(EI.GetSrcNId(), EI.GetDstNId()));
2281 for(
int i = 0; i < NEdges; i++) {
2282 Graph->DelEdge(ToDel[i].Val1, ToDel[i].Val2);
2285 return Graph->GetEdges();
TPair< TInt, TInt > TIntPr
Edge iterator. Only forward iteration (operator++) is supported.
void Shuffle(TRnd &Rnd)
Randomly shuffles the elements of the vector.
void Gen(const TSizeTy &_Vals)
Constructs a vector (an array) of _Vals elements.
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
int TKronNoise::RemoveEdgeNoise |
( |
PNGraph & |
Graph, |
|
|
const double & |
Rate |
|
) |
| |
|
static |
Definition at line 2288 of file kronecker.cpp.
2289 IAssert(Rate > 0 && Rate < 0.5);
static int RemoveEdgeNoise(PNGraph &Graph, const int &NEdges)
int TKronNoise::RemoveNodeNoise |
( |
PNGraph & |
Graph, |
|
|
const int & |
NNodes, |
|
|
const bool |
Random = true |
|
) |
| |
|
static |
!!!!! MYUNGHWAN, CHECK!
Definition at line 2204 of file kronecker.cpp.
2205 IAssert(NNodes > 0 && NNodes < (Graph->GetNodes() / 2));
2209 Graph->GetNIdV(ShufflePerm);
2212 for(i = 0; i < NNodes; i++) {
2213 Graph->DelNode(
int(ShufflePerm[i]));
2216 for(i = 0; i < NNodes; i++) {
2217 Graph->DelNode(
int(ShufflePerm[ShufflePerm.
Len() - 1 - i]));
2221 return Graph->GetNodes();
TSizeTy Len() const
Returns the number of elements in the vector.
void Shuffle(TRnd &Rnd)
Randomly shuffles the elements of the vector.
int TKronNoise::RemoveNodeNoise |
( |
PNGraph & |
Graph, |
|
|
const double & |
Rate, |
|
|
const bool |
Random = true |
|
) |
| |
|
static |
Definition at line 2224 of file kronecker.cpp.
2225 IAssert(Rate > 0 && Rate < 0.5);
static int RemoveNodeNoise(PNGraph &Graph, const int &NNodes, const bool Random=true)
!!!!! MYUNGHWAN, CHECK!
The documentation for this class was generated from the following files: