LibreOffice Module sc (master) 1
Variables
op_financial_helpers.hxx File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Variables

const char GetPMTDecl []
 
const char GetPMT []
 
const char GetIpmtDecl []
 
const char GetIpmt []
 
const char GetFVDecl []
 
const char GetFV []
 
const char IsLeapYearDecl []
 
const char IsLeapYear []
 
const char DaysInMonthDecl []
 
const char DaysInMonth []
 
const char DateToDaysDecl []
 
const char DateToDays []
 
const char GetNullDateDecl []
 
const char GetNullDate []
 
const char ScaDateDecl []
 
const char ScaDate []
 
const char lcl_GetCouppcdDecl []
 
const char lcl_GetCouppcd []
 
const char lcl_GetCoupncdDecl []
 
const char lcl_GetCoupncd []
 
const char addMonthsDecl []
 
const char addMonths []
 
const char getDaysInMonthRangeDecl []
 
const char getDaysInMonthRange []
 
const char GetDaysInYearsDecl []
 
const char GetDaysInYears []
 
const char GetDaysInYearDecl []
 
const char GetDaysInYear []
 
const char getDaysInYearRangeDecl []
 
const char getDaysInYearRange []
 
const char getDiffDecl []
 
const char getDiff []
 
const char lcl_GetcoupdaybsDecl []
 
const char lcl_Getcoupdaybs []
 
const char lcl_GetcoupdaysDecl []
 
const char lcl_Getcoupdays []
 
const char lcl_GetcoupnumDecl []
 
const char lcl_Getcoupnum []
 
const char setDayDecl []
 
const char setDay []
 
const char coupdaysDecl []
 
const char coupdays []
 
const char coupdaybsDecl []
 
const char coupdaybs []
 
const char coupdaysncDecl []
 
const char coupdaysnc []
 
const char checklessthanDecl []
 
const char checklessthan []
 
const char coupnumDecl []
 
const char coupnum []
 
const char getPriceDecl []
 
const char getPrice []
 
const char getYield_Decl []
 
const char getYield_ []
 
const char GetYieldmatDecl []
 
const char GetYieldmat []
 
const char GetDiffDate360_Decl []
 
const char GetDiffDate360_ []
 
const char GetDiffDate360Decl []
 
const char GetDiffDate360 []
 
const char GetDurationDecl []
 
const char GetDuration []
 
const char ScGetDDBDecl []
 
const char ScGetDDB []
 
const char ScInterVDBDecl []
 
const char ScInterVDB []
 
const char VDBImplementDecl []
 
const char VDBImplement []
 
const char GetOddlpriceDecl []
 
const char GetOddlprice []
 
const char GetOddlyieldDecl []
 
const char GetOddlyield []
 
const char GetYearFracDecl []
 
const char GetYearFrac []
 
const char DaysToDateDecl []
 
const char DaysToDate []
 
const char DaysToDate_LocalBarrierDecl []
 
const char DaysToDate_LocalBarrier []
 
const char GetYearDiffDecl []
 
const char GetYearDiff []
 
const char GetDiffDateDecl []
 
const char GetDiffDate []
 
const char RateIterationDecl []
 
const char RateIteration []
 

Variable Documentation

◆ addMonths

const char addMonths[]
Initial value:
=
"void addMonths(int b30Days,int bLastDay,int *nDay,int nOrigDay,"
"int *nMonth,int nMonthCount,int *year)\n"
"{\n"
" int nNewMonth = nMonthCount + *nMonth;\n"
" if( nNewMonth > 12 )\n"
" {\n"
" --nNewMonth;\n"
" *year+=nNewMonth / 12 ;\n"
" *nMonth = ( nNewMonth % 12 ) + 1;\n"
" }\n"
" else if( nNewMonth < 1 )\n"
" {\n"
" *year+= nNewMonth / 12 - 1 ;\n"
" *nMonth = nNewMonth % 12 + 12 ;\n"
" }\n"
" else\n"
" *nMonth = nNewMonth ;\n"
" if( b30Days )\n"
" {\n"
" *nDay = min( nOrigDay, 30);\n"
" if( bLastDay || (*nDay >= DaysInMonth( *nMonth, *year )) )\n"
" *nDay = 30;\n"
" }\n"
" else\n"
" {\n"
" int nLastDay = DaysInMonth( *nMonth, *year );\n"
" *nDay = bLastDay ? nLastDay : min( nOrigDay, nLastDay );\n"
" }\n"
"}\n"

Definition at line 251 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpMDuration::BinInlineFun(), sc::opencl::OpYield::BinInlineFun(), sc::opencl::OpPrice::BinInlineFun(), sc::opencl::OpPriceDisc::BinInlineFun(), sc::opencl::OpCoupdaybs::BinInlineFun(), sc::opencl::OpCoupdays::BinInlineFun(), sc::opencl::OpCoupdaysnc::BinInlineFun(), sc::opencl::OpCouppcd::BinInlineFun(), sc::opencl::OpCoupncd::BinInlineFun(), and sc::opencl::OpCoupnum::BinInlineFun().

◆ addMonthsDecl

const char addMonthsDecl[]

◆ checklessthan

const char checklessthan[]
Initial value:
=
"int checklessthan(int aYear,int bYear,int aMonth,int bMonth,int anDay,int "
"bnDay,int abLastDay,int bbLastDay,int anOrigDay,int bnOrigDay)\n"
"{\n"
" if( aYear != bYear )\n"
" return aYear < bYear;\n"
" if( aMonth != bMonth )\n"
" return aMonth < bMonth;\n"
" if( anDay != bnDay )\n"
" return anDay < bnDay;\n"
" if( abLastDay || bbLastDay )\n"
" return !abLastDay && bbLastDay;\n"
" return anOrigDay < bnOrigDay;\n"
"}\n"

Definition at line 633 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpMDuration::BinInlineFun(), sc::opencl::OpYield::BinInlineFun(), sc::opencl::OpPrice::BinInlineFun(), sc::opencl::OpCoupdaybs::BinInlineFun(), sc::opencl::OpCoupdays::BinInlineFun(), sc::opencl::OpCoupdaysnc::BinInlineFun(), sc::opencl::OpCouppcd::BinInlineFun(), sc::opencl::OpCoupncd::BinInlineFun(), and sc::opencl::OpCoupnum::BinInlineFun().

◆ checklessthanDecl

const char checklessthanDecl[]

◆ coupdaybs

const char coupdaybs[]
Initial value:
=
"double coupdaybs( int nSettle,int nMat,int nFreq,int nBase)\n"
"{\n"
" int nNullDate=693594;\n"
" return lcl_Getcoupdaybs(nNullDate, nSettle, nMat,nFreq, nBase);\n"
"}\n"

Definition at line 580 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpYield::BinInlineFun(), sc::opencl::OpPrice::BinInlineFun(), sc::opencl::OpCoupdaybs::BinInlineFun(), and sc::opencl::OpCoupdaysnc::BinInlineFun().

◆ coupdaybsDecl

const char coupdaybsDecl[]
Initial value:
=
"double coupdaybs( int nSettle,int nMat,int nFreq,int nBase);\n"

Definition at line 577 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpYield::BinInlineFun(), sc::opencl::OpPrice::BinInlineFun(), sc::opencl::OpCoupdaybs::BinInlineFun(), and sc::opencl::OpCoupdaysnc::BinInlineFun().

◆ coupdays

const char coupdays[]
Initial value:
=
"double coupdays(int nSettle,int nMat,int nFreq,int nBase)\n"
"{\n"
" int nNullDate=693594;\n"
" if( nBase == 1 )\n"
" return lcl_Getcoupdays(nNullDate, nSettle, nMat,nFreq, nBase);\n"
" else\n"
" return (double)GetDaysInYear(0,0,nBase)/(double)nFreq;\n"
"}\n"

Definition at line 567 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpYield::BinInlineFun(), sc::opencl::OpPrice::BinInlineFun(), sc::opencl::OpCoupdays::BinInlineFun(), and sc::opencl::OpCoupdaysnc::BinInlineFun().

◆ coupdaysDecl

const char coupdaysDecl[]
Initial value:
=
"double coupdays(int nSettle,int nMat,int nFreq,int nBase);\n"

Definition at line 564 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpYield::BinInlineFun(), sc::opencl::OpPrice::BinInlineFun(), sc::opencl::OpCoupdays::BinInlineFun(), and sc::opencl::OpCoupdaysnc::BinInlineFun().

◆ coupdaysnc

const char coupdaysnc[]

◆ coupdaysncDecl

const char coupdaysncDecl[]
Initial value:
=
"double coupdaysnc( int nSettle,int nMat,int nFreq,int nBase);\n"

Definition at line 587 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpYield::BinInlineFun(), sc::opencl::OpPrice::BinInlineFun(), and sc::opencl::OpCoupdaysnc::BinInlineFun().

◆ coupnum

const char coupnum[]
Initial value:
=
"double coupnum( int nSettle,int nMat,int nFreq,int nBase)\n"
"{\n"
" int nNullDate=693594;\n"
" return lcl_Getcoupnum(nNullDate,nSettle,nMat,nFreq,nBase);\n"
"}\n"

Definition at line 651 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpYield::BinInlineFun(), sc::opencl::OpPrice::BinInlineFun(), and sc::opencl::OpCoupnum::BinInlineFun().

◆ coupnumDecl

const char coupnumDecl[]
Initial value:
=
"double coupnum( int nSettle,int nMat,int nFreq,int nBase);\n"

Definition at line 648 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpYield::BinInlineFun(), sc::opencl::OpPrice::BinInlineFun(), and sc::opencl::OpCoupnum::BinInlineFun().

◆ DateToDays

const char DateToDays[]

◆ DateToDaysDecl

const char DateToDaysDecl[]

◆ DaysInMonth

const char DaysInMonth[]
Initial value:
=
"int DaysInMonth( int nMonth, int nYear )\n"
"{\n"
" int tmp = 0;\n"
" switch(nMonth)\n"
" {\n"
" case 1:\n"
" case 3:\n"
" case 5:\n"
" case 7:\n"
" case 8:\n"
" case 10:\n"
" case 12:\n"
" tmp = 31;\n"
" break;\n"
" case 4:\n"
" case 6:\n"
" case 9:\n"
" case 11:\n"
" tmp =30;\n"
" break;\n"
" case 2:\n"
" if ( IsLeapYear(nYear)==1)\n"
" tmp = 29;\n"
" else\n"
" tmp = 28;\n"
" break;\n"
" }\n"
" return tmp;\n"
"}\n"

Definition at line 95 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpDISC::BinInlineFun(), sc::opencl::OpINTRATE::BinInlineFun(), sc::opencl::OpDuration_ADD::BinInlineFun(), sc::opencl::OpMDuration::BinInlineFun(), sc::opencl::PriceMat::BinInlineFun(), sc::opencl::OpTbilleq::BinInlineFun(), sc::opencl::OpAccrintm::BinInlineFun(), sc::opencl::OpAccrint::BinInlineFun(), sc::opencl::OpYield::BinInlineFun(), sc::opencl::OpYieldmat::BinInlineFun(), sc::opencl::OpPrice::BinInlineFun(), sc::opencl::OpOddlprice::BinInlineFun(), sc::opencl::OpOddlyield::BinInlineFun(), sc::opencl::OpPriceDisc::BinInlineFun(), sc::opencl::OpCoupdaybs::BinInlineFun(), sc::opencl::OpCoupdays::BinInlineFun(), sc::opencl::OpCoupdaysnc::BinInlineFun(), sc::opencl::OpCouppcd::BinInlineFun(), sc::opencl::OpCoupncd::BinInlineFun(), sc::opencl::OpCoupnum::BinInlineFun(), sc::opencl::OpAmordegrc::BinInlineFun(), sc::opencl::OpAmorlinc::BinInlineFun(), sc::opencl::OpReceived::BinInlineFun(), sc::opencl::OpYielddisc::BinInlineFun(), sc::opencl::OpTbillprice::BinInlineFun(), and sc::opencl::OpTbillyield::BinInlineFun().

◆ DaysInMonthDecl

const char DaysInMonthDecl[]

◆ DaysToDate

const char DaysToDate[]

◆ DaysToDate_LocalBarrier

const char DaysToDate_LocalBarrier[]

◆ DaysToDate_LocalBarrierDecl

const char DaysToDate_LocalBarrierDecl[]
Initial value:
=
"void DaysToDate( int nDays, int *rDay, int* rMonth, int* rYear );\n"

Definition at line 1199 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpTbilleq::BinInlineFun(), and sc::opencl::OpTbillyield::BinInlineFun().

◆ DaysToDateDecl

const char DaysToDateDecl[]

◆ getDaysInMonthRange

const char getDaysInMonthRange[]
Initial value:
=
"int getDaysInMonthRange( int nFrom, int nTo,int b30Days,int year)\n"
"{\n"
" if( nFrom > nTo )\n"
" return 0;\n"
" int nRet = 0;\n"
" if( b30Days )\n"
" nRet = (nTo - nFrom + 1) * 30;\n"
" else\n"
" {\n"
" for( int nMonthIx = nFrom; nMonthIx <= nTo; ++nMonthIx )\n"
" nRet += b30Days ? 30 : DaysInMonth( nMonthIx, year );\n"
" }\n"
" return nRet;\n"
"}\n"

Definition at line 285 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpYield::BinInlineFun(), sc::opencl::OpPrice::BinInlineFun(), sc::opencl::OpPriceDisc::BinInlineFun(), sc::opencl::OpCoupdaybs::BinInlineFun(), sc::opencl::OpCoupdays::BinInlineFun(), and sc::opencl::OpCoupdaysnc::BinInlineFun().

◆ getDaysInMonthRangeDecl

const char getDaysInMonthRangeDecl[]

◆ GetDaysInYear

const char GetDaysInYear[]
Initial value:
=
"int GetDaysInYear( int nNullDate, int nDate, int nMode )\n"
"{\n"
" switch( nMode )\n"
" {\n"
" case 0:\n"
" case 2:\n"
" case 4:\n"
" return 360;\n"
" case 1:\n"
" {\n"
" int nD=0, nM=0, nY=0;\n"
" nDate += nNullDate;\n"
" DaysToDate( nDate, &nD, &nM, &nY );\n"
" return IsLeapYear( nY )? 366 : 365;\n"
" }\n"
" case 3:\n"
" return 365;\n"
" }\n"
"}\n"

Definition at line 324 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpYield::BinInlineFun(), sc::opencl::OpPrice::BinInlineFun(), sc::opencl::OpPriceDisc::BinInlineFun(), sc::opencl::OpCoupdays::BinInlineFun(), and sc::opencl::OpCoupdaysnc::BinInlineFun().

◆ GetDaysInYearDecl

const char GetDaysInYearDecl[]

◆ getDaysInYearRange

const char getDaysInYearRange[]
Initial value:
=
"int getDaysInYearRange( int nFrom, int nTo,int b30Days )\n"
"{\n"
" if( nFrom > nTo )\n"
" return 0;\n"
" return b30Days ? ((nTo - nFrom + 1) * 360) : GetDaysInYears( nFrom, nTo)"
";\n"
"}\n"

Definition at line 348 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpYield::BinInlineFun(), sc::opencl::OpPrice::BinInlineFun(), sc::opencl::OpPriceDisc::BinInlineFun(), sc::opencl::OpCoupdaybs::BinInlineFun(), sc::opencl::OpCoupdays::BinInlineFun(), and sc::opencl::OpCoupdaysnc::BinInlineFun().

◆ getDaysInYearRangeDecl

const char getDaysInYearRangeDecl[]

◆ GetDaysInYears

const char GetDaysInYears[]
Initial value:
=
"int GetDaysInYears( int nYear1, int nYear2 )\n"
"{\n"
" int nLeaps = 0;\n"
" for( int n = nYear1 ; n <= nYear2 ; n++ )\n"
" {\n"
" if( IsLeapYear( n ) )\n"
" nLeaps++;\n"
" }\n"
" int nSum = 1;\n"
" nSum += nYear2;\n"
" nSum -= nYear1;\n"
" nSum *= 365;\n"
" nSum += nLeaps;\n"
" return nSum;\n"
"}\n"

Definition at line 304 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpYield::BinInlineFun(), sc::opencl::OpPrice::BinInlineFun(), sc::opencl::OpPriceDisc::BinInlineFun(), sc::opencl::OpCoupdaybs::BinInlineFun(), sc::opencl::OpCoupdays::BinInlineFun(), and sc::opencl::OpCoupdaysnc::BinInlineFun().

◆ GetDaysInYearsDecl

const char GetDaysInYearsDecl[]

◆ getDiff

const char getDiff[]

◆ GetDiffDate

const char GetDiffDate[]

◆ GetDiffDate360

const char GetDiffDate360[]
Initial value:
=
"int GetDiffDate360( int nNullDate, int nDate1, int nDate2,"
"bool bUSAMethod )\n"
"{\n"
" nDate1 += nNullDate;\n"
" nDate2 += nNullDate;\n"
" int nDay1, nMonth1, nYear1, nDay2, nMonth2, nYear2;\n"
" DaysToDate( nDate1, &nDay1, &nMonth1, &nYear1 );\n"
" DaysToDate( nDate2, &nDay2, &nMonth2, &nYear2 );\n"
" return GetDiffDate360_( nDay1, nMonth1, nYear1, IsLeapYear( nYear1 ), "
"nDay2, nMonth2, nYear2, bUSAMethod );\n"
"}\n"

Definition at line 794 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpTbilleq::BinInlineFun(), and sc::opencl::OpTbillyield::BinInlineFun().

◆ GetDiffDate360_

const char GetDiffDate360_[]
Initial value:
=
"int GetDiffDate360_(\n"
" int nDay1, int nMonth1, int nYear1, bool bLeapYear1,\n"
" int nDay2, int nMonth2, int nYear2,\n"
" bool bUSAMethod )\n"
"{\n"
" if( nDay1 == 31 )\n"
" nDay1--;\n"
" else if( bUSAMethod && ( nMonth1 == 2 && ( nDay1 == 29 || ( nDay1 == 28 "
"&& !bLeapYear1 ) ) ) )\n"
" nDay1 = 30;\n"
" if( nDay2 == 31 )\n"
" {\n"
" if( bUSAMethod && nDay1 != 30 )\n"
" {\n"
" nDay2 = 1;\n"
" if( nMonth2 == 12 )\n"
" {\n"
" nYear2++;\n"
" nMonth2 = 1;\n"
" }\n"
" else\n"
" nMonth2++;\n"
" }\n"
" else\n"
" nDay2 = 30;\n"
" }\n"
" return nDay2 + nMonth2 * 30 + nYear2 * 360 - nDay1 - nMonth1 * 30 - "
"nYear1 * 360;\n"
"}\n"

Definition at line 759 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpTbilleq::BinInlineFun(), and sc::opencl::OpTbillyield::BinInlineFun().

◆ GetDiffDate360_Decl

const char GetDiffDate360_Decl[]
Initial value:
=
"int GetDiffDate360_(\n"
" int nDay1, int nMonth1, int nYear1, bool bLeapYear1,\n"
" int nDay2, int nMonth2, int nYear2,\n"
" bool bUSAMethod );\n"

Definition at line 753 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpTbilleq::BinInlineFun(), and sc::opencl::OpTbillyield::BinInlineFun().

◆ GetDiffDate360Decl

const char GetDiffDate360Decl[]
Initial value:
=
"int GetDiffDate360( int nNullDate, int nDate1, int nDate2,"
"bool bUSAMethod);\n"

Definition at line 790 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpTbilleq::BinInlineFun(), and sc::opencl::OpTbillyield::BinInlineFun().

◆ GetDiffDateDecl

const char GetDiffDateDecl[]

◆ getDiffDecl

const char getDiffDecl[]
Initial value:
=
"int getDiff(int rFrom,int rTo,int fDay,int fMonth,int fYear,int fbLastDayMode,"
"int fbLastDay,int fb30Days,int fbUSMode,int fnDay,int tDay,int tMonth,"
"int tYear,int tbLastDayMode,int tbLastDay,int tb30Days,"
"int tbUSMode,int tnDay);\n"

Definition at line 357 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpYield::BinInlineFun(), sc::opencl::OpPrice::BinInlineFun(), sc::opencl::OpPriceDisc::BinInlineFun(), sc::opencl::OpCoupdaybs::BinInlineFun(), sc::opencl::OpCoupdays::BinInlineFun(), and sc::opencl::OpCoupdaysnc::BinInlineFun().

◆ GetDuration

const char GetDuration[]

◆ GetDurationDecl

const char GetDurationDecl[]
Initial value:
=
"double GetDuration( \n"
" int nNullDate, int nSettle, int nMat, double fCoup,\n"
" double fYield, int nFreq, int nBase );\n"

Definition at line 807 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpDuration_ADD::BinInlineFun(), and sc::opencl::OpMDuration::BinInlineFun().

◆ GetFV

const char GetFV[]
Initial value:
=
"double GetFV( double fRate, double fNper, double fPmt,"
" double fPv, bool bPayInAdvance )\n"
"{\n"
" double fFv;\n"
" if (fRate == 0.0)\n"
" fFv = fPv + fPmt * fNper;\n"
" else\n"
" {\n"
" double fTerm = pow(1.0 + fRate, fNper);\n"
" if (bPayInAdvance)\n"
" fFv = fPv * fTerm + fPmt*(1.0 + fRate)*(fTerm - 1.0)/fRate;\n"
" else\n"
" fFv = fPv * fTerm + fPmt*(fTerm - 1.0)/fRate;\n"
" }\n"
" return -fFv;\n"
"}\n"

Definition at line 64 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpFV::BinInlineFun(), sc::opencl::OpIPMT::BinInlineFun(), sc::opencl::Cumipmt::BinInlineFun(), sc::opencl::OpCumprinc::BinInlineFun(), and sc::opencl::OpPPMT::BinInlineFun().

◆ GetFVDecl

const char GetFVDecl[]
Initial value:
=
"double GetFV( double fRate, double fNper, double fPmt,"
" double fPv, bool bPayInAdvance );\n"

Definition at line 60 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpFV::BinInlineFun(), sc::opencl::OpIPMT::BinInlineFun(), sc::opencl::OpCumprinc::BinInlineFun(), and sc::opencl::OpPPMT::BinInlineFun().

◆ GetIpmt

const char GetIpmt[]
Initial value:
=
"double GetIpmt(double fRate, double fPer, double fNper, double fPv,\n"
" double fFv, bool bPayInAdvance, double* fPmt)\n"
"{\n"
" *fPmt = GetPMT(fRate, fNper, fPv, fFv, bPayInAdvance);\n"
" double fIpmt;\n"
" if (fPer == 1.0)\n"
" {\n"
" if (bPayInAdvance)\n"
" fIpmt = 0.0;\n"
" else\n"
" fIpmt = -fPv;\n"
" }\n"
" else\n"
" {\n"
" if (bPayInAdvance)\n"
" fIpmt = GetFV(fRate, fPer-2.0, *fPmt, fPv, true) - *fPmt;\n"
" else\n"
" fIpmt = GetFV(fRate, fPer-1.0, *fPmt, fPv, false);\n"
" }\n"
" return fIpmt * fRate;\n"
"}\n"

Definition at line 37 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpIPMT::BinInlineFun(), and sc::opencl::OpPPMT::BinInlineFun().

◆ GetIpmtDecl

const char GetIpmtDecl[]
Initial value:
=
"double GetIpmt(double fRate, double fPer, double fNper, double fPv,\n"
" double fFv, bool bPayInAdvance, double* fPmt);\n"

Definition at line 33 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpIPMT::BinInlineFun(), and sc::opencl::OpPPMT::BinInlineFun().

◆ GetNullDate

const char GetNullDate[]

◆ GetNullDateDecl

const char GetNullDateDecl[]

◆ GetOddlprice

const char GetOddlprice[]
Initial value:
=
"double GetOddlprice( int nNullDate, int nSettle, int nMat, int nLastCoup,\n"
" double fRate, double fYield, double fRedemp, int nFreq, int nBase )\n"
"{\n"
" double fFreq = nFreq ;\n"
" double fDCi = GetYearFrac( nNullDate, nLastCoup,"
"nMat, nBase ) * fFreq;\n"
" double fDSCi = GetYearFrac( nNullDate, nSettle,"
"nMat, nBase ) * fFreq;\n"
" double fAi = GetYearFrac( nNullDate, nLastCoup,"
"nSettle, nBase ) * fFreq;\n"
" double p = fRedemp + fDCi * 100.0 * fRate / fFreq;\n"
" p /= fDSCi * fYield / fFreq + 1.0;\n"
" p -= fAi * 100.0 * fRate / fFreq;\n"
" return p;\n"
"}\n"

Definition at line 989 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpOddlprice::BinInlineFun().

◆ GetOddlpriceDecl

const char GetOddlpriceDecl[]
Initial value:
=
"double GetOddlprice( int nNullDate, int nSettle, int nMat, int nLastCoup,\n"
" double fRate, double fYield, double fRedemp, int nFreq, int nBase );\n"

Definition at line 985 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpOddlprice::BinInlineFun().

◆ GetOddlyield

const char GetOddlyield[]
Initial value:
=
"double GetOddlyield( int nNullDate, int nSettle, int nMat, int nLastCoup,\n"
" double fRate, double fPrice, double fRedemp, int nFreq, int nBase ) \n"
"{\n"
" double fFreq = nFreq ;\n"
" double fDCi= GetYearFrac( nNullDate, nLastCoup, nMat, nBase ) * fFreq;\n"
" double fDSCi= GetYearFrac( nNullDate, nSettle, nMat, nBase ) * fFreq;\n"
" double fAi= GetYearFrac( nNullDate, nLastCoup, nSettle, nBase )*fFreq;\n"
" double y = fRedemp + fDCi * 100.0 * fRate / fFreq;\n"
" y /= fPrice + fAi * 100.0 * fRate / fFreq;\n"
" y -= 1.0;\n"
" y *= fFreq / fDSCi;\n"
" return y;\n"
"}\n"

Definition at line 1010 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpOddlyield::BinInlineFun().

◆ GetOddlyieldDecl

const char GetOddlyieldDecl[]
Initial value:
=
"double GetOddlyield( int nNullDate, int nSettle, int nMat, int nLastCoup,\n"
" double fRate, double fPrice, double fRedemp, int nFreq, int nBase );\n"

Definition at line 1006 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpOddlyield::BinInlineFun().

◆ GetPMT

const char GetPMT[]
Initial value:
=
"double GetPMT( double fRate, double fNper, double fPv, double fFv, bool bPayInAdvance )\n"
"{\n"
" double fPayment;\n"
" if (fRate == 0.0)\n"
" fPayment = (fPv + fFv) / fNper;\n"
" else\n"
" {\n"
" if (bPayInAdvance)\n"
" fPayment = (fFv + fPv * exp( fNper * log1p(fRate) ) ) * fRate\n"
" / (expm1( (fNper + 1) * log1p(fRate) ) - fRate);\n"
" else\n"
" fPayment = (fFv + fPv * exp(fNper * log1p(fRate) ) ) * fRate\n"
" / expm1( fNper * log1p(fRate) );\n"
" }\n"
" return -fPayment;\n"
"}\n"

Definition at line 15 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpIPMT::BinInlineFun(), sc::opencl::Cumipmt::BinInlineFun(), sc::opencl::OpCumprinc::BinInlineFun(), sc::opencl::OpPMT::BinInlineFun(), and sc::opencl::OpPPMT::BinInlineFun().

◆ GetPMTDecl

const char GetPMTDecl[]
Initial value:
=
"double GetPMT( double fRate, double fNper, double fPv, double fFv, bool bPayInAdvance);\n"

Definition at line 12 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpIPMT::BinInlineFun(), sc::opencl::Cumipmt::BinInlineFun(), sc::opencl::OpCumprinc::BinInlineFun(), sc::opencl::OpPMT::BinInlineFun(), and sc::opencl::OpPPMT::BinInlineFun().

◆ getPrice

const char getPrice[]
Initial value:
=
"double getPrice(int nSettle, int nMat, double fRate, double fYield,\n"
"double fRedemp, int nFreq, int nBase )\n"
"{\n"
" double fFreq = nFreq;\n"
" double fE = coupdays( nSettle, nMat, nFreq, nBase );\n"
" double fDSC_E = coupdaysnc( nSettle, nMat, nFreq, nBase ) / fE;\n"
" double fN = coupnum( nSettle, nMat, nFreq, nBase );\n"
" double fA = coupdaybs( nSettle, nMat, nFreq, nBase );\n"
" double fRet = fRedemp / ( pow( 1.0 + fYield / fFreq, fN - 1.0 + "
"fDSC_E ) );\n"
" fRet -= 100.0 * fRate / fFreq * fA / fE;\n"
" double fT1 = 100.0 * fRate / fFreq;\n"
" double fT2 = 1.0 + fYield / fFreq;\n"
" for( double fK = 0.0 ; fK < fN ; fK+=1.0 )\n"
" fRet += fT1 / pow( fT2, fK + fDSC_E );\n"
" return fRet;\n"
"}\n"

Definition at line 662 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpYield::BinInlineFun(), and sc::opencl::OpPrice::BinInlineFun().

◆ getPriceDecl

const char getPriceDecl[]
Initial value:
=
"double getPrice(int nSettle, int nMat, double fRate, double fYield,\n"
"double fRedemp, int nFreq, int nBase );\n"

Definition at line 658 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpYield::BinInlineFun(), and sc::opencl::OpPrice::BinInlineFun().

◆ GetYearDiff

const char GetYearDiff[]
Initial value:
=
"double GetYearDiff( int nNullDate, int nStartDate, int nEndDate,"
"int nMode )\n"
"{\n"
" int nDays1stYear;\n"
" int nTotalDays = GetDiffDate( nNullDate, nStartDate, nEndDate,"
"nMode, &"
"nDays1stYear );\n"
" return (double)(nTotalDays) / (double)nDays1stYear;\n"
"}\n"

Definition at line 1249 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpINTRATE::BinInlineFun(), sc::opencl::OpOddlprice::BinInlineFun(), sc::opencl::OpOddlyield::BinInlineFun(), sc::opencl::OpPriceDisc::BinInlineFun(), and sc::opencl::OpReceived::BinInlineFun().

◆ GetYearDiffDecl

const char GetYearDiffDecl[]
Initial value:
=
"double GetYearDiff( int nNullDate, int nStartDate, int nEndDate,"
"int nMode);\n"

Definition at line 1245 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpINTRATE::BinInlineFun(), sc::opencl::OpOddlprice::BinInlineFun(), sc::opencl::OpOddlyield::BinInlineFun(), sc::opencl::OpPriceDisc::BinInlineFun(), and sc::opencl::OpReceived::BinInlineFun().

◆ GetYearFrac

const char GetYearFrac[]

◆ GetYearFracDecl

const char GetYearFracDecl[]

◆ getYield_

const char getYield_[]

Definition at line 685 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpYield::BinInlineFun().

◆ getYield_Decl

const char getYield_Decl[]
Initial value:
=
"double getYield_( int nNullDate, int nSettle, int nMat, double fCoup,"
"double fPrice,double fRedemp, int nFreq, int nBase);\n"

Definition at line 681 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpYield::BinInlineFun().

◆ GetYieldmat

const char GetYieldmat[]
Initial value:
=
"double GetYieldmat( int nNullDate, int nSettle, int nMat, int nIssue,\n"
"double fRate, double fPrice, int nBase )\n"
"{\n"
" double fIssMat = GetYearFrac( nNullDate, nIssue, nMat, nBase );\n"
" double fIssSet = GetYearFrac( nNullDate, nIssue, nSettle, nBase );\n"
" double fSetMat = GetYearFrac( nNullDate, nSettle, nMat, nBase );\n"
" double y = 1.0 + fIssMat * fRate;\n"
" y =y / (fPrice / 100.0 + fIssSet * fRate);\n"
" y-=1.0;\n"
" y = y / fSetMat;\n"
" return y;\n"
"}\n"

Definition at line 739 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpYieldmat::BinInlineFun().

◆ GetYieldmatDecl

const char GetYieldmatDecl[]
Initial value:
=
"double GetYieldmat( int nNullDate, int nSettle, int nMat, int nIssue,\n"
"double fRate, double fPrice, int nBase );\n"

Definition at line 735 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpYieldmat::BinInlineFun().

◆ IsLeapYear

const char IsLeapYear[]

◆ IsLeapYearDecl

const char IsLeapYearDecl[]

◆ lcl_Getcoupdaybs

const char lcl_Getcoupdaybs[]

◆ lcl_GetcoupdaybsDecl

const char lcl_GetcoupdaybsDecl[]
Initial value:
=
"int lcl_Getcoupdaybs(int nNullDate,int nSettle,int nMat,int nFreq,"
"int nBase);\n"

Definition at line 421 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpYield::BinInlineFun(), sc::opencl::OpPrice::BinInlineFun(), sc::opencl::OpCoupdaybs::BinInlineFun(), and sc::opencl::OpCoupdaysnc::BinInlineFun().

◆ lcl_Getcoupdays

const char lcl_Getcoupdays[]

◆ lcl_GetcoupdaysDecl

const char lcl_GetcoupdaysDecl[]
Initial value:
=
"int lcl_Getcoupdays(int nNullDate,int nSettle, "
"int nMat,int nFreq,int nBase);\n"

Definition at line 460 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpYield::BinInlineFun(), sc::opencl::OpPrice::BinInlineFun(), sc::opencl::OpCoupdays::BinInlineFun(), and sc::opencl::OpCoupdaysnc::BinInlineFun().

◆ lcl_GetCoupncd

const char lcl_GetCoupncd[]
Initial value:
=
"int lcl_GetCoupncd(int nNullDate,int nSettle, int nMat,int nFreq,int nBase)\n"
"{\n"
" int aDate = nMat;\n"
" int rDay=0,rMonth=0, rYear=0,rbLastDayMode=0, rbLastDay=0,rb30Days=0,"
"rbUSMode=0,rnDay=0;\n"
" int sDay=0,sMonth=0, sYear=0,sbLastDayMode=0, sbLastDay=0,sb30Days=0,"
"sbUSMode=0,snDay=0;\n"
" ScaDate( nNullDate,nSettle,nBase,&sDay,&sMonth,&sYear,&sbLastDayMode,"
"&sbLastDay,&sb30Days,&sbUSMode,&snDay);\n"
" ScaDate( nNullDate,aDate,nBase,&rDay,&rMonth,&rYear,&rbLastDayMode,"
"&rbLastDay,&rb30Days,&rbUSMode,&rnDay);\n"
" rYear=sYear;\n"
" setDay(rDay,rMonth,rYear,rbLastDay,rb30Days,&rnDay);\n"
" if(checklessthan(sYear,rYear,sMonth,rMonth,snDay,rnDay,sbLastDay,rbLastDay"
",sDay,rDay))\n"
" {\n"
" rYear-=1;\n"
" setDay(rDay,rMonth,rYear,rbLastDay,rb30Days,&rnDay);\n"
" }\n"
" while(!checklessthan(sYear,rYear,sMonth,rMonth,snDay,rnDay,sbLastDay,"
"rbLastDay,sDay,rDay))\n"
" {\n"
" addMonths(rb30Days,rbLastDay,&rnDay,rDay,&rMonth,12/nFreq,&rYear);\n"
" }\n"
" int nLastDay = DaysInMonth( rMonth, rYear );\n"
" int nRealDay = (rbLastDayMode && rbLastDay) ? nLastDay :"
"min( nLastDay, rDay );\n"
" return DateToDays( nRealDay, rMonth, rYear ) - nNullDate;\n"
"}\n"

Definition at line 216 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpCoupncd::BinInlineFun().

◆ lcl_GetCoupncdDecl

const char lcl_GetCoupncdDecl[]
Initial value:
=
"int lcl_GetCoupncd(int nNullDate,int nSettle,int nMat,int nFreq,int nBase);\n"

Definition at line 213 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpCoupncd::BinInlineFun().

◆ lcl_Getcoupnum

const char lcl_Getcoupnum[]

◆ lcl_GetcoupnumDecl

const char lcl_GetcoupnumDecl[]
Initial value:
=
"double lcl_Getcoupnum(int nNullDate,int nSettle,int nMat,int nFreq,int"
" nBase);\n"

Definition at line 504 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpDuration_ADD::BinInlineFun(), sc::opencl::OpMDuration::BinInlineFun(), sc::opencl::OpYield::BinInlineFun(), sc::opencl::OpPrice::BinInlineFun(), and sc::opencl::OpCoupnum::BinInlineFun().

◆ lcl_GetCouppcd

const char lcl_GetCouppcd[]

Definition at line 181 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpCouppcd::BinInlineFun().

◆ lcl_GetCouppcdDecl

const char lcl_GetCouppcdDecl[]
Initial value:
=
"int lcl_GetCouppcd(int nNullDate,int nSettle,int nMat,int nFreq,int nBase);\n"

Definition at line 178 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpCouppcd::BinInlineFun().

◆ RateIteration

const char RateIteration[]

Definition at line 1325 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpRate::BinInlineFun().

◆ RateIterationDecl

const char RateIterationDecl[]
Initial value:
=
"bool RateIteration( double fNper, double fPayment, double fPv,"
" double fFv, bool bPayType, double* fGuess );\n"

Definition at line 1321 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpRate::BinInlineFun().

◆ ScaDate

const char ScaDate[]
Initial value:
=
"void ScaDate( int nNullDate, int nDate, int nBase,int *nOrigDay, "
"int *nMonth,int *nYear,int *bLastDayMode,int *bLastDay,"
"int *b30Days,int *bUSMode,int *nDay)\n"
"{\n"
" DaysToDate( nNullDate + nDate, nOrigDay, nMonth, nYear );\n"
" *bLastDayMode = (nBase != 5);\n"
" *bLastDay = (*nOrigDay >= DaysInMonth( *nMonth, *nYear ));\n"
" *b30Days = (nBase == 0) || (nBase == 4);\n"
" *bUSMode = (nBase == 0);\n"
" if( *b30Days)\n"
" {\n"
" *nDay = min( *nOrigDay, 30);\n"
" if( *bLastDay || (*nDay >=DaysInMonth( *nMonth, *nYear )) )\n"
" *nDay = 30;\n"
" }\n"
" else\n"
" {\n"
" int nLastDay = DaysInMonth( *nMonth, *nYear );\n"
" *nDay = *bLastDay ? nLastDay : min( *nOrigDay, nLastDay );\n"
" }\n"
"}\n"

Definition at line 155 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpMDuration::BinInlineFun(), sc::opencl::OpYield::BinInlineFun(), sc::opencl::OpPrice::BinInlineFun(), sc::opencl::OpPriceDisc::BinInlineFun(), sc::opencl::OpCoupdaybs::BinInlineFun(), sc::opencl::OpCoupdays::BinInlineFun(), sc::opencl::OpCoupdaysnc::BinInlineFun(), sc::opencl::OpCouppcd::BinInlineFun(), sc::opencl::OpCoupncd::BinInlineFun(), and sc::opencl::OpCoupnum::BinInlineFun().

◆ ScaDateDecl

const char ScaDateDecl[]

◆ ScGetDDB

const char ScGetDDB[]
Initial value:
=
"double ScGetDDB(double fCost, double fSalvage, double fLife, double fPeriod,"
"double fFactor)\n"
"{\n"
" double fDdb, fRate, fOldValue, fNewValue;\n"
" fRate = fFactor / fLife;\n"
" if (fRate >= 1.0)\n"
" {\n"
" fRate = 1.0;\n"
" if (fPeriod == 1.0)\n"
" fOldValue = fCost;\n"
" else\n"
" fOldValue = 0.0;\n"
" }\n"
" else\n"
" fOldValue = fCost * pow(1.0 - fRate, fPeriod - 1.0);\n"
" fNewValue = fCost * pow(1.0 - fRate, fPeriod);\n"
" if (fNewValue < fSalvage)\n"
" fDdb = fOldValue - fSalvage;\n"
" else\n"
" fDdb = fOldValue - fNewValue;\n"
" if (fDdb < 0.0)\n"
" fDdb = 0.0;\n"
" return fDdb;\n"
"}\n"

Definition at line 849 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpDDB::BinInlineFun(), and sc::opencl::OpVDB::BinInlineFun().

◆ ScGetDDBDecl

const char ScGetDDBDecl[]
Initial value:
=
"double ScGetDDB(double fCost, double fSalvage, double fLife, double fPeriod,"
"double fFactor);\n"

Definition at line 845 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpDDB::BinInlineFun(), and sc::opencl::OpVDB::BinInlineFun().

◆ ScInterVDB

const char ScInterVDB[]

Definition at line 880 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpVDB::BinInlineFun().

◆ ScInterVDBDecl

const char ScInterVDBDecl[]
Initial value:
=
"double ScInterVDB(double fCost, double fSalvage, double fLife, double fLife1,"
"double fPeriod, double fFactor);\n"

Definition at line 876 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpVDB::BinInlineFun().

◆ setDay

const char setDay[]
Initial value:
=
"void setDay(int nOrigDay, int nMonth,int nYear,int bLastDay,int b30Days,"
"int *nDay)\n"
"{\n"
" if( b30Days )\n"
" {\n"
" *nDay = min( nOrigDay, 30);\n"
" if( bLastDay || (*nDay >= DaysInMonth( nMonth, nYear )) )\n"
" *nDay = 30;\n"
" }\n"
" else\n"
" {\n"
" int nLastDay = DaysInMonth( nMonth, nYear );\n"
" *nDay = bLastDay ? nLastDay : min( nOrigDay, nLastDay );\n"
" }\n"
"}\n"

Definition at line 547 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpMDuration::BinInlineFun(), sc::opencl::OpYield::BinInlineFun(), sc::opencl::OpPrice::BinInlineFun(), sc::opencl::OpCoupdaybs::BinInlineFun(), sc::opencl::OpCoupdays::BinInlineFun(), sc::opencl::OpCoupdaysnc::BinInlineFun(), sc::opencl::OpCouppcd::BinInlineFun(), sc::opencl::OpCoupncd::BinInlineFun(), and sc::opencl::OpCoupnum::BinInlineFun().

◆ setDayDecl

const char setDayDecl[]

◆ VDBImplement

const char VDBImplement[]

Definition at line 928 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpVDB::BinInlineFun().

◆ VDBImplementDecl

const char VDBImplementDecl[]
Initial value:
=
"double VDBImplement(double fCost, double fSalvage, double fLife, double fStart"
", double fEnd, double fFactor, bool bNoSwitch);\n"

Definition at line 924 of file op_financial_helpers.hxx.

Referenced by sc::opencl::OpVDB::BinInlineFun().