28 ss <<
" double tmp;\n";
29 ss <<
" int gid0 = get_global_id(0);\n";
33 ss <<
" if ( nper <= 0.0 || pv == 0 )\n";
34 ss <<
" return CreateDoubleError(IllegalArgument);\n";
35 ss <<
" tmp = pow(fv/pv,1.0/nper)-1;\n";
36 ss <<
" return tmp;\n";
46 ss <<
"int gid0 = get_global_id(0);\n\t";
49 ss <<
"double tmp = 0;\n\t";
50 ss<<
"if(tmp1==0)\n\t";
51 ss<<
"\treturn 0;\n\t";
52 ss<<
"tmp= 1.0 / tmp1;\n\t";
53 ss<<
"tmp=( pow( tmp0+ 1.0, tmp ) - 1.0 ) *";
55 ss <<
"return tmp;\n";
65 ss <<
"double tmp = " <<
GetBottom() <<
";\n\t";
66 ss <<
"int gid0 = get_global_id(0);\n\t";
67 ss <<
"double fInt = " <<
GetBottom() <<
";\n\t";
70 ss <<
"fFrac = (int)fFrac;\n\t";
71 ss <<
"tmp = modf( dollar , &fInt );\n\t";
72 ss <<
"tmp /= fFrac;\n\t";
73 ss <<
"tmp *= pow( 10.0 , ceil( log10(fFrac ) ) );\n\t";
74 ss <<
"tmp += fInt;\t";
75 ss <<
"\n\treturn tmp;\n";
80 const std::string &sSymName,
SubArguments &vSubArguments)
85 ss <<
"double tmp = " <<
GetBottom() <<
";\n\t";
86 ss <<
"int gid0 = get_global_id(0);\n\t";
87 ss <<
"double fInt = " <<
GetBottom() <<
";\n\t";
90 ss <<
"fFrac = (int)fFrac;\n\t";
91 ss <<
"tmp = modf( dollar , &fInt );\n\t";
92 ss <<
"tmp *= fFrac;\n\t";
93 ss <<
"tmp *= pow( 10.0 , -ceil( log10(fFrac ) ) );\n\t";
94 ss <<
"tmp += fInt;\t";
95 ss <<
"\n\treturn tmp;\n";
100 std::set<std::string>& funs)
109 const std::string &sSymName,
SubArguments& vSubArguments)
114 ss <<
" double tmp = " <<
GetBottom() <<
";\n";
115 ss <<
" int gid0 = get_global_id(0);\n";
121 ss <<
" int nNullDate = 693594;\n";
122 ss <<
" tmp = 1.0 - arg2 / arg3;\n";
124 ss <<
" GetYearFrac(nNullDate, (int)arg0, (int)arg1, (int)arg4);\n";
125 ss <<
" return tmp;\n";
130 std::set<std::string>& funs)
143 const std::string &sSymName,
SubArguments& vSubArguments)
148 ss <<
" double tmp = " <<
GetBottom() <<
";\n";
149 ss <<
" int gid0 = get_global_id(0);\n";
155 ss <<
" int nNullDate = GetNullDate();\n";
156 ss <<
" tmp = ((arg3 / arg2) - 1) / GetYearDiff(nNullDate, (int)arg0,";
157 ss <<
" (int)arg1,(int)arg4);\n";
158 ss <<
" return tmp;\n";
163 std::set<std::string>& funs)
170 const std::string &sSymName,
SubArguments& vSubArguments)
175 ss <<
" double tmp = " <<
GetBottom() <<
";\n";
176 ss <<
" int gid0 = get_global_id(0);\n";
182 ss <<
" tmp = GetFV(arg0, arg1, arg2, arg3, arg4);\n";
183 ss <<
" return tmp;\n";
188 std::set<std::string>& funs)
199 const std::string &sSymName,
SubArguments& vSubArguments)
204 ss <<
" double tmp = " <<
GetBottom() <<
";\n";
205 ss <<
" int gid0 = get_global_id(0);\n";
212 ss <<
" if (fPer < 1.0 || fPer > fNper)\n";
213 ss <<
" return CreateDoubleError(IllegalArgument);\n";
216 ss <<
" double fPmt;\n";
217 ss <<
" return GetIpmt(fRate, fPer, fNper, fPv, fFv, fPayInAdvance != 0, &fPmt);\n";
222 const std::string &sSymName,
SubArguments& vSubArguments)
227 ss <<
" double tmp = " <<
GetBottom() <<
";\n";
228 ss <<
" int gid0 = get_global_id(0);\n";
233 ss <<
" tmp = arg3 * arg0 * ( arg1 - arg2) / arg2;\n";
234 ss <<
" return tmp;\n";
239 const std::string &sSymName,
SubArguments& vSubArguments)
244 ss <<
" double tmp = " <<
GetBottom() <<
";\n";
245 ss <<
" int gid0 = get_global_id(0);\n";
249 ss <<
" if ( arg0 <= 0.0 || arg1 <= 0.0 || arg2 <= 0.0 )\n";
250 ss <<
" return CreateDoubleError(IllegalArgument);\n";
251 ss <<
" tmp = log(arg2 / arg1) / log1p(arg0);\n";
252 ss <<
" return tmp;\n";
257 std::set<std::string>& funs)
270 const std::string &sSymName,
SubArguments& vSubArguments)
275 ss <<
" double tmp = " <<
GetBottom() <<
";\n";
276 ss <<
" int gid0 = get_global_id(0);\n";
283 ss <<
" int nNullDate = GetNullDate();\n";
284 ss <<
" tmp = GetDuration( nNullDate, (int)arg0, (int)arg1, arg2,";
285 ss <<
" arg3, (int)arg4, (int)arg5);\n";
286 ss <<
" return tmp;\n";
290 std::set<std::string>& funs)
305 const std::string &sSymName,
SubArguments& vSubArguments)
310 ss <<
" double tmp = " <<
GetBottom() <<
";\n";
311 ss <<
" int gid0 = get_global_id(0);\n";
318 ss <<
" int nNullDate = 693594;\n";
319 ss <<
" tmp = GetDuration( nNullDate, (int)arg0, (int)arg1, arg2,";
320 ss <<
" arg3, (int)arg4, (int)arg5);\n";
321 ss <<
" tmp = tmp * pow(1.0 + arg3 * pow((int)arg4, -1.0), -1);\n";
322 ss <<
" return tmp;\n";
331 ss <<
"double tmp = 1.0;\n\t";
332 ss <<
"int gid0 = get_global_id(0);\n";
339 ss <<
"return (double)tmp * arg0";
343 std::set<std::string>& funs)
355 ss <<
" int gid0 = get_global_id(0);\n";
357 GenerateArg(
"fNumPeriouds", 1, vSubArguments, ss );
362 ss <<
" int nNumPeriods = (int)fNumPeriods;\n";
363 ss <<
" int nStartPer = (int)fStartPer;\n";
364 ss <<
" int nEndPer = (int)fEndPer;\n";
365 ss <<
" int nPayType = (int)fPayType;\n";
366 ss <<
" double fPmt;\n";
367 ss <<
" fPmt = GetPMT( fRate, nNumPeriods, fVal, 0.0, nPayType != 0 );\n";
368 ss <<
" double tmp = 0.0;\n";
369 ss <<
" if( nStartPer == 1 )\n";
371 ss <<
" if( nPayType <= 0 )\n";
372 ss <<
" tmp = -fVal;\n";
373 ss <<
" nStartPer++;\n";
375 ss <<
" for( ; nStartPer<= nEndPer ; nStartPer++ )\n";
377 ss <<
" if( nPayType > 0 )\n";
378 ss <<
" tmp += GetFV( fRate, nStartPer - 2 , ";
379 ss <<
"fPmt, fVal, 1 ) - fPmt;\n";
381 ss <<
" tmp += GetFV( fRate, nStartPer - 1 , ";
382 ss <<
"fPmt, fVal, 0 );\n";
384 ss <<
" tmp *= fRate;\n";
385 ss <<
" return tmp;\n";
390 const std::string &sSymName,
SubArguments &vSubArguments)
396 ss <<
" #define Epsilon 1.0E-7\n";
397 ss <<
" int gid0 = get_global_id(0);\n";
399 ss <<
" double fEps = 1.0;\n";
400 ss <<
" double xNew = 0.0, fNumerator = 0.0, fDenominator = 0.0;\n";
401 ss <<
" double nCount = 0.0;\n";
402 ss <<
" unsigned short nItCount = 0;\n";
403 ss <<
" double x = fEstimated;\n";
404 ss <<
" while (fEps > Epsilon && nItCount < 20)\n";
406 ss <<
" nCount = 0.0; fNumerator = 0.0; fDenominator = 0.0;\n";
408 " fNumerator += arg / pow(1.0 + x, nCount);\n"
409 " fDenominator+=-1*nCount*arg/pow(1.0+x,nCount+1.0);\n"
412 ss <<
" xNew = x - fNumerator / fDenominator;\n";
413 ss <<
" fEps = fabs(xNew - x);\n";
414 ss <<
" x = xNew;\n";
415 ss <<
" nItCount++;\n";
417 ss <<
" if (fEstimated == 0.0 && fabs(x) < Epsilon)\n";
419 ss <<
" if (fEps < Epsilon)\n";
420 ss <<
" return x;\n";
422 ss <<
" return CreateDoubleError(NoConvergence);\n";
434 ss <<
" double result = 0.0;\n";
435 ss <<
" int gid0 = get_global_id(0);\n";
439 " result += arg1/(pow((rate+1),(arg2-dateNull)/365));\n"
441 ss <<
" return result;\n";
446 std::set<std::string>& funs)
462 ss <<
"int gid0 = get_global_id(0);\n\t";
463 ss <<
"double result=0;\n\t";
464 ss<<
"int nNullDate = GetNullDate( );\n";
472 ss <<
"int settle = fSettle;\n\t";
473 ss <<
"int mat = fMat;\n\t";
474 ss <<
"int issue = fIssue;\n\t";
475 ss <<
"int nBase = fBase;\n\t";
476 ss<<
"double fIssMat = GetYearFrac( nNullDate, issue, mat, nBase);\n";
477 ss<<
"double fIssSet = GetYearFrac( nNullDate, issue, settle,nBase);\n";
478 ss<<
"double fSetMat = GetYearFrac( nNullDate, settle, mat, nBase);\n";
479 ss<<
"result = 1.0 + fIssMat * rate;\n\t";
480 ss<<
"result /= 1.0 + fSetMat * yield;\n\t";
481 ss<<
"result -= fIssSet * rate;\n\t";
482 ss<<
"result*= 100.0;\n\t";
483 ss<<
"return result;\n\t";
488 const std::string &sSymName,
SubArguments &vSubArguments)
493 ss <<
" int gid0 = get_global_id(0);\n";
498 ss <<
" double result=0;\n";
499 ss <<
" double tmpvalue = ((life*(life+1))/2.0);\n";
500 ss <<
" result = ((cost-salvage)*(life-period+1)/tmpvalue);\n";
501 ss <<
" return result;\n";
511 ss <<
"double tmp;\n\t";
512 ss <<
"int gid0 = get_global_id(0);\n\t";
515 ss <<
"double invest = arg1 + 1.0;\n\t";
516 ss <<
"double reinvest = arg2 + 1.0;\n\t";
517 ss <<
"double NPV_invest = 0.0;\n\t";
518 ss <<
"double Pow_invest = 1.0;\n\t";
519 ss <<
"double NPV_reinvest = 0.0;\n\t";
520 ss <<
"double Pow_reinvest = 1.0;\n\t";
521 ss <<
"int nCount = 0;\n\t";
522 ss <<
"bool bHasPosValue = false;\n";
523 ss <<
"bool bHasNegValue = false;\n";
527 " NPV_reinvest += arg * Pow_reinvest;\n"
528 " bHasPosValue = true;\n"
530 " else if (arg < 0.0)\n"
532 " NPV_invest += arg * Pow_invest;\n"
533 " bHasNegValue = true;\n"
535 " Pow_reinvest /= reinvest;\n"
536 " Pow_invest /= invest;\n"
539 ss <<
"if ( !( bHasPosValue && bHasNegValue ) )\n";
540 ss <<
" return CreateDoubleError(IllegalArgument);\n";
542 ss <<
"-NPV_reinvest /NPV_invest * pow(reinvest,(double)nCount-1);\n\t";
543 ss <<
"tmp = pow(tmp, 1.0 / (nCount - 1)) - 1.0;\n\t";
544 ss <<
"return (double)tmp;\n";
549 const std::string &sSymName,
SubArguments& vSubArguments)
554 ss <<
" double tmp = " <<
GetBottom() <<
";\n";
555 ss <<
" int gid0 = get_global_id(0);\n\t";
558 ss <<
" tmp = pow(1.0 + arg0 / arg1, arg1)-1.0;\n";
559 ss <<
" return tmp;\n";
564 std::set<std::string>& funs)
581 ss <<
" int gid0 = get_global_id(0);\n";
582 ss <<
"double tmp = 0;\n\t";
586 ss<<
"tmp001+=1.0;\n";
587 ss<<
"int nDiff =GetDiffDate360(GetNullDate(),tmp000,tmp001,true);\n";
588 ss<<
"tmp =( 365 * tmp002 ) / ( 360 - ( tmp002 * ( nDiff ) ) );\n";
589 ss <<
"return tmp;\n";
593 std::set<std::string>& funs)
599 const std::string &sSymName,
SubArguments &vSubArguments)
604 ss <<
" double tmp = " <<
GetBottom() <<
";\n";
605 ss <<
" int gid0 = get_global_id(0);\n";
607 GenerateArg(
"fNumPeriouds", 1, vSubArguments, ss );
612 ss <<
" int nNumPeriods = (int)fNumPeriods;\n";
613 ss <<
" int nStartPer = (int)fStartPer;\n";
614 ss <<
" int nEndPer = (int)fEndPer;\n";
615 ss <<
" int nPayType = (int)fPayType;\n";
616 ss <<
" double fPmt;\n";
617 ss <<
" fPmt = GetPMT( fRate, nNumPeriods,fVal,0.0,nPayType != 0 );\n";
618 ss <<
" if(nStartPer == 1)\n";
620 ss <<
" if( nPayType <= 0 )\n";
621 ss <<
" tmp = fPmt + fVal * fRate;\n";
623 ss <<
" tmp = fPmt;\n";
624 ss <<
" nStartPer=nStartPer+1;\n";
626 ss <<
" for( int i = nStartPer ; i <= nEndPer ; i++ )\n";
628 ss <<
" if( nPayType > 0 )\n";
629 ss <<
" tmp += fPmt - ( GetFV( fRate,i - 2,";
630 ss <<
"fPmt,fVal,1)- fPmt ) * fRate;\n";
632 ss <<
" tmp += fPmt - GetFV( fRate, i - 1,";
633 ss <<
"fPmt,fVal,0 ) * fRate;\n";
635 ss <<
" return tmp;\n";
639 std::set<std::string>& funs)
655 ss <<
" int gid0 = get_global_id(0);\n";
656 ss <<
" double tmp = 0;\n";
664 ss <<
" int nStartDate = fStartDate;\n";
665 ss <<
" int nEndDate = fEndDate;\n";
666 ss <<
" int mode = fMode;\n";
667 ss <<
" int freq = fFreq;\n";
668 ss <<
" int nDays1stYear=0;\n";
669 ss <<
" int nNullDate=GetNullDate();\n";
670 ss <<
" int nTotalDays = GetDiffDate(nNullDate,nStartDate,";
671 ss <<
"nEndDate, mode,&nDays1stYear);\n";
672 ss <<
" tmp = fVal*fRate*convert_double(nTotalDays)";
673 ss <<
"/convert_double(nDays1stYear);\n";
674 ss <<
" return tmp;\n";
679 std::set<std::string>& funs)
694 ss <<
"int gid0 = get_global_id(0);\n\t";
695 ss <<
"double tmp = " <<
GetBottom() <<
";\n\t";
702 ss <<
" int nStartDate = fStartDate;\n";
703 ss <<
" int nEndDate = fEndDate;\n";
704 ss <<
" int mode = fMode;\n";
705 ss <<
"int nDays1stYear=0;\n\t";
706 ss <<
"int nNullDate=GetNullDate();\n\t";
707 ss <<
"int nTotalDays = GetDiffDate(nNullDate,nStartDate,";
708 ss <<
"nEndDate, mode,&nDays1stYear);\n\t";
709 ss <<
"tmp = fVal*fRate*convert_double(nTotalDays)";
710 ss <<
"/convert_double(nDays1stYear);\n\t";
711 ss <<
"return tmp;\n";
716 std::set<std::string>& funs)
751 ss <<
"double tmp = 0;\n\t";
752 ss <<
"int gid0 = get_global_id(0);\n\t";
760 ss <<
"tmp = getYield_(";
761 ss <<
"GetNullDate(),tmp000,tmp001,tmp002,tmp003,tmp004,tmp005,tmp006);\n\t ";
762 ss <<
"return tmp;\n";
767 const std::string &sSymName,
SubArguments &vSubArguments)
772 ss <<
" double tmp = 0;\n";
773 ss <<
" int gid0 = get_global_id(0);\n";
777 ss <<
" tmp = (cost-salvage)/life;\n";
778 ss <<
" return tmp;\n";
783 std::set<std::string>& funs)
802 ss <<
"double tmp = 0;\n\t";
803 ss <<
"int gid0 = get_global_id(0);\n\t";
810 ss <<
"tmp = GetYieldmat(";
811 ss<<
"GetNullDate(),tmp000,tmp001,tmp002,tmp003,tmp004,tmp005);\n\t";
812 ss <<
"return tmp;\n";
817 std::set<std::string>& funs)
824 const std::string &sSymName,
SubArguments &vSubArguments)
829 ss<<
" double tmp = 0;\n";
830 ss<<
" int gid0 = get_global_id(0);\n";
836 ss <<
" return GetPMT( fRate, fNper, fPv, fFv, fPayInAdvance != 0 );\n";
841 const std::string &sSymName,
SubArguments &vSubArguments)
846 ss <<
" double tmp = 0.0;\n";
847 ss <<
" int gid0 = get_global_id(0);\n";
848 ss <<
" int nCount = 1;\n";
851 " tmp += arg / pow( 1 + arg0, nCount );\n"
854 ss <<
" return tmp;\n";
859 std::set<std::string>& funs)
896 const std::string &sSymName,
SubArguments &vSubArguments)
901 ss<<
" double tmp = 0;\n";
902 ss<<
" int gid0 = get_global_id(0);\n";
910 ss <<
" if(tmp4*tmp5 == 0) return NAN;\n";
911 ss <<
" tmp = getPrice(tmp0,tmp1,tmp2,tmp3,tmp4,tmp5,tmp6);\n";
912 ss <<
" return tmp;\n";
917 std::set<std::string>& funs)
931 const std::string &sSymName,
SubArguments &vSubArguments)
936 ss <<
" double tmp = 0;\n";
937 ss <<
" int gid0 = get_global_id(0);\n";
946 ss <<
" int nNullDate = GetNullDate();\n";
947 ss <<
" tmp = GetOddlprice(nNullDate,tmp0,tmp1,";
948 ss <<
"tmp2,tmp3,tmp4,tmp5,tmp6,tmp7);\n";
949 ss <<
" return tmp;\n";
953 std::set<std::string>& funs)
967 const std::string &sSymName,
SubArguments &vSubArguments)
972 ss <<
" double tmp = 0;\n";
973 ss <<
" int gid0 = get_global_id(0);\n";
982 ss <<
" int nNullDate = GetNullDate();\n";
983 ss <<
" tmp = GetOddlyield(nNullDate,tmp0,tmp1";
984 ss <<
",tmp2,tmp3,tmp4,tmp5,tmp6,tmp7);\n";
985 ss <<
" return tmp;\n";
989 std::set<std::string>& funs)
1007 const std::string &sSymName,
SubArguments &vSubArguments)
1012 ss <<
" double tmp = 0;\n";
1013 ss <<
" int gid0 = get_global_id(0);\n";
1019 ss <<
" int nNullDate = GetNullDate();\n";
1020 ss <<
" tmp=tmp3* ( 1.0 -tmp2*GetYearDiff( nNullDate, ";
1021 ss <<
"tmp0,tmp1,tmp4));\n";
1022 ss <<
" return tmp;\n";
1026 const std::string &sSymName,
SubArguments &vSubArguments)
1031 ss <<
" double tmp = 0;\n";
1032 ss <<
" int gid0 = get_global_id(0);\n";
1038 ss <<
" if ( fPV + fFV == 0.0 )\n";
1039 ss <<
" return 0.0;\n";
1040 ss <<
" else if (fRate == 0.0)\n";
1041 ss <<
" return -(fPV + fFV)/fPmt;\n";
1042 ss <<
" else if (fPayInAdvance != 0)\n";
1043 ss <<
" return log(-(fRate*fFV-fPmt*(1.0+fRate))/(fRate*fPV+fPmt*(1.0+fRate)))\n";
1044 ss <<
" / log1p(fRate);\n";
1046 ss <<
" return log(-(fRate*fFV-fPmt)/(fRate*fPV+fPmt)) / log1p(fRate);\n";
1051 std::set<std::string>& funs)
1062 const std::string &sSymName,
SubArguments &vSubArguments)
1067 ss <<
" double tmp = 0;\n";
1068 ss <<
" int gid0 = get_global_id(0);\n";
1069 ss <<
" double arg=0;\n";
1076 ss <<
" if (fPer < 1.0 || fPer > fNper)\n";
1077 ss <<
" return CreateDoubleError(IllegalArgument);\n";
1080 ss <<
" double fPmt;\n";
1081 ss <<
" double fInterestPer = GetIpmt(fRate, fPer, fNper, fPv, fFv, fPayInAdvance != 0, &fPmt);\n";
1082 ss <<
" return fPmt - fInterestPer;\n";
1088 std::set<std::string>& funs)
1115 ss <<
" double tmp = 0;\n";
1116 ss <<
" int gid0 = get_global_id(0);\n";
1121 ss <<
" int nSettle = fSettle;\n";
1122 ss <<
" int nMat = fMat;\n";
1123 ss <<
" int nFreq = fFreq;\n";
1124 ss <<
" int nBase = fBase;\n";
1125 ss <<
" tmp = coupdaybs(nSettle,nMat,nFreq,nBase);\n";
1126 ss <<
" return tmp;\n";
1131 std::set<std::string>& funs)
1158 ss <<
" double tmp = 0;\n";
1159 ss <<
" int gid0 = get_global_id(0);\n";
1164 ss <<
" int nSettle = fSettle;\n";
1165 ss <<
" int nMat = fMat;\n";
1166 ss <<
" int nFreq = fFreq;\n";
1167 ss <<
" int nBase = fBase;\n";
1168 ss <<
" tmp = coupdays(nSettle,nMat,nFreq,nBase);\n";
1169 ss <<
" return tmp;\n";
1173 std::set<std::string>& funs)
1197 ss <<
" double tmp = 0;\n";
1198 ss <<
" int gid0 = get_global_id(0);\n";
1203 ss <<
" int nSettle = fSettle;\n";
1204 ss <<
" int nMat = fMat;\n";
1205 ss <<
" int nFreq = fFreq;\n";
1206 ss <<
" int nBase = fBase;\n";
1207 ss <<
" int nNullDate=693594;\n";
1208 ss <<
" tmp = lcl_GetCouppcd(nNullDate,nSettle,nMat,nFreq,nBase);\n";
1209 ss <<
" return tmp;\n";
1213 std::set<std::string>& funs)
1236 ss <<
" double tmp = 0;\n";
1237 ss <<
" int gid0 = get_global_id(0);\n";
1242 ss <<
" int nSettle = fSettle;\n";
1243 ss <<
" int nMat = fMat;\n";
1244 ss <<
" int nFreq = fFreq;\n";
1245 ss <<
" int nBase = fBase;\n";
1246 ss <<
" int nNullDate=693594;\n";
1247 ss <<
" tmp = lcl_GetCoupncd(nNullDate,nSettle,nMat,nFreq,nBase);\n";
1248 ss <<
" return tmp;\n";
1253 std::set<std::string>& funs)
1289 ss <<
" double tmp = 0;\n";
1290 ss <<
" int gid0 = get_global_id(0);\n";
1295 ss <<
" int nSettle = fSettle;\n";
1296 ss <<
" int nMat = fMat;\n";
1297 ss <<
" int nFreq = fFreq;\n";
1298 ss <<
" int nBase = fBase;\n";
1299 ss <<
" tmp = coupdaysnc(nSettle,nMat,nFreq,nBase);\n";
1300 ss <<
" return tmp;\n";
1305 std::set<std::string>& funs)
1323 const std::string &sSymName,
SubArguments &vSubArguments)
1328 ss <<
" double tmp = 0;\n";
1329 ss <<
" int gid0 = get_global_id(0);\n";
1334 ss <<
" int nSettle = fSettle;\n";
1335 ss <<
" int nMat = fMat;\n";
1336 ss <<
" int nFreq = fFreq;\n";
1337 ss <<
" int nBase = fBase;\n";
1338 ss <<
" tmp = coupnum(nSettle,nMat,nFreq,nBase);\n";
1339 ss <<
" return tmp;\n";
1343 std::set<std::string>& funs)
1355 const std::string &sSymName,
SubArguments &vSubArguments)
1360 ss <<
" int gid0 = get_global_id(0);\n";
1361 ss <<
" double tmp = " <<
GetBottom() <<
";\n";
1369 ss <<
" int nDate = fDate;\n";
1370 ss <<
" int nFirstPer = fFirstPer;\n";
1371 ss <<
" int nBase = fBase;\n";
1372 ss <<
" uint nPer = convert_int( fPer );\n";
1373 ss <<
" double fUsePer = 1.0 / fRate;\n";
1374 ss <<
" double fAmorCoeff;\n";
1375 ss <<
" if( fUsePer < 3.0 )\n";
1376 ss <<
" fAmorCoeff = 1.0;\n";
1377 ss <<
" else if( fUsePer < 5.0 )\n";
1378 ss <<
" fAmorCoeff = 1.5;\n";
1379 ss <<
" else if( fUsePer <= 6.0 )\n";
1380 ss <<
" fAmorCoeff = 2.0;\n";
1382 ss <<
" fAmorCoeff = 2.5;\n";
1383 ss <<
" fRate *= fAmorCoeff;\n";
1384 ss <<
" tmp = Round( GetYearFrac( 693594,";
1385 ss <<
"nDate, nFirstPer, nBase ) * fRate * fCost);\n";
1386 ss <<
" fCost = fCost-tmp;\n";
1387 ss <<
" double fRest = fCost - fRestVal;\n";
1388 ss <<
" for( uint n = 0 ; n < nPer ; n++ )\n";
1390 ss <<
" tmp = Round( fRate * fCost);\n";
1391 ss <<
" fRest -= tmp;\n";
1392 ss <<
" if( fRest < 0.0 )\n";
1394 ss <<
" switch( nPer - n )\n";
1398 ss <<
" tmp = Round( fCost * 0.5);\n";
1400 ss <<
" tmp = 0.0;\n";
1403 ss <<
" fCost -= tmp;\n";
1405 ss <<
" return tmp;\n";
1409 std::set<std::string>& funs)
1421 const std::string &sSymName,
SubArguments &vSubArguments)
1426 ss <<
" int gid0 = get_global_id(0);\n";
1427 ss <<
" double tmp = 0;\n";
1435 ss <<
" int nDate = fDate;\n";
1436 ss <<
" int nFirstPer = fFirstPer;\n";
1437 ss <<
" int nBase = fBase;\n";
1438 ss <<
" int nPer = convert_int( fPer );\n";
1439 ss <<
" double fOneRate = fCost * fRate;\n";
1440 ss <<
" double fCostDelta = fCost - fRestVal;\n";
1441 ss <<
" double f0Rate = GetYearFrac( 693594,";
1442 ss <<
"nDate, nFirstPer, nBase )* fRate * fCost;\n";
1443 ss <<
" int nNumOfFullPeriods = (int)";
1444 ss <<
"( ( fCost - fRestVal - f0Rate) / fOneRate );\n";
1445 ss <<
" if( nPer == 0 )\n";
1446 ss <<
" tmp = f0Rate;\n";
1447 ss <<
" else if( nPer <= nNumOfFullPeriods )\n";
1448 ss <<
" tmp = fOneRate;\n";
1449 ss <<
" else if( nPer == nNumOfFullPeriods + 1 )\n";
1450 ss <<
" tmp = fCostDelta - fOneRate * nNumOfFullPeriods - f0Rate;\n";
1452 ss <<
" tmp = 0.0;\n";
1453 ss <<
" return tmp;\n";
1457 std::set<std::string>& funs)
1470 const std::string &sSymName,
SubArguments &vSubArguments)
1475 ss <<
" double tmp = " <<
GetBottom() <<
";\n";
1476 ss <<
" int gid0 = get_global_id(0);\n";
1482 ss <<
" int nSettle = fSettle;\n";
1483 ss <<
" int nMat = fMat;\n";
1484 ss <<
" int rOB = fOB;\n";
1485 ss <<
" double tmpvalue = (1.0-(fDisc";
1486 ss <<
" * GetYearDiff( GetNullDate()";
1487 ss <<
",nSettle,nMat,rOB)));\n";
1488 ss <<
" tmp = fInvest/tmpvalue;\n";
1489 ss <<
" return tmp;\n";
1494 std::set<std::string>& funs)
1510 ss <<
"double tmp = 0;\n\t";
1511 ss <<
"int gid0 = get_global_id(0);\n";
1518 ss<<
"if(tmp002 <= 0 || tmp003 <= 0 || tmp000 >= tmp001 )\n\t";
1519 ss<<
" return CreateDoubleError(IllegalArgument);\n\t";
1520 ss<<
"tmp = (tmp003/tmp002)-1;\n\t";
1521 ss <<
"tmp /= GetYearFrac( GetNullDate(),tmp000,tmp001,tmp004);\n\t";
1522 ss <<
"return tmp;\n";
1527 std::set<std::string>& funs)
1544 ss <<
" int gid0 = get_global_id(0);\n";
1545 ss <<
" double tmp = 0;\n";
1547 ss <<
" int singleIndex = gid0;\n";
1548 ss <<
" int doubleIndex = gid0;\n";
1549 ss <<
" int i = gid0;\n";
1553 ss <<
" tmp1+=1.0;\n";
1554 ss <<
" double fFraction =GetYearFrac(693594,tmp0,tmp1,0);\n";
1555 ss <<
" tmp = 100.0 * ( 1.0 - tmp2 * fFraction );\n";
1556 ss <<
" return tmp;\n";
1561 std::set<std::string>& funs)
1573 ss <<
" int gid0 = get_global_id(0);\n";
1579 ss <<
" bool bPayType = fPayType != 0;\n";
1580 if( vSubArguments.size() == 6 )
1583 ss <<
" double fOrigGuess = fGuess;\n";
1584 ss <<
" bool bDefaultGuess = false;\n";
1588 ss <<
" double fGuess = 0.1, fOrigGuess = 0.1;\n";
1589 ss <<
" bool bDefaultGuess = true;\n";
1591 ss <<
" if( fNper <= 0 )\n";
1592 ss <<
" return CreateDoubleError(IllegalArgument);\n";
1593 ss <<
" bool bValid = RateIteration(fNper, fPayment, fPv, fFv, bPayType, &fGuess);\n";
1594 ss <<
" if (!bValid)\n";
1596 ss <<
" if (bDefaultGuess)\n";
1598 ss <<
" double fX = fOrigGuess;\n";
1599 ss <<
" for (int nStep = 2; nStep <= 10 && !bValid; ++nStep)\n";
1601 ss <<
" fGuess = fX * nStep;\n";
1602 ss <<
" bValid = RateIteration( fNper, fPayment, fPv, fFv, bPayType, &fGuess);\n";
1603 ss <<
" if (!bValid)\n";
1605 ss <<
" fGuess = fX / nStep;\n";
1606 ss <<
" bValid = RateIteration( fNper, fPayment, fPv, fFv, bPayType, &fGuess);\n";
1610 ss <<
" if (!bValid)\n";
1611 ss <<
" return CreateDoubleError(NoConvergence);\n";
1613 ss <<
" return fGuess;\n";
1618 std::set<std::string>& funs)
1637 ss <<
" int gid0 = get_global_id(0);\n";
1638 ss <<
" double tmp = 0;\n";
1642 ss <<
" int nDiff=GetDiffDate360(GetNullDate(),tmp000,tmp001,true);\n";
1644 ss <<
" tmp=100.0;\n";
1645 ss <<
" tmp = tmp / tmp002;\n";
1646 ss <<
" tmp = tmp - 1.0;\n";
1647 ss <<
" tmp = tmp / nDiff;\n";
1648 ss <<
" tmp = tmp * 360.0;\n";
1649 ss <<
" return tmp;\n";
1654 std::set<std::string>& funs)
1661 const std::string &sSymName,
SubArguments& vSubArguments)
1666 ss <<
" int gid0 = get_global_id(0);\n";
1667 ss <<
" double tmp = 0;\n";
1673 ss <<
" if (fCost < 0.0 || fSalvage < 0.0 || fFactor <= 0.0 || fSalvage > fCost\n";
1674 ss <<
" || fPeriod < 1.0 || fPeriod > fLife)\n";
1675 ss <<
" return CreateDoubleError(IllegalArgument);\n";
1676 ss <<
" return ScGetDDB( fCost, fSalvage, fLife, fPeriod, fFactor );\n";
1686 ss <<
" double result = 0;\n";
1687 ss <<
" int gid0 = get_global_id(0);\n";
1693 ss <<
" double fPv;\n";
1694 ss <<
" if (fRate == 0.0)\n";
1695 ss <<
" fPv = fFv + fPmt * fNper;\n";
1698 ss <<
" if (fPayInAdvance != 0)\n";
1699 ss <<
" fPv = (fFv * pow(1.0 + fRate, -fNper))\n";
1700 ss <<
" + (fPmt * (1.0 - pow(1.0 + fRate, -fNper + 1.0)) / fRate)\n";
1703 ss <<
" fPv = (fFv * pow(1.0 + fRate, -fNper))\n";
1704 ss <<
" + (fPmt * (1.0 - pow(1.0 + fRate, -fNper)) / fRate);\n";
1706 ss <<
" return -fPv;\n";
1711 std::set<std::string>& funs)
1727 ss <<
" int gid0 = get_global_id(0);\n";
1728 ss <<
" int singleIndex = gid0;\n";
1729 ss <<
" double result = 0;\n";
1737 ss <<
" if (fStart < 0.0 || fEnd < fStart || fEnd > fLife || fCost < 0.0\n";
1738 ss <<
" || fSalvage > fCost || fFactor <= 0.0)\n";
1739 ss <<
" return CreateDoubleError(IllegalArgument);\n";
1740 ss <<
" return VDBImplement(fCost, fSalvage, fLife, fStart, fEnd, fFactor, fNoSwitch != 0);\n";
1745 const std::string &sSymName,
SubArguments &vSubArguments)
1750 ss <<
" int gid0 = get_global_id(0);\n";
1752 ss <<
" if(fResultRate<=-1)\n";
1753 ss <<
" return CreateDoubleError(IllegalArgument);\n";
1754 ss <<
" double fMaxEps = 1e-10;\n";
1755 ss <<
" int nMaxIter = 50;\n";
1756 ss <<
" int nIter = 0;\n";
1757 ss <<
" double fResultValue;\n";
1758 ss <<
" int nIterScan = 0;\n";
1759 ss <<
" bool bContLoop = false;\n";
1760 ss <<
" bool bResultRateScanEnd = false;\n";
1766 ss <<
" if (nIterScan >=1)\n";
1767 ss <<
" fResultRate = -0.99 + (nIterScan -1)* 0.01;\n";
1770 ss <<
" double r = fResultRate + 1;\n";
1771 ss <<
" fResultValue = V_0;\n";
1773 " fResultValue += arg1/pow(r,(arg2 - D_0)/365.0);\n"
1776 ss <<
" double fResultValue2 = 0;\n";
1778 " double E_i = (arg2 - D_0)/365.0;\n"
1779 " fResultValue2 -= E_i * arg1 / pow(r,E_i + 1.0);\n"
1782 ss <<
" double fNewRate = fResultRate - fResultValue / fResultValue2;\n";
1783 ss <<
" double fRateEps = fabs( fNewRate - fResultRate );\n";
1784 ss <<
" fResultRate = fNewRate;\n";
1785 ss <<
" bContLoop = (fRateEps > fMaxEps) && (fabs( fResultValue ) > fMaxEps);\n";
1786 ss <<
" } while( bContLoop && (++nIter < nMaxIter) );\n";
1787 ss <<
" nIter = 0;\n";
1788 ss <<
" if( isnan(fResultRate) || isinf(fResultRate) || isnan(fResultValue) || isinf(fResultValue))\n";
1789 ss <<
" bContLoop = true;\n";
1790 ss <<
" ++nIterScan;\n";
1791 ss <<
" bResultRateScanEnd = (nIterScan >= 200);\n";
1792 ss <<
" } while(bContLoop && !bResultRateScanEnd);\n";
1793 ss <<
" if( bContLoop )\n";
1794 ss <<
" return CreateDoubleError(IllegalArgument);\n";
1795 ss <<
" return fResultRate;\n";
1800 const std::string &sSymName,
SubArguments& vSubArguments)
1805 ss <<
" int gid0 = get_global_id(0);\n";
1811 ss <<
" int nMonths = (int)fMonths;\n";
1812 ss <<
" if (fMonths < 1.0 || fMonths > 12.0 || fLife > 1200.0 || fSalvage < 0.0 ||\n";
1813 ss <<
" fPeriod > (fLife + 1.0) || fSalvage > fCost || fCost <= 0.0 ||\n";
1814 ss <<
" fLife <= 0 || fPeriod <= 0 )\n";
1815 ss <<
" return CreateDoubleError(IllegalArgument);\n";
1816 ss <<
" double tmp = 0;\n";
1817 ss <<
" double fDeprRate = 1.0 - pow(fSalvage / fCost, 1.0 / fLife);\n";
1818 ss <<
" fDeprRate = ((int)(fDeprRate * 1000.0 + 0.5)) / 1000.0;\n";
1819 ss <<
" double fFirstDeprRate = fCost * fDeprRate * nMonths / 12.0;\n";
1820 ss <<
" double fDb = 0.0;\n";
1821 ss <<
" if ((int)(fPeriod) == 1)\n";
1822 ss <<
" fDb = fFirstDeprRate;\n";
1825 ss <<
" double fSumDeprRate = fFirstDeprRate;\n";
1826 ss <<
" double fMin = fLife;\n";
1827 ss <<
" if (fMin > fPeriod) fMin = fPeriod;\n";
1828 ss <<
" int nMax = (int)fMin;\n";
1829 ss <<
" for (int i = 2; i <= nMax; i++)\n";
1831 ss <<
" fDb = (fCost - fSumDeprRate) * fDeprRate;\n";
1832 ss <<
" fSumDeprRate += fDb;\n";
1834 ss <<
" if (fPeriod > fLife)\n";
1835 ss <<
" fDb = ((fCost - fSumDeprRate)";
1836 ss <<
"* fDeprRate * (12.0 - nMonths)) / 12.0;\n";
1838 ss <<
" tmp = fDb;\n";
1839 ss <<
" return tmp;\n";
static void GenTmpVariables(outputstream &ss, const SubArguments &vSubArguments)
static void CheckAllSubArgumentIsNan(outputstream &ss, SubArguments &vSubArguments)
virtual void BinInlineFun(std::set< std::string > &, std::set< std::string > &) override
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
virtual void BinInlineFun(std::set< std::string > &, std::set< std::string > &) override
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
virtual void BinInlineFun(std::set< std::string > &, std::set< std::string > &) override
virtual std::string GetBottom() override
virtual void BinInlineFun(std::set< std::string > &, std::set< std::string > &) override
virtual std::string GetBottom() override
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
virtual void BinInlineFun(std::set< std::string > &, std::set< std::string > &) override
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
virtual void BinInlineFun(std::set< std::string > &, std::set< std::string > &) override
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
virtual void BinInlineFun(std::set< std::string > &, std::set< std::string > &) override
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
virtual void BinInlineFun(std::set< std::string > &, std::set< std::string > &) override
virtual void BinInlineFun(std::set< std::string > &, std::set< std::string > &) override
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
virtual void BinInlineFun(std::set< std::string > &, std::set< std::string > &) override
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
virtual void BinInlineFun(std::set< std::string > &, std::set< std::string > &) override
virtual void BinInlineFun(std::set< std::string > &, std::set< std::string > &) override
virtual std::string GetBottom() override
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
virtual void BinInlineFun(std::set< std::string > &, std::set< std::string > &) override
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
virtual void BinInlineFun(std::set< std::string > &, std::set< std::string > &) override
virtual std::string GetBottom() override
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
virtual std::string GetBottom() override
virtual std::string GetBottom() override
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
virtual std::string GetBottom() override
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
virtual void BinInlineFun(std::set< std::string > &, std::set< std::string > &) override
virtual std::string GetBottom() override
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
virtual std::string GetBottom() override
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
virtual void BinInlineFun(std::set< std::string > &, std::set< std::string > &) override
virtual std::string GetBottom() override
virtual void BinInlineFun(std::set< std::string > &, std::set< std::string > &) override
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
virtual std::string GetBottom() override
virtual void BinInlineFun(std::set< std::string > &, std::set< std::string > &) override
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
virtual std::string GetBottom() override
virtual std::string GetBottom() override
virtual void BinInlineFun(std::set< std::string > &, std::set< std::string > &) override
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
virtual void BinInlineFun(std::set< std::string > &, std::set< std::string > &) override
virtual void BinInlineFun(std::set< std::string > &, std::set< std::string > &) override
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
virtual std::string GetBottom() override
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
virtual void BinInlineFun(std::set< std::string > &, std::set< std::string > &) override
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
virtual void BinInlineFun(std::set< std::string > &, std::set< std::string > &) override
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
virtual void BinInlineFun(std::set< std::string > &, std::set< std::string > &) override
virtual void BinInlineFun(std::set< std::string > &, std::set< std::string > &) override
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
virtual void BinInlineFun(std::set< std::string > &, std::set< std::string > &) override
virtual void BinInlineFun(std::set< std::string > &, std::set< std::string > &) override
virtual std::string GetBottom() override
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
virtual void BinInlineFun(std::set< std::string > &, std::set< std::string > &) override
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
virtual void BinInlineFun(std::set< std::string > &, std::set< std::string > &) override
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
virtual void BinInlineFun(std::set< std::string > &, std::set< std::string > &) override
virtual void BinInlineFun(std::set< std::string > &, std::set< std::string > &) override
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
virtual void BinInlineFun(std::set< std::string > &, std::set< std::string > &) override
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
virtual void BinInlineFun(std::set< std::string > &, std::set< std::string > &) override
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
virtual void BinInlineFun(std::set< std::string > &, std::set< std::string > &) override
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
virtual void BinInlineFun(std::set< std::string > &, std::set< std::string > &) override
void GenerateArg(const char *name, int arg, SubArguments &vSubArguments, outputstream &ss, EmptyArgType empty=EmptyIsZero, GenerateArgTypeType generateType=DoNotGenerateArgType)
static void GenerateRangeArgElement(const char *name, int arg, const char *element, SubArguments &vSubArguments, outputstream &ss, EmptyArgType empty)
static void GenerateRangeArg(int arg, SubArguments &vSubArguments, outputstream &ss, EmptyArgType empty, const char *code)
void GenerateArgWithDefault(const char *name, int arg, double def, SubArguments &vSubArguments, outputstream &ss, EmptyArgType empty=EmptyIsZero)
void GenerateFunctionDeclaration(const std::string &sSymName, SubArguments &vSubArguments, outputstream &ss)
static void GenerateRangeArgPair(int arg1, int arg2, SubArguments &vSubArguments, outputstream &ss, EmptyArgType empty, const char *code, const char *firstElementDiff=nullptr)
static void GenerateRangeArgs(int firstArg, int lastArg, SubArguments &vSubArguments, outputstream &ss, EmptyArgType empty, const char *code)
std::vector< DynamicKernelArgumentRef > SubArguments
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
const char ScInterVDBDecl[]
const char IsLeapYearDecl[]
const char DaysInMonthDecl[]
const char DaysToDateDecl[]
const char coupdaysncDecl[]
const char GetOddlpriceDecl[]
const char GetNullDateDecl[]
const char lcl_GetcoupdaysDecl[]
const char VDBImplementDecl[]
const char DaysToDate_LocalBarrierDecl[]
const char checklessthan[]
const char RateIteration[]
const char GetDiffDate360_[]
const char getYield_Decl[]
const char GetDiffDate360Decl[]
const char checklessthanDecl[]
const char GetDiffDate360_Decl[]
const char GetOddlyieldDecl[]
const char GetDurationDecl[]
const char GetDiffDateDecl[]
const char lcl_Getcoupdaybs[]
const char getDaysInMonthRange[]
const char GetDiffDate360[]
const char RateIterationDecl[]
const char DateToDaysDecl[]
const char lcl_Getcoupdays[]
const char lcl_GetCoupncdDecl[]
const char getDaysInYearRange[]
const char addMonthsDecl[]
const char VDBImplement[]
const char lcl_GetCoupncd[]
const char GetDaysInYears[]
const char GetOddlyield[]
const char lcl_GetcoupnumDecl[]
const char GetYieldmatDecl[]
const char GetDaysInYearsDecl[]
const char coupdaysDecl[]
const char lcl_GetcoupdaybsDecl[]
const char GetDaysInYearDecl[]
const char GetOddlprice[]
const char GetYearFracDecl[]
const char lcl_GetCouppcd[]
const char getPriceDecl[]
const char getDaysInYearRangeDecl[]
const char getDaysInMonthRangeDecl[]
const char lcl_Getcoupnum[]
const char coupdaybsDecl[]
const char ScGetDDBDecl[]
const char GetDaysInYear[]
const char lcl_GetCouppcdDecl[]
const char DaysToDate_LocalBarrier[]
const char GetYearDiffDecl[]
const char is_representable_integerDecl[]
const char approx_equalDecl[]
const char approx_equal[]
const char nCorrValDecl[]
const char is_representable_integer[]
#define CHECK_PARAMETER_DOUBLEVECTORREF(arg)
#define CHECK_PARAMETER_COUNT(min, max)