Commit 87d0a1d215ff4a2356d935016cbe0e00a9fcf95b
1 parent
aabe886c
minor changes for NetMets
Showing
2 changed files
with
10 additions
and
9 deletions
Show diff stats
stim/biomodels/network.h
@@ -125,7 +125,9 @@ public: | @@ -125,7 +125,9 @@ public: | ||
125 | return V.size(); | 125 | return V.size(); |
126 | } | 126 | } |
127 | 127 | ||
128 | - std::vector<vertex> operator*(T s){ | 128 | + //scale the network by some constant value |
129 | + // I don't think these work?????? | ||
130 | + /*std::vector<vertex> operator*(T s){ | ||
129 | for (unsigned i=0; i< vertices; i ++ ){ | 131 | for (unsigned i=0; i< vertices; i ++ ){ |
130 | V[i] = V[i] * s; | 132 | V[i] = V[i] * s; |
131 | } | 133 | } |
@@ -139,10 +141,9 @@ public: | @@ -139,10 +141,9 @@ public: | ||
139 | } | 141 | } |
140 | } | 142 | } |
141 | return V; | 143 | return V; |
142 | - } | 144 | + }*/ |
143 | 145 | ||
144 | // Returns an average of branching index in the network | 146 | // Returns an average of branching index in the network |
145 | - | ||
146 | double BranchingIndex(){ | 147 | double BranchingIndex(){ |
147 | double B=0; | 148 | double B=0; |
148 | for(unsigned v=0; v < V.size(); v ++){ | 149 | for(unsigned v=0; v < V.size(); v ++){ |
@@ -154,7 +155,6 @@ public: | @@ -154,7 +155,6 @@ public: | ||
154 | } | 155 | } |
155 | 156 | ||
156 | // Returns number of branch points in thenetwork | 157 | // Returns number of branch points in thenetwork |
157 | - | ||
158 | unsigned int BranchP(){ | 158 | unsigned int BranchP(){ |
159 | unsigned int B=0; | 159 | unsigned int B=0; |
160 | unsigned int c; | 160 | unsigned int c; |
@@ -168,7 +168,6 @@ public: | @@ -168,7 +168,6 @@ public: | ||
168 | } | 168 | } |
169 | 169 | ||
170 | // Returns number of end points (tips) in thenetwork | 170 | // Returns number of end points (tips) in thenetwork |
171 | - | ||
172 | unsigned int EndP(){ | 171 | unsigned int EndP(){ |
173 | unsigned int B=0; | 172 | unsigned int B=0; |
174 | unsigned int c; | 173 | unsigned int c; |
@@ -202,7 +201,7 @@ public: | @@ -202,7 +201,7 @@ public: | ||
202 | // return s; | 201 | // return s; |
203 | //} | 202 | //} |
204 | 203 | ||
205 | - | 204 | + //Calculate Metrics--------------------------------------------------- |
206 | // Returns an average of fiber/edge lengths in the network | 205 | // Returns an average of fiber/edge lengths in the network |
207 | double Lengths(){ | 206 | double Lengths(){ |
208 | stim::vec<T> L; | 207 | stim::vec<T> L; |
@@ -270,8 +269,10 @@ public: | @@ -270,8 +269,10 @@ public: | ||
270 | double avg = sumFractDim / E.size(); | 269 | double avg = sumFractDim / E.size(); |
271 | return avg; | 270 | return avg; |
272 | } | 271 | } |
273 | - stim::cylinder<T> get_cylinder(unsigned f){ | ||
274 | - return E[f]; //return the specified edge (casting it to a fiber) | 272 | + |
273 | + //returns a cylinder represented a given fiber (based on edge index) | ||
274 | + stim::cylinder<T> get_cylinder(unsigned e){ | ||
275 | + return E[e]; //return the specified edge (casting it to a fiber) | ||
275 | } | 276 | } |
276 | 277 | ||
277 | //load a network from an OBJ file | 278 | //load a network from an OBJ file |
stim/math/vector.h
@@ -338,7 +338,7 @@ struct vec : public std::vector<T> | @@ -338,7 +338,7 @@ struct vec : public std::vector<T> | ||
338 | /// Cast to a vec3 | 338 | /// Cast to a vec3 |
339 | operator stim::vec3<T>(){ | 339 | operator stim::vec3<T>(){ |
340 | stim::vec3<T> r; | 340 | stim::vec3<T> r; |
341 | - size_t N = min(size(), (size_t)3); | 341 | + size_t N = std::min(size(), (size_t)3); |
342 | for(size_t i = 0; i < N; i++) | 342 | for(size_t i = 0; i < N; i++) |
343 | r[i] = at(i); | 343 | r[i] = at(i); |
344 | return r; | 344 | return r; |