Changeset 101


Ignore:
Timestamp:
Oct 31, 2006 9:54:20 PM (12 years ago)
Author:
pbonami
Message:

Fixes a problem with random point generation with filter, and two small leaks

Location:
branches/devel/Bonmin/src/Interfaces
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/devel/Bonmin/src/Interfaces/BonOsiTMINLPInterface.cpp

    r99 r101  
    1010// Date : 12/01/2004
    1111
     12#include "BonminConfig.h"
    1213
    1314#include "BonOsiTMINLPInterface.hpp"
     
    23292330{
    23302331  if (IsValid(app_)) {
     2332#ifdef COIN_HAS_FSQP
     2333    FilterSolver * filter = dynamic_cast<FilterSolver *>(Ipopt::GetRawPtr(app_));
     2334#endif
    23312335    app_->Options()->GetNumericValue("max_random_point_radius",maxRandomRadius_,"bonmin.");
     2336
     2337#ifdef COIN_HAS_FSQP
     2338    if(filter && maxRandomRadius_ > 10.){
     2339      std::cerr<<"filterSqp picking a random point with a big value seems not to work well setting max_random_point_radius to 10"<<std::endl;
     2340      maxRandomRadius_ = 10.;
     2341    }
     2342#endif
    23322343    app_->Options()->GetIntegerValue("num_retry_unsolved_random_point", numRetryUnsolved_,"bonmin.");
    23332344    app_->Options()->GetIntegerValue("num_resolve_at_root", numRetryInitial_,"bonmin.");
  • branches/devel/Bonmin/src/Interfaces/Filter/BonFilterSolver.cpp

    r93 r101  
    305305FilterSolver::OptimizeTNLP(const Ipopt::SmartPtr<Ipopt::TNLP> & tnlp)
    306306{
     307  cached_ = NULL;
    307308  cached_ = new cachedInfo(tnlp, options_);
    308309  return callOptimizer();
     
    329330  g = cached_->g_;
    330331//Permutation to apply to jacobian in order to get it row ordered
    331   permutationJac = cached_->transposed;
     332  permutationJac = cached_->permutationJac_;
     333  permutationHess = cached_->permutationHess_;
    332334
    333335
     
    403405  tnlp->eval_jac_g( (int) n, NULL, 0,(int) m , (int) nnz_jac_g,  RowJac,  ColJac, NULL);
    404406
    405   permutationJac = transposed = new int [nnz_jac_g];
    406   TMat2RowPMat(n, m, nnz_jac_g,  RowJac, ColJac, transposed,
     407  permutationJac = permutationJac_ = new int [nnz_jac_g];
     408  TMat2RowPMat(n, m, nnz_jac_g,  RowJac, ColJac, permutationJac,
    407409               la, n);
    408410
     
    412414
    413415  // Now setup hessian
    414   permutationHess = new int[nnz_h];
     416  permutationHess = permutationHess_ = new int[nnz_h];
    415417  for(int i = 0 ; i < nnz_h ; i++) permutationHess[i] = i;
    416418  hStruct_ = new fint[nnz_h + n + 3];
  • branches/devel/Bonmin/src/Interfaces/Filter/BonFilterSolver.hpp

    r90 r101  
    179179    Ipopt::TNLP * tnlp_;
    180180    fint * hStruct_;
    181     int * transposed;
     181    int * permutationJac_;
     182    int * permutationHess_;
    182183    /** Elapsed CPU time in last optimization. */
    183184    double cpuTime_;
     
    217218     tnlp_(NULL),
    218219     hStruct_(NULL),
    219      transposed(NULL),
     220     permutationJac_(NULL),
     221     permutationHess_(NULL),
    220222     cpuTime_(0)
    221223    {}
     
    254256     tnlp_(NULL),
    255257     hStruct_(NULL),
    256      transposed(NULL),
     258     permutationJac_(NULL),
     259     permutationHess_(NULL),
    257260     cpuTime_(0)   {
    258261      initialize(tnlp, options);
     
    281284      delete [] istat;
    282285      delete [] rstat;
    283       delete [] transposed;
     286      delete [] permutationJac_;
     287      delete [] permutationHess_;
    284288      delete [] hStruct_;
    285289      tnlp_ = NULL;
Note: See TracChangeset for help on using the changeset viewer.