Sandia Home Sandia Home
Main Page | Publications | Downloads | Configuration | Running the Code | Solver Parameters | FAQ | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

APPSPACK_Constraints_Linear.hpp

Go to the documentation of this file.
00001 // $Id: APPSPACK_Constraints_Linear.hpp,v 1.59.2.1 2007/01/14 21:51:27 jgriffi Exp $ 
00002 // $Source: /space/CVS-Acro/acro/packages/appspack/appspack/src/APPSPACK_Constraints_Linear.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
00038 #ifndef APPSPACK_CONSTRAINTS_LINEAR_HPP
00039 #define APPSPACK_CONSTRAINTS_LINEAR_HPP
00040 
00041 #include "APPSPACK_Vector.hpp"
00042 #include "APPSPACK_Matrix.hpp"
00043 #include "APPSPACK_Parameter_List.hpp"
00044 
00045 namespace APPSPACK
00046 {
00047 
00049 namespace Constraints
00050 {
00051 
00055 enum StateType {
00057   DNE,
00059   Violated,
00061   Active,
00063   Inactive
00064 };
00065 
00067 enum BoundType {
00069   UpperBound,
00071   LowerBound
00072 };
00073 
00074 
00084 enum ActiveType {
00086   NeitherActive,
00088   LowerActive,
00090   UpperActive,
00092   BothActive
00093 };
00094   
00095 
00097 
00203 class Linear
00204 {
00205 
00206 public:
00208 
00212   Linear(Parameter::List& params);
00213 
00215   ~Linear();
00216 
00217 
00219 
00220   double getEpsMach() const;
00221 
00223   const Vector& getScaling() const;
00224 
00226   const Vector& getLower() const;
00227 
00229   const Vector& getUpper() const;
00230   
00232   const Vector& getBhatLower() const;
00233 
00235   const Vector& getBhatUpper() const;
00236 
00238   const Vector& getBtildeEq() const;
00239 
00241   const Matrix& getAhat() const;
00242 
00244   const Matrix& getAtildeEq() const;
00245 
00247 
00248   void getNominalX(Vector& x) const;
00249   
00251 
00253 
00254 
00255   void scale(Vector& x) const;
00256   
00258 
00259   void unscale(Vector& w) const;
00260 
00262   
00264 
00265 
00270   bool isFeasible(const Vector& x) const;
00271   
00273   void assertFeasible(const Vector& x) const;
00274   
00276 
00278 
00280   bool isBoundsOnly() const;
00281 
00283 
00317   double maxStep(const Vector& x, const Vector& d, double step) const;
00318 
00320 
00345   void getActiveIndex(const Vector& xdist, double epsilon, vector<ActiveType>& index) const;
00346 
00348 
00405   void formDistanceVector(const Vector& x, Vector& xdist) const;
00406 
00408 
00441   void snapToBoundary(Vector& x, double esnap) const;
00442 
00444 
00456   void makeBoundsFeasible(Vector& x) const;
00457 
00459 
00460   void formSnapSystem(const Vector& xtilde, double esnap,
00461                       Matrix& Asnap, Vector& bsnap) const;
00462 
00464 
00466   void print() const;
00467 
00468 private:
00469 
00471 
00473   void setup(Parameter::List& params);
00474 
00476   void setupBounds(Parameter::List& params);
00477 
00479   void setupScaling(Parameter::List& params);
00480   
00482   void setupRhs(Parameter::List& params);
00483   
00485   void setupMatrix(Parameter::List& params);
00486 
00488   void setupScaledSystem();  
00489 
00491 
00493 
00495 
00526   StateType getIneqState(int i, BoundType bType, const Vector& xTilde, double epsilon = -1) const;
00527 
00529 
00558   StateType getEqState(int i, const Vector& xTilde, double epsilon = -1) const;
00559 
00561 
00562   bool isEqualityFeasible(const Vector& xtilde) const;
00563 
00565 
00566   bool isInequalityFeasible(const Vector& xtilde) const;
00567 
00569 
00571   void error(const string& fname, const string& msg) const;
00572   
00574   void errorCheck() const;
00575 
00576 private:
00577   
00579   const double epsMach;
00580 
00584   bool displayMatrix;
00585 
00587   Vector scaling;
00588   
00590   Vector bLower;
00591   
00593   Vector bUpper;
00594 
00596 
00597   Matrix aIneq;
00598 
00600   Matrix aEq;
00601 
00603   Vector bIneqLower;
00604 
00606   Vector bIneqUpper;
00607 
00609   Vector bEq;
00611 
00613 
00614   Matrix aHat;
00615 
00617   Vector aHatZNorm;
00618 
00620   Vector aHatNorm;
00621  
00623   Vector bHatLower;
00624 
00626   Vector bHatUpper;
00627 
00629   Matrix aTildeEq;
00630 
00632   Vector bTildeEq;
00633 
00635 
00637   Vector lHat;
00639 
00640 };
00641 
00642 }
00643 }
00644 
00645 #endif 

 

© Sandia Corporation | Site Contact | Privacy and Security

Generated on Fri Feb 16 10:33:34 2007 for APPSPACK 5.0.1 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2002