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 | 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 | 131 | for (unsigned i=0; i< vertices; i ++ ){ |
130 | 132 | V[i] = V[i] * s; |
131 | 133 | } |
... | ... | @@ -139,10 +141,9 @@ public: |
139 | 141 | } |
140 | 142 | } |
141 | 143 | return V; |
142 | - } | |
144 | + }*/ | |
143 | 145 | |
144 | 146 | // Returns an average of branching index in the network |
145 | - | |
146 | 147 | double BranchingIndex(){ |
147 | 148 | double B=0; |
148 | 149 | for(unsigned v=0; v < V.size(); v ++){ |
... | ... | @@ -154,7 +155,6 @@ public: |
154 | 155 | } |
155 | 156 | |
156 | 157 | // Returns number of branch points in thenetwork |
157 | - | |
158 | 158 | unsigned int BranchP(){ |
159 | 159 | unsigned int B=0; |
160 | 160 | unsigned int c; |
... | ... | @@ -168,7 +168,6 @@ public: |
168 | 168 | } |
169 | 169 | |
170 | 170 | // Returns number of end points (tips) in thenetwork |
171 | - | |
172 | 171 | unsigned int EndP(){ |
173 | 172 | unsigned int B=0; |
174 | 173 | unsigned int c; |
... | ... | @@ -202,7 +201,7 @@ public: |
202 | 201 | // return s; |
203 | 202 | //} |
204 | 203 | |
205 | - | |
204 | + //Calculate Metrics--------------------------------------------------- | |
206 | 205 | // Returns an average of fiber/edge lengths in the network |
207 | 206 | double Lengths(){ |
208 | 207 | stim::vec<T> L; |
... | ... | @@ -270,8 +269,10 @@ public: |
270 | 269 | double avg = sumFractDim / E.size(); |
271 | 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 | 278 | //load a network from an OBJ file | ... | ... |
stim/math/vector.h
... | ... | @@ -338,7 +338,7 @@ struct vec : public std::vector<T> |
338 | 338 | /// Cast to a vec3 |
339 | 339 | operator stim::vec3<T>(){ |
340 | 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 | 342 | for(size_t i = 0; i < N; i++) |
343 | 343 | r[i] = at(i); |
344 | 344 | return r; | ... | ... |