From 87d0a1d215ff4a2356d935016cbe0e00a9fcf95b Mon Sep 17 00:00:00 2001 From: David Date: Mon, 21 Nov 2016 15:32:59 -0600 Subject: [PATCH] minor changes for NetMets --- stim/biomodels/network.h | 17 +++++++++-------- stim/math/vector.h | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/stim/biomodels/network.h b/stim/biomodels/network.h index 868659a..8741920 100644 --- a/stim/biomodels/network.h +++ b/stim/biomodels/network.h @@ -125,7 +125,9 @@ public: return V.size(); } - std::vector operator*(T s){ + //scale the network by some constant value + // I don't think these work?????? + /*std::vector operator*(T s){ for (unsigned i=0; i< vertices; i ++ ){ V[i] = V[i] * s; } @@ -139,10 +141,9 @@ public: } } return V; - } + }*/ // Returns an average of branching index in the network - double BranchingIndex(){ double B=0; for(unsigned v=0; v < V.size(); v ++){ @@ -154,7 +155,6 @@ public: } // Returns number of branch points in thenetwork - unsigned int BranchP(){ unsigned int B=0; unsigned int c; @@ -168,7 +168,6 @@ public: } // Returns number of end points (tips) in thenetwork - unsigned int EndP(){ unsigned int B=0; unsigned int c; @@ -202,7 +201,7 @@ public: // return s; //} - + //Calculate Metrics--------------------------------------------------- // Returns an average of fiber/edge lengths in the network double Lengths(){ stim::vec L; @@ -270,8 +269,10 @@ public: double avg = sumFractDim / E.size(); return avg; } - stim::cylinder get_cylinder(unsigned f){ - return E[f]; //return the specified edge (casting it to a fiber) + + //returns a cylinder represented a given fiber (based on edge index) + stim::cylinder get_cylinder(unsigned e){ + return E[e]; //return the specified edge (casting it to a fiber) } //load a network from an OBJ file diff --git a/stim/math/vector.h b/stim/math/vector.h index d1b90f7..da345fd 100644 --- a/stim/math/vector.h +++ b/stim/math/vector.h @@ -338,7 +338,7 @@ struct vec : public std::vector /// Cast to a vec3 operator stim::vec3(){ stim::vec3 r; - size_t N = min(size(), (size_t)3); + size_t N = std::min(size(), (size_t)3); for(size_t i = 0; i < N; i++) r[i] = at(i); return r; -- libgit2 0.21.4