Put in a string the result of optimization

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Put in a string the result of optimization

Francesco Perissin

Hi all,
I need to put in a string the resulting message of an optimization problem. The message is available as an ostream by invoking the << operator applied to an EndCriteria::Type object.
Thanks
Francesco


------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Put in a string the result of optimization

Luigi Ballabio
On Mon, 2011-03-21 at 12:25 +0100, Francesco Perissin wrote:
> Hi all,
> I need to put in a string the resulting message of an optimization
> problem. The message is available as an ostream by invoking the <<
> operator applied to an EndCriteria::Type object.

Ciao Francesco,

#include <sstream>

std::ostringstream out;
out << end_criteria;
std::string s = out.str();

See you,
        Luigi




--

Weiler's Law:
Nothing is impossible for the man who doesn't have to
do it himself.



------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

R: Re: Put in a string the result of optimization

Francesco Perissin

Thanks!
Francesco

Il giorno 21 mar, 2011 1:53 p., "Luigi Ballabio" <[hidden email]> ha scritto:

On Mon, 2011-03-21 at 12:25 +0100, Francesco Perissin wrote: > Hi all, > I need to put in a string t...

Ciao Francesco,

#include <sstream>

std::ostringstream out;
out << end_criteria;
std::string s = out.str();

See you,
       Luigi




--

Weiler's Law:
Nothing is impossible for the man who doesn't have to
do it himself.



------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users