From eb30339334a34b0838fd038914032391658db4f2 Mon Sep 17 00:00:00 2001 From: David Mayerich Date: Tue, 8 Sep 2015 16:23:11 -0500 Subject: [PATCH] updates to the stim::vec class --- stim/math/vector.h | 5 +++-- stim/visualization/obj.h | 17 ++++++----------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/stim/math/vector.h b/stim/math/vector.h index 43b5e14..b2a7db7 100644 --- a/stim/math/vector.h +++ b/stim/math/vector.h @@ -69,8 +69,9 @@ struct vec : public std::vector //copy constructor vec( const vec& other){ unsigned int N = other.size(); - for(unsigned int i=0; i #include #include +#include namespace stim{ @@ -572,8 +573,6 @@ public: std::vector< stim::vec > v; v.resize(vi.size()); //pre-allocate an array of vertices - std::cout<<"stim::obj::getV: "< > vt; vt.resize(vti.size()); //pre-allocate an array of vertices - std::cout<<"stim::obj::getV: "< > vn; vn.resize(vni.size()); //pre-allocate an array of vertices - std::cout<<"stim::obj::getV: "< > v){ + void getLine(unsigned l, std::vector< stim::vec >& v){ std::vector vi; //create a vector to store indices to vertices getLinei(l, vi); //get the indices for the line vertices v = getV(vi); //get the vertices corresponding to the indices } - void getLine(unsigned l, std::vector< stim::vec > v, std::vector< stim::vec > vt){ + void getLine(unsigned l, std::vector< stim::vec >& v, std::vector< stim::vec >& vt){ std::vector vi, vti; getLinei(l, vi, vti); //get the indices for the line vertices @@ -809,9 +804,9 @@ public: vt = getVT(vti); } - void getLine(unsigned l, std::vector< stim::vec > v, - std::vector< stim::vec > vt, - std::vector< stim::vec > vn){ + void getLine(unsigned l, std::vector< stim::vec >& v, + std::vector< stim::vec >& vt, + std::vector< stim::vec >& vn){ std::vector vi, vti, vni; getLinei(l, vi, vti, vni); //get the indices for the line vertices -- libgit2 0.21.4