* \brief Float variables * * \ingroup TaskModelFloatVars */
| 868 | * \ingroup TaskModelFloatVars |
| 869 | */ |
| 870 | class FloatVar : public VarImpVar<Float::FloatVarImp> { |
| 871 | friend class FloatVarArray; |
| 872 | friend class FloatVarArgs; |
| 873 | private: |
| 874 | using VarImpVar<Float::FloatVarImp>::x; |
| 875 | /** |
| 876 | * \brief Initialize variable with range domain |
| 877 | * |
| 878 | * The variable is created with a domain ranging from \a min |
| 879 | * to \a max. No exceptions are thrown. |
| 880 | */ |
| 881 | void _init(Space& home, FloatNum min, FloatNum max); |
| 882 | public: |
| 883 | /// \name Constructors and initialization |
| 884 | //@{ |
| 885 | /// Default constructor |
| 886 | FloatVar(void); |
| 887 | /// Initialize from float variable \a y |
| 888 | FloatVar(const FloatVar& y); |
| 889 | /// Initialize from float view \a y |
| 890 | FloatVar(const Float::FloatView& y); |
| 891 | /** |
| 892 | * \brief Initialize variable with range domain |
| 893 | * |
| 894 | * The variable is created with a domain ranging from \a min |
| 895 | * to \a max. The following exceptions might be thrown: |
| 896 | * - If \a min is greater than \a max, an exception of type |
| 897 | * Gecode::Float::VariableEmptyDomain is thrown. |
| 898 | * - If \a min or \a max exceed the limits for floats as defined |
| 899 | * in Gecode::Float::Limits, an exception of type |
| 900 | * Gecode::Float::OutOfLimits is thrown. |
| 901 | */ |
| 902 | GECODE_FLOAT_EXPORT FloatVar(Space& home, FloatNum min, FloatNum max); |
| 903 | //@} |
| 904 | |
| 905 | /// \name Value access |
| 906 | //@{ |
| 907 | /// Return domain |
| 908 | FloatVal domain(void) const; |
| 909 | /// Return minimum of domain |
| 910 | FloatNum min(void) const; |
| 911 | /// Return maximum of domain |
| 912 | FloatNum max(void) const; |
| 913 | /// Return median of domain |
| 914 | FloatNum med(void) const; |
| 915 | /// Return size of domain (distance between maximum and minimum) |
| 916 | FloatNum size(void) const; |
| 917 | /** |
| 918 | * \brief Return assigned value |
| 919 | * |
| 920 | * Throws an exception of type Float::ValOfUnassignedVar if variable |
| 921 | * is not yet assigned. |
| 922 | * |
| 923 | */ |
| 924 | FloatVal val(void) const; |
| 925 | |
| 926 | //@} |
| 927 |
no outgoing calls
no test coverage detected