~ubuntu-branches/ubuntu/maverick/openturns/maverick

« back to all changes in this revision

Viewing changes to lib/test/t_TNC_linear.cxx

  • Committer: Bazaar Package Importer
  • Author(s): Fabrice Coutadeur
  • Date: 2009-08-18 18:14:38 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20090818181438-copqi92r4z7y0ejc
Tags: 0.13.1-1ubuntu1
debian/python-openturns.install: update to use python* and *-packages.
This fix a FTBFS with python2.6.  (LP: #350437)

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
21
21
 *
22
22
 *  @author: $LastChangedBy: dutka $
23
 
 *  @date:   $LastChangedDate: 2009-01-08 13:33:24 +0100 (jeu 08 jan 2009) $
24
 
 *  Id:      $Id: t_TNC_linear.cxx 1061 2009-01-08 12:33:24Z dutka $
 
23
 *  @date:   $LastChangedDate: 2009-05-28 14:47:53 +0200 (jeu. 28 mai 2009) $
 
24
 *  Id:      $Id: t_TNC_linear.cxx 1262 2009-05-28 12:47:53Z dutka $
25
25
 */
26
26
#include <iostream>
27
27
#include <cmath>
30
30
 
31
31
#include "OT.hxx"
32
32
#include "OTtestcode.hxx"
 
33
#include "OStream.hxx"
33
34
#include "NumericalMathFunction.hxx"
34
35
#include "Exception.hxx"
35
36
#include "TNC.hxx"
38
39
using namespace OT;
39
40
using namespace OT::Test;
40
41
using namespace OT::Base::Common;
 
42
using namespace OT::Base::Common;
41
43
using namespace OT::Base::Type;
42
44
using namespace OT::Base::Func;
43
45
using namespace OT::Base::Optim;
58
60
int main(int argc, char *argv[])
59
61
{
60
62
  TESTPREAMBLE;
 
63
  OStream fullprint(std::cout);
61
64
 
62
65
  try {
63
66
 
69
72
      Interval bounds(NumericalPoint(4, -3.0), NumericalPoint(4, 5.0));
70
73
      TNC myAlgorithm(specific, levelFunction, bounds, startingPoint, TNC::MINIMIZATION);
71
74
      myAlgorithm.run();
72
 
      std::cout << "minimizer = " << printNumericalPoint(myAlgorithm.getResult().getOptimizer(), 4) << " value=" << myAlgorithm.getResult().getOptimalValue() << std::endl;
 
75
      fullprint << "minimizer = " << printNumericalPoint(myAlgorithm.getResult().getOptimizer(), 4) << " value=" << myAlgorithm.getResult().getOptimalValue() << std::endl;
73
76
      myAlgorithm = TNC(specific, levelFunction, bounds, startingPoint, TNC::MAXIMIZATION);
74
77
      myAlgorithm.run();
75
 
      std::cout << "maximizer = " << printNumericalPoint(myAlgorithm.getResult().getOptimizer(), 4) << " value=" << myAlgorithm.getResult().getOptimalValue() << std::endl;
 
78
      fullprint << "maximizer = " << printNumericalPoint(myAlgorithm.getResult().getOptimizer(), 4) << " value=" << myAlgorithm.getResult().getOptimalValue() << std::endl;
76
79
    }
77
80
    catch (NoWrapperFileFoundException & ex) {
78
 
      throw TestFailed(ex.str());
 
81
      throw TestFailed(ex.__repr__());
79
82
    }
80
83
 
81
84