00001 00002 // $Source: /space/CVS-Acro/acro/packages/appspack/appspack/src/APPSPACK_Directions.hpp,v $ 00003 00004 //@HEADER 00005 // ************************************************************************ 00006 // 00007 // APPSPACK: Asynchronous Parallel Pattern Search 00008 // Copyright (2003) Sandia Corporation 00009 // 00010 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive 00011 // license for use of this work by or on behalf of the U.S. Government. 00012 // 00013 // This library is free software; you can redistribute it and/or modify 00014 // it under the terms of the GNU Lesser General Public License as 00015 // published by the Free Software Foundation; either version 2.1 of the 00016 // License, or (at your option) any later version. 00017 // 00018 // This library is distributed in the hope that it will be useful, but 00019 // WITHOUT ANY WARRANTY; without even the implied warranty of 00020 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00021 // Lesser General Public License for more details. 00022 // 00023 // You should have received a copy of the GNU Lesser General Public 00024 // License along with this library; if not, write to the Free Software 00025 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00026 // USA. . 00027 // 00028 // Questions? Contact Tammy Kolda (tgkolda@sandia.gov) 00029 // 00030 // ************************************************************************ 00031 //@HEADER 00032 00038 #ifndef APPSPACK_DIRECTIONS_HPP 00039 #define APPSPACK_DIRECTIONS_HPP 00040 00041 #include "APPSPACK_Point.hpp" 00042 #include "APPSPACK_Parameter_List.hpp" 00043 #include "APPSPACK_Constraints_Linear.hpp" 00044 00045 namespace APPSPACK 00046 { 00047 00049 00079 class Directions 00080 { 00081 00082 public: 00083 00085 00089 Directions(Parameter::List& params, const Constraints::Linear& constraints_in); 00090 00092 ~Directions(); 00093 00095 00097 00102 void getDirectionIndices(vector<int>& idvector) const; 00103 00105 const Vector& getDirection(int i) const; 00106 00108 double getStep(int i) const; 00109 00111 void setStepConverged(int i); 00112 00114 00118 bool isStepConverged() const; 00119 00121 bool empty() const; 00123 00124 00126 00170 void computeNewDirections(const Point& newPoint); 00171 00173 00192 void appendNewDirections(); 00193 00195 void setTrueStepAndTag(int i, double trueStep_in, int tag_in); 00196 00198 00205 void reduceStep(int i); 00206 00208 00210 00212 void print(const string label) const; 00213 00215 double getSmallestStep() const; 00217 00218 private: 00219 00221 00243 void buildNormalCone(Matrix& VpT, Matrix& VlT) const; 00244 00246 00260 void buildTangentCone(const Matrix& VpT, const Matrix& VlT, 00261 Matrix& T); 00262 00264 00268 void buildWithNothing(Matrix& D); 00269 00271 00286 bool buildWithCddlib(const Matrix& VpT, const Matrix& VlT, 00287 Matrix& T); 00288 00290 00316 bool buildWithLapack(const Matrix& VpT, const Matrix& VlT, 00317 Matrix& T); 00318 00320 00322 00324 void generateUnconstrained(Matrix& D); 00325 00351 void generateForLinear(Matrix& D); 00352 00354 00370 void addNormalDirections(const Matrix& VpT, const Matrix& VlT, 00371 Matrix& D); 00372 00374 00389 void addCompassDirections(const Matrix& VlT, Matrix& D); 00390 00392 00418 bool updateConstraintState(double newStep); 00419 00421 00429 void updateDirectionInfo(double newStep, bool isAppend=false); 00431 00432 private: 00433 00435 const Constraints::Linear& constraints; 00436 00438 const int nDimensions; 00439 00441 const Vector zero; 00442 00444 const double stepTolerance; 00445 00447 const double minStep; 00448 00450 const double theta; 00451 00453 const double epsilonMax; 00454 00456 int nDirections; 00457 00459 Matrix direction; 00460 00462 Vector step; 00463 00465 00468 Vector trueStep; 00469 00471 00474 vector<int> tag; 00475 00477 Vector tmpVector; 00478 00480 mutable vector<int> idxVector; 00481 00483 00494 map< vector<Constraints::ActiveType>, Matrix> directionCache; 00495 00497 map< vector<Constraints::ActiveType>, Matrix>::iterator cacheIter; 00498 00500 00505 vector<Constraints::ActiveType> constraintState; 00506 00508 double epsilonMin; 00509 00511 bool withNormals; 00512 00514 bool withCompass; 00515 00517 int nCached; 00518 00520 int nLapack; 00521 00523 int nCddlib; 00524 00526 int nMaxDirections; 00527 00529 int nAppend; 00530 00532 Vector xDistance; 00533 00534 }; 00535 00536 } 00537 00538 #endif
![]()
© Sandia Corporation | Site Contact | Privacy and Security
![]()
Generated on Fri Feb 16 10:33:35 2007 for APPSPACK 5.0.1 by
1.3.9.1 written by Dimitri van Heesch,
© 1997-2002