public NetworkSample(Network network, ISimilarityStrategy ss, IRepresentativenessStrategy rs, bool weightedDegree) { this.network = network; this.SimilarityStrategy = ss; this.RepresentativenessStrategy = rs; this.Representatives = new Dictionary <Vertex, Representative>(); }
public AdjacencyMatrixSample(bool isDirected, ISimilarityStrategy ss, IRepresentativenessStrategy rs) { this.IsDirected = isDirected; this.SimilarityStrategy = ss; this.RepresentativenessStrategy = rs; this.N = 0; this.adjacencyMatrix = new SparseMatrix <double>(0); }
public AdjacencyMatrixSample(ref double[][] adjacencyMatrix, bool isDirected, ISimilarityStrategy ss, IRepresentativenessStrategy rs) { this.IsDirected = isDirected; this.SimilarityStrategy = ss; this.RepresentativenessStrategy = rs; this.N = adjacencyMatrix.Length; this.adjacencyMatrix = new SparseMatrix <double>(0); for (int i = 0; i < this.N; i++) { for (int j = 0; j < this.N; j++) { if (i != j) { this.adjacencyMatrix.SetValue(i, j, adjacencyMatrix[i][j]); this.adjacencyMatrix.SetValue(j, i, adjacencyMatrix[j][i]); } } } }