Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members

plValues.h

00001 /*=============================================================================
00002  * Product        : OpenPL 
00003  * File           : plValues.h
00004  * Author         : Juan-Manuel Ahuactzin
00005  * Creation       : Wed Mar 21 12:30:16 2001
00006  *
00007  *=============================================================================
00008  *     (c) Copyright 2000, Centre National de la Recherche Scientifique,
00009  *                              all rights reserved
00010  *=============================================================================
00011  *
00012  *------------------------- Description ---------------------------------------
00013  *   
00014  *   
00015  *-----------------------------------------------------------------------------
00016  */
00017 
00018 #ifndef _plValues_h
00019 #define _plValues_h
00020 
00021 #include <plData.h>
00022 #include <plDataValues.h>
00023 #include <plObject.h>
00024 #include <plVariablesConjunction.h>
00025 
00026 
00027 
00028 
00029 /*****************************************************************************
00030  *                           External Classes
00031  *****************************************************************************/
00032 
00033 class kplVariable;
00034 
00035 /*****************************************************************************
00036  *                           Classes Definitions
00037  *****************************************************************************/
00038 
00039 
00040 //=======================================================================
00042 class plValues : public plObject
00043 {
00044 
00045 protected:
00046 
00048   list <kplVariable *> *variable_list;
00049 
00051   map <kplVariable *, int> *map_vector;
00052 
00054   plDataValues *values;
00055 
00056   bool vars_to_be_deleted;
00057   bool values_to_be_deleted;
00058 
00059 
00061   plValues (const list <kplVariable *> &l_d);
00062 
00064   void set_index_variables(const list <kplVariable *> &l_d);
00065 
00068   bool set_variable(kplVariable *variable, const plData &value);
00069 
00071   const plData& operator[](kplVariable *variable) const;
00072   
00074   void Output(ostream &out) const;
00075 
00076 
00077   
00078 public:
00079 
00081   plValues();
00082   
00084   plValues(const plValues& val);
00085   
00088   plValues (const plVariablesConjunction &variable);
00089   
00091   plValues(const plValues& val,  plDataValues *ptr);
00092 
00094   plDataValues to_data_values(const list <kplVariable*> &variable) const;
00095 
00097   plDataValues to_data_values() const;
00098 
00100   void to_data_values( plDataValues *ptr ) const;
00101 
00102 
00103 #ifndef RAVI_INTERFACE
00104 
00105   ~plValues()
00106   {
00107     if(vars_to_be_deleted){
00108       delete variable_list;
00109       delete map_vector;
00110     }
00111     if(values_to_be_deleted && values)
00112       delete values;
00113   };
00114 
00115 #endif
00116 
00117   const plData & operator[](const plVariablesConjunction &variable) const;
00118 
00120   plData & operator[](const plVariablesConjunction &variable);
00121 
00123   plData & operator[](kplVariable *variable);
00124 
00126   plData & operator[](int position);
00127 
00129   const plData & operator[](int position) const;
00130 
00132   unsigned size() const;
00133 
00135   void reset();
00136 
00138   void reset(const plVariablesConjunction &variable);
00139 
00141   bool next();
00142   
00145   bool next(const plVariablesConjunction &variable);
00146 
00148   inline const list <kplVariable *>& get_variable_list() const {return(*variable_list);};
00149   
00150   inline void set_values_address(plDataValues *val)
00151   {
00152     if(values_to_be_deleted) delete values;
00153     values = val;
00154     values_to_be_deleted = false;
00155   }
00156   
00157   inline void set_values_values(const plDataValues &val)
00158   {
00159     *values = val;
00160   }
00161 
00162   plValues& operator=(const plValues &v);
00163  
00164   bool operator==(const plValues &v) const;
00165   
00166   bool operator!=(const plValues &v) const {return !(*this == v);}
00167   
00168   
00169   bool operator<(const plValues &v) const;
00170   
00171   bool operator>=(const plValues &v) const{return !(*this < v);}
00172   
00173   
00174   bool operator>(const plValues &v) const;
00175   
00176   bool operator<=(const plValues &v) const{return !(*this > v);}
00177   
00178   
00181   void rename(const plVariablesConjunction &new_variable);
00182   
00183 
00184   friend class kpl1dGauss;
00185   friend class kplCDerivativeFunction;
00186   friend class kplConditional1dGauss;
00187   friend class kplConditionalBellShape;
00188   friend class kplConditionalGauss;
00189   friend class kplConditionalKernel;
00190   friend class kplDescription;
00191   friend class kplDerivativeFunction;
00192   friend class kplDirac;
00193   friend class kplDistribution;
00194   friend class kplExternalProbCFunction;
00195   friend class kplExternalProbFunction;
00196   friend class kplFormalFunction;
00197   friend class kplFormalCFunction;
00198   friend class kplFunctionalDirac;
00199   friend class kplGauss;
00200   friend class kplKernelMask;
00201   friend class kplUnknown;
00202   friend class kplKamelExpression;
00203   friend class kplKernel;
00204   friend class kplAnonymousKernel;
00205   friend class kplCndAnonymousKernel;
00206 
00207   friend class plCndBellShape;
00208   friend class plCndKernel;
00209   friend class plCndNormal;
00210   friend class plComputableObject;
00211   friend class plDirac;
00212   friend class plJointDistribution;
00213   friend class plKernel;
00214   friend class plKernelTable;
00215   friend class plNormal;
00216   friend class plUnknown;
00217   friend class plKernelMap;
00218  
00219 };
00220 
00221 #endif
00222 
00223 
00224 
00225 
00226 
00227 

Generated on Fri Apr 1 10:58:15 2005 for ProBT by  doxygen 1.4.1