Loading src/Options.h +3 −2 Original line number Diff line number Diff line Loading @@ -85,6 +85,7 @@ DISCLOSED WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS. #include <stdexcept> #include <algorithm> #include <iostream> #include "Tokenizer.h" namespace PsimagLite { Loading @@ -104,10 +105,10 @@ public: : registeredOptions_(registeredOptions),mode_(mode) {} void set(Vector<String>::Type& optsThatAreSet,const String& opts) void set(Vector<String>::Type& optsThatAreSet,String opts) { if (mode_==DISABLED) return; split(optsThatAreSet,opts.c_str(),','); tokenizer(opts,optsThatAreSet,","); for (SizeType i=0;i<optsThatAreSet.size();i++) { bool b = (find(registeredOptions_.begin(), registeredOptions_.end(), Loading src/Vector.h +5 −33 Original line number Diff line number Diff line Loading @@ -93,7 +93,7 @@ vector<T2,A> operator*(const vector<vector<T1,A>,AA>& v1, struct ClosureOperations { enum {OP_PLUS,OP_MINUS,OP_MULT}; enum {OP_PLUS,OP_MINUS,OP_MULT,OP_DIVIDE,OP_CONJ}; }; template<typename T1, typename T2,int type> Loading @@ -105,6 +105,10 @@ public: : v1_(v1),v2_(v2) {} ClosureOperator(const T1& v1) : v1_(v1),v2_(v1) {} const T1& v1_; const T2& v2_; }; Loading Loading @@ -338,14 +342,6 @@ vector<T1,A> operator/=(vector<T1,A>& v, // end of closure template<typename T,typename A> vector<T,A> conj(vector<T,A>& v) { vector<T,A> w(v.size()); for (SizeType i=0;i<v.size();i++) w[i]=conj(v[i]); return w; } template<typename T,typename A> T scalarProduct(const vector<T,A>& v1, const vector<T,A>& v2) { Loading Loading @@ -452,30 +448,6 @@ sum(SomeVectorType& v) return tmp; } template<typename T,typename A> void split(std::vector<T,A>& v,const char* s1,char sep) { String buffer = ""; String s(s1); T tmp; for (SizeType i=0;i<s.length();i++) { if (s[i]==sep) { if (buffer=="") continue; IstringStream buffer2(buffer); buffer2 >> tmp; buffer=""; v.push_back(tmp); } else { buffer += s[i]; } } if (buffer=="") return; IstringStream buffer2(buffer); buffer2 >> tmp; buffer=""; v.push_back(tmp); } template<typename T> class IsPairLike { public: Loading Loading
src/Options.h +3 −2 Original line number Diff line number Diff line Loading @@ -85,6 +85,7 @@ DISCLOSED WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS. #include <stdexcept> #include <algorithm> #include <iostream> #include "Tokenizer.h" namespace PsimagLite { Loading @@ -104,10 +105,10 @@ public: : registeredOptions_(registeredOptions),mode_(mode) {} void set(Vector<String>::Type& optsThatAreSet,const String& opts) void set(Vector<String>::Type& optsThatAreSet,String opts) { if (mode_==DISABLED) return; split(optsThatAreSet,opts.c_str(),','); tokenizer(opts,optsThatAreSet,","); for (SizeType i=0;i<optsThatAreSet.size();i++) { bool b = (find(registeredOptions_.begin(), registeredOptions_.end(), Loading
src/Vector.h +5 −33 Original line number Diff line number Diff line Loading @@ -93,7 +93,7 @@ vector<T2,A> operator*(const vector<vector<T1,A>,AA>& v1, struct ClosureOperations { enum {OP_PLUS,OP_MINUS,OP_MULT}; enum {OP_PLUS,OP_MINUS,OP_MULT,OP_DIVIDE,OP_CONJ}; }; template<typename T1, typename T2,int type> Loading @@ -105,6 +105,10 @@ public: : v1_(v1),v2_(v2) {} ClosureOperator(const T1& v1) : v1_(v1),v2_(v1) {} const T1& v1_; const T2& v2_; }; Loading Loading @@ -338,14 +342,6 @@ vector<T1,A> operator/=(vector<T1,A>& v, // end of closure template<typename T,typename A> vector<T,A> conj(vector<T,A>& v) { vector<T,A> w(v.size()); for (SizeType i=0;i<v.size();i++) w[i]=conj(v[i]); return w; } template<typename T,typename A> T scalarProduct(const vector<T,A>& v1, const vector<T,A>& v2) { Loading Loading @@ -452,30 +448,6 @@ sum(SomeVectorType& v) return tmp; } template<typename T,typename A> void split(std::vector<T,A>& v,const char* s1,char sep) { String buffer = ""; String s(s1); T tmp; for (SizeType i=0;i<s.length();i++) { if (s[i]==sep) { if (buffer=="") continue; IstringStream buffer2(buffer); buffer2 >> tmp; buffer=""; v.push_back(tmp); } else { buffer += s[i]; } } if (buffer=="") return; IstringStream buffer2(buffer); buffer2 >> tmp; buffer=""; v.push_back(tmp); } template<typename T> class IsPairLike { public: Loading