Ejemplo n.º 1
0
int testmaxmin() {
	vector<double> x;
	x.push_back(1);
	x.push_back(2);
	x.push_back(3);
	x.push_back(1.1);
	x.push_back(1);
	x.push_back(9);
	x.push_back(1.01);
	x.push_back(11);
	x.push_back(0.001);
	vector<double> U(x.size()),L(x.size());
	vector<double> U2(x.size()),L2(x.size());
	for(uint constraint = 0; constraint<x.size(); ++constraint) {
		
		computeEnvelope(x,constraint,U,L);
		Envelope env;
		env.compute(x,constraint,U2,L2);
		if((U!=U2) or (L!=L2)) { cout<< "bug! "<<constraint<<endl;
		cout <<" x U L U2 L2"<<endl;
		for(uint k = 0; k<x.size();++k)
		  cout<<"k="<<k<<" "<<x[k]<<" "<< U[k]<<" "<< L[k]<<" " <<U2[k]<<" "<< L2[k]<<endl;
		}
		return -1;
	}
	return 0;
	
}
Ejemplo n.º 2
0
//----------------------------------------------------------------------------------
void
TSPLib::computePath( void )
{
    // remove any existing path
    m_nbEdges = 0 ;

    // compute enveloppe
    computeEnvelope() ;

    // reduce enveloppe
    reduceEnvelope( m_nbPoints ) ;

    // optimize path
    localOptimization() ;
}