Commit 358aff20 authored by Alvarez, Gonzalo's avatar Alvarez, Gonzalo
Browse files

split function deleted

The tokenizer function has the same functionality
that split had, but tokenizer is better implemented.
But the name tokenizer is bad in this context, and
split is better. We'll rename tokenizer in the future.
parent 3de65534
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -85,6 +85,7 @@ DISCLOSED WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS.
#include <stdexcept>
#include <algorithm>
#include <iostream>
#include "Tokenizer.h"

namespace PsimagLite {

@@ -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(),
+5 −33
Original line number Diff line number Diff line
@@ -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>
@@ -105,6 +105,10 @@ public:
	    : v1_(v1),v2_(v2)
	{}

	ClosureOperator(const T1& v1)
	    : v1_(v1),v2_(v1)
	{}

	const T1& v1_;
	const T2& v2_;
};
@@ -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)
{
@@ -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: