Login  Register

Re: Error in compiling of QuantLib examples

Posted by Yannis on Jan 25, 2017; 5:02pm
URL: http://quantlib.414.s1.nabble.com/Error-in-compiling-of-QuantLib-examples-tp17991p17995.html

You 're welcome!

Add the following code defining the default constructor inside the AddCashFlowAmounts class:

AddCashFlowAmounts() : cashFlowSum(0), simpleCashFlowSum(0), redemptionSum(0), amortizingPaymentSum(0) {}

This should initialize the variables to 0 when you call AddCashFlowAmounts addCashFlowsVisitor; inside the calcCashFlowSums function.

Regards.
Ioannis


ziegele <[hidden email]> schrieb am 16:11 Mittwoch, 25.Januar 2017:


Thanks Yannis! It indeed fixes this error.

However, if I try to assign different types of inputs into the cashFlows
vector:

<http://quantlib.10058.n7.nabble.com/file/n17994/input.jpg>

I got SimpleCashFlow and Redemption calculated correctly, but
AmortizingPayment didn't calculate:

<http://quantlib.10058.n7.nabble.com/file/n17994/output.jpg>

Do you know why? Complete source code is also attached.

main.cpp <http://quantlib.10058.n7.nabble.com/file/n17994/main.cpp

Thanks.



--
View this message in context: http://quantlib.10058.n7.nabble.com/Error-in-compiling-of-QuantLib-examples-tp17991p17994.html

Sent from the quantlib-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users