Commit 6a767e83 authored by Administrator's avatar Administrator Committed by Florian Uhlig
Browse files

Fix linker problem with template function

The implementation of the function was in the source file. Since the
function was also used in a qa class no code code be created at that
place. This results in a missing symbol during linking.
Put the template code properly in the header solves the problem.
parent 6c11aca6
......@@ -801,21 +801,6 @@ CbmLitFieldFitter::CbmLitFieldFitter(unsigned int polynomDegree)
CbmLitFieldFitter::~CbmLitFieldFitter() {}
template<class T>
void CbmLitFieldFitter::FitSlice(float Z, lit::parallel::LitFieldSlice<T>& slice)
{
std::vector<double> aparBx, aparBy, aparBz;
FitSlice(Z, aparBx, aparBy, aparBz);
std::vector<T> aparBxT, aparByT, aparBzT;
aparBxT.assign(aparBx.begin(), aparBx.end());
aparByT.assign(aparBy.begin(), aparBy.end());
aparBzT.assign(aparBz.begin(), aparBz.end());
slice.SetZ(Z);
slice.SetCoefficients(aparBxT, aparByT, aparBzT);
}
void CbmLitFieldFitter::FitSliceScal(float Z, lit::parallel::LitFieldSlice<fscal>& slice) { FitSlice<fscal>(Z, slice); }
void CbmLitFieldFitter::FitSliceVec(float Z, lit::parallel::LitFieldSlice<fvec>& slice) { FitSlice<fvec>(Z, slice); }
......
......@@ -81,7 +81,19 @@ public:
* \param[out] slice Output approximated field slice.
*/
template<class T>
void FitSlice(float Z, lit::parallel::LitFieldSlice<T>& slice);
void FitSlice(float Z, lit::parallel::LitFieldSlice<T>& slice)
{
std::vector<double> aparBx, aparBy, aparBz;
FitSlice(Z, aparBx, aparBy, aparBz);
std::vector<T> aparBxT, aparByT, aparBzT;
aparBxT.assign(aparBx.begin(), aparBx.end());
aparByT.assign(aparBy.begin(), aparBy.end());
aparBzT.assign(aparBz.begin(), aparBz.end());
slice.SetZ(Z);
slice.SetCoefficients(aparBxT, aparByT, aparBzT);
}
/**
* \brief FitSlice implementation using fscal data type.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment