File tree Expand file tree Collapse file tree 2 files changed +14
-21
lines changed Expand file tree Collapse file tree 2 files changed +14
-21
lines changed Original file line number Diff line number Diff line change 17
17
/*** License: MPL v2.0 ***/
18
18
/***********************************************************/
19
19
20
- #ifndef __CXXGRAPH_DIRECTEDEDGE_H__
21
- #define __CXXGRAPH_DIRECTEDEDGE_H__
20
+ #ifndef CXXGRAPH_DIRECTEDEDGE_H
21
+ #define CXXGRAPH_DIRECTEDEDGE_H
22
22
23
23
#pragma once
24
24
25
25
#include "DirectedEdge_impl.hpp"
26
26
27
- #endif // __CXXGRAPH_DIRECTEDEDGE_H__
27
+ #endif // CXXGRAPH_DIRECTEDEDGE_H
Original file line number Diff line number Diff line change 31
31
namespace CXXGraph {
32
32
33
33
using std::make_shared;
34
- using std::make_unique;
35
34
36
35
template <typename T>
37
- Graph<T>::Graph() {
38
- /* Caching the adjacency matrix */
39
- cacheAdjMatrix ();
40
- cacheDegreeMatrix ();
41
- cacheLaplacianMatrix ();
42
- cacheTransitionMatrix ();
43
- }
36
+ Graph<T>::Graph()
37
+ : cachedAdjMatrix(Graph<T>::getAdjMatrix()),
38
+ cachedDegreeMatrix (Graph<T>::getDegreeMatrix()),
39
+ cachedLaplacianMatrix(Graph<T>::getLaplacianMatrix()),
40
+ cachedTransitionMatrix(Graph<T>::getTransitionMatrix()) {}
44
41
45
42
template <typename T>
46
- Graph<T>::Graph(const T_EdgeSet<T> &edgeSet) {
47
- for (auto edgeIt : edgeSet) {
48
- this ->edgeSet .insert (edgeIt);
49
- }
50
- /* Caching the adjacency matrix */
51
- cacheAdjMatrix ();
52
- cacheDegreeMatrix ();
53
- cacheLaplacianMatrix ();
54
- cacheTransitionMatrix ();
55
- }
43
+ Graph<T>::Graph(const T_EdgeSet<T> &edgeSetToCopy)
44
+ : edgeSet(edgeSetToCopy),
45
+ cachedAdjMatrix (Graph<T>::getAdjMatrix()),
46
+ cachedDegreeMatrix(Graph<T>::getDegreeMatrix()),
47
+ cachedLaplacianMatrix(Graph<T>::getLaplacianMatrix()),
48
+ cachedTransitionMatrix(Graph<T>::getTransitionMatrix()) {}
56
49
57
50
template <typename T>
58
51
const T_EdgeSet<T> &Graph<T>::getEdgeSet() const {
You can’t perform that action at this time.
0 commit comments