Login  Register

problem with Problem

Posted by Simon Ibbotson-2 on Apr 17, 2012; 8:28am
URL: http://quantlib.414.s1.nabble.com/problem-with-Problem-tp11790.html

problem with Problem

Possibly this should be submitted as a bug-fix

Why does the class Problem store a reference to the CostFunction and a reference to the Constraint?

This seems incredibly bad programming / commenting. A call to create a Problem class of the form:

Problem prob(preCreatedCostFunction, PositiveConstraint(), initialValues);

will fail unpredictably at optimisation time as the Constraint is no longer a valid reference.

If you want to force the CostFunction and the Constraint to be pre-created at the very least this should be commented, better would be to pass a shared pointer (which could be tested).


Simon



This communication and any attachments contains information which is confidential and may be subject to legal privilege. It is for intended recipients only. If you are not the intended recipient you must not copy, distribute, publish, rely on or otherwise use it without our consent. Some of our communications may contain confidential information which it could be a criminal offence for you to disclose or use without authority. If you have received this email in error please notify [hidden email] immediately and delete the email from your computer.

The FSA reserves the right to monitor all email communications for compliance with legal, regulatory and professional standards.

This email is not intended to nor should it be taken to create any legal relations or contractual relationships. This email has originated from

The Financial Services Authority (FSA)
25 The North Colonnade,
Canary Wharf,
London
E14 5HS
United Kingdom

Registered as a Limited Company in England and Wales No.1920623.
Registered Office as above

Switchboard: 020 7066 1000
Web Site: http://www.fsa.gov.uk
*****************************************************************


------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev