Commit f04be18b authored by Alvarez, Gonzalo's avatar Alvarez, Gonzalo
Browse files

Ainur: reworked Matrices

parent b0dd7492
Loading
Loading
Loading
Loading
+15 −7
Original line number Diff line number Diff line
@@ -62,6 +62,7 @@ private:

};

//---------

boost::spirit::qi::rule<std::string::iterator,
std::vector<std::string>(),
@@ -91,6 +92,8 @@ void AinurState::assign(String k, String v)
	values_[x] = v;
}

//---------

template <typename T>
template <typename A, typename ContextType>
typename EnableIf<!TypesEqual<std::vector<std::vector<T> >, A>::True,void>::Type
@@ -102,13 +105,12 @@ AinurState::ActionMatrix<T>::operator()(A& attr,
	if (rows == 0) return;
	SizeType cols = attr[0].size();
	t_.resize(rows, cols);
	std::cerr<<"Here ActionMatrix type A neq type T\n";
	//	for (SizeType i = 0; i < rows; ++i) {
	//		if (attr[i].size() != cols)
	//			err("Ainur: Problem reading matrix\n");
	//		for (SizeType j = 0; j < cols; ++j)
	//			t_(i, j) = MyProxyFor<T, true>::toComplex(attr[i][j]);
	//	}
	for (SizeType i = 0; i < rows; ++i) {
		if (attr[i].size() != cols)
			err("Ainur: Problem reading matrix\n");
		for (SizeType j = 0; j < cols; ++j)
			MyProxyFor::convert(t_(i, j), attr[i][j]);
	}
}

template <typename T>
@@ -130,6 +132,8 @@ AinurState::ActionMatrix<T>::operator()(A& attr,
	}
}

//---------

template <typename T>
template <typename A, typename ContextType>
typename EnableIf<TypesEqual<A,T>::True,void>::Type
@@ -186,6 +190,8 @@ AinurState::Action<T>::operator()(A& attr,
		MyProxyFor::convert(t_[i], attr[i]);
}

//---------

template<typename T>
void AinurState::convertInternal(Matrix<T>& t,
                                 String value) const
@@ -251,6 +257,8 @@ void AinurState::convertInternal(std::vector<T>& t,
	}
}

//---------

template void AinurState::convertInternal(Matrix<DoubleOrFloatType>&,String) const;

template void AinurState::convertInternal(Matrix<std::complex<DoubleOrFloatType> >&,