Modelib: InternalConstraint.h Source File

Page principale | Hiérarchie des classes | Liste des composants | Liste des fichiers | Composants

# InternalConstraint.h

    00001 #ifndef __INTERNALCONSTRAINT_H
    00002 #define __INTERNALCONSTRAINT_H
    00003
    00005 struct InternalConstraint
    00006 {
    00007     enum Type {INF,SUP,EGAL,INFSTRICT,SUPSTRICT};
    00008     Type type;
    00009     float b;
    00010     float activity;
    00011     float lagrangianValue;
    00012     std::string name;
    00013     bool isLagrangianParamDefined;
    00014     bool isLagrangianParamActive;
    00015
    00016
    00018     InternalConstraint(InternalConstraint::Type _type = InternalConstraint::INF,
    00019                        float _b = 0.0f,
    00020                        float _activity = 0.0f,
    00021                        float _lagrangianValue = 0.0f,
    00022                        std::string _name = "",
    00023                        bool _isLagrangianParamDefined = false,
    00024                        bool _isLagrangianParamActive = false)
    00025     : type(_type),
    00026       b(_b),
    00027       activity(_activity),
    00028       lagrangianValue(_lagrangianValue),
    00029       name(_name),
    00030       isLagrangianParamDefined(_isLagrangianParamDefined),
    00031       isLagrangianParamActive(_isLagrangianParamActive)
    00032      {}
    00040     InternalConstraint(const InternalConstraint &_iC)
    00041     {
    00042         *this =_iC;
    00043     }
    00045     InternalConstraint & operator=(const InternalConstraint &_iC)
    00046     {
    00047        if(this != &_iC)
    00048        {
    00049           type=_iC.type;
    00050           b=_iC.b;
    00051           activity =_iC.activity;
    00052           lagrangianValue =_iC.lagrangianValue;
    00053           name =_iC.name;
    00054           isLagrangianParamDefined =_iC.isLagrangianParamDefined;
    00055           isLagrangianParamActive =_iC.isLagrangianParamActive;
    00056        }
    00057        return *this;
    00058     }
    00059     ~InternalConstraint() {}
    00060 };
    00061
    00062 #endif
    00063