Page principale | Liste des namespaces | Hiérarchie des classes | Liste alphabétique | Liste des classes | Liste des fichiers | Membres de namespace | Membres de classe | Membres de fichier

InternalConstraint.h

Aller à la documentation de ce fichier.
00001 /*
00002     Copyright (c) 2005, Quentin Lequy and Romain Gaucher
00003     All rights reserved.
00004 
00005     Redistribution and use in source and binary forms, with or 
00006     without modification, are permitted provided that the following 
00007     conditions are met:
00008 
00009         * Redistributions of source code must retain the above copyright 
00010           notice, this list of conditions and the following disclaimer.
00011 
00012         * Redistributions in binary form must reproduce the above copyright 
00013           notice, this list of conditions and the following disclaimer in the 
00014           documentation and/or other materials provided with the distribution.
00015 
00016         * Neither the name of Quentin Lequy or Romain Gaucher nor the names 
00017           of its contributors may be used to endorse or promote products 
00018           derived from this software without specific prior written permission.
00019 
00020     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
00021     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
00022     IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
00023     ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 
00024     LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 
00025     DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
00026     SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
00027     AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
00028     (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
00029     SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00030 */
00031 
00032 #ifndef __INTERNALCONSTRAINT_H
00033 #define __INTERNALCONSTRAINT_H
00034 
00035 namespace Modelib {
00036 
00038 struct InternalConstraint
00039 {
00040     enum Type {INF,SUP,EGAL,INFSTRICT,SUPSTRICT};
00041     Type type;
00042     float b;
00043     float activity;
00044     float lagrangianValue;
00045     std::string name;
00046     bool isLagrangianParamDefined;
00047     bool isLagrangianParamActive;
00048 
00049 
00051     InternalConstraint(InternalConstraint::Type _type = InternalConstraint::INF,
00052                        float _b = 0.0f,
00053                        float _activity = 0.0f,
00054                        float _lagrangianValue = 0.0f,
00055                        std::string _name = "",
00056                        bool _isLagrangianParamDefined = false,
00057                        bool _isLagrangianParamActive = false)
00058     : type(_type),
00059       b(_b),
00060       activity(_activity),
00061       lagrangianValue(_lagrangianValue),
00062       name(_name),
00063       isLagrangianParamDefined(_isLagrangianParamDefined),
00064       isLagrangianParamActive(_isLagrangianParamActive)
00065      {}
00073     InternalConstraint(const InternalConstraint &_iC)
00074     {
00075         *this =_iC;
00076     }
00078     InternalConstraint & operator=(const InternalConstraint &_iC)
00079     {
00080        if(this != &_iC)
00081        {
00082           type=_iC.type;
00083           b=_iC.b;
00084           activity =_iC.activity;
00085           lagrangianValue =_iC.lagrangianValue;
00086           name =_iC.name;
00087           isLagrangianParamDefined =_iC.isLagrangianParamDefined;
00088           isLagrangianParamActive =_iC.isLagrangianParamActive;
00089        }
00090        return *this;
00091     }
00092     ~InternalConstraint() {}
00093 };
00094 
00095 }
00096 
00097 #endif
00098 

Généré le Sun Oct 2 19:13:11 2005 pour Modelib par  doxygen 1.4.4