diff options
-rw-r--r-- | sc/source/core/opencl/op_financial.cxx | 43 | ||||
-rw-r--r-- | sc/source/core/opencl/opinlinefun_finacial.cxx | 3 |
2 files changed, 2 insertions, 44 deletions
diff --git a/sc/source/core/opencl/op_financial.cxx b/sc/source/core/opencl/op_financial.cxx index 71ea85837c1b..5c6da7893ff4 100644 --- a/sc/source/core/opencl/op_financial.cxx +++ b/sc/source/core/opencl/op_financial.cxx @@ -3205,57 +3205,18 @@ void OpPriceDisc::GenSlidingWindowFunction(std::stringstream &ss, ss<<" double tmp2=0;\n"; ss<<" double tmp3=0;\n"; ss<<" double tmp4=0;\n"; - size_t nItems = 0; ss <<" \n"; for (size_t i = 0; i < vSubArguments.size(); i++) { FormulaToken *pCur = vSubArguments[i]->GetFormulaToken(); assert(pCur); - if (pCur->GetType() == formula::svDoubleVectorRef) - { - const formula::DoubleVectorRefToken* pDVR = - dynamic_cast<const formula::DoubleVectorRefToken *>(pCur); - size_t nCurWindowSize = pDVR->GetRefRowSize(); - ss << " for (int i = "; - if (!pDVR->IsStartFixed() && pDVR->IsEndFixed()) { -#ifdef ISNAN - ss << "gid0; i < " << pDVR->GetArrayLength(); - ss << " && i < " << nCurWindowSize << "; i++){\n"; -#else - ss << "gid0; i < "<< nCurWindowSize << "; i++)\n"; -#endif - } else if (pDVR->IsStartFixed() && !pDVR->IsEndFixed()) { -#ifdef ISNAN - ss << "0; i < " << pDVR->GetArrayLength(); - ss << " && i < gid0+"<< nCurWindowSize << "; i++){\n"; -#else - ss << "0; i < gid0+"<< nCurWindowSize << "; i++)\n"; -#endif - } else if (!pDVR->IsStartFixed() && !pDVR->IsEndFixed()){ -#ifdef ISNAN - ss << "0; i + gid0 < " << pDVR->GetArrayLength(); - ss << " && i < "<< nCurWindowSize << "; i++){\n"; -#else - ss << "0; i < "<< nCurWindowSize << "; i++)\n"; -#endif - } - else { -#ifdef ISNAN - ss << "0; i < "<< nCurWindowSize << "; i++){\n"; -#else - ss << "0; i < "<< nCurWindowSize << "; i++)\n"; -#endif - } - nItems += nCurWindowSize; - } - else if (pCur->GetType() == formula::svSingleVectorRef) + if (pCur->GetType() == formula::svSingleVectorRef) { #ifdef ISNAN const formula::SingleVectorRefToken* pSVR = dynamic_cast< const formula::SingleVectorRefToken* >(pCur); ss << " if (gid0 < " << pSVR->GetArrayLength() << "){\n"; #else - nItems += 1; #endif } else if (pCur->GetType() == formula::svDouble) @@ -3263,13 +3224,11 @@ void OpPriceDisc::GenSlidingWindowFunction(std::stringstream &ss, #ifdef ISNAN ss << "{\n"; #endif - nItems += 1; } else { #ifdef ISNAN #endif - nItems += 1; } #ifdef ISNAN if(ocPush==vSubArguments[i]->GetFormulaToken()->GetOpCode()) diff --git a/sc/source/core/opencl/opinlinefun_finacial.cxx b/sc/source/core/opencl/opinlinefun_finacial.cxx index bb20802992dd..2b81df230ee2 100644 --- a/sc/source/core/opencl/opinlinefun_finacial.cxx +++ b/sc/source/core/opencl/opinlinefun_finacial.cxx @@ -1214,8 +1214,7 @@ std::string GetYearDiff= " int nTotalDays = GetDiffDate( nNullDate, nStartDate, nEndDate," "nMode, &" "nDays1stYear );\n" -" double result=(double)(nTotalDays)/(nDays1stYear);\n" -" return result;\n" +" return (double)(nTotalDays)*pow((double)nDays1stYear,-1);\n" "}\n"; std::string GetDiffDate360_Decl= |