Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

infb_evaluator.h

Go to the documentation of this file.
00001 // Infinity Bound Evaluator implementation -*- C++ -*-
00002 
00003 // Copyright (C) 2001-2003 Hermann Schichl, Knut Petras
00004 //
00005 // This file is part of the COCONUT API.  This library
00006 // is free software; you can redistribute it and/or modify it under the
00007 // terms of the Library GNU General Public License as published by the
00008 // Free Software Foundation; either version 2, or (at your option)
00009 // any later version.
00010 
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 // Library GNU General Public License for more details.
00015 
00016 // As a special exception, you may use this file as part of a free software
00017 // library without restriction.  Specifically, if other files instantiate
00018 // templates or use macros or inline functions from this file, or you compile
00019 // this file and link it with other files to produce an executable, this
00020 // file does not by itself cause the resulting executable to be covered by
00021 // the Library GNU General Public License.  This exception does not however
00022 // invalidate any other reasons why the executable file might be covered by
00023 // the Library GNU General Public License.
00024 
00027 #ifndef _INFB_EVALUATOR_H_
00028 #define _INFB_EVALUATOR_H_
00029 
00030 #include <coconut_config.h>
00031 #include <evaluator.h>
00032 #include <expression.h>
00033 #include <model.h>
00034 #include <eval_main.h>
00035 #include <linalg.h>
00036 #include <math.h>
00037 #include <infb.h>
00038 
00039 using namespace vgtl;
00040 
00041 typedef infbound (*infbound_evaluator)(const std::vector<infbound>* __x,
00042                                  const variable_indicator& __v);
00043 
00044 struct infbound_eval_type
00045 {
00046   const std::vector<infbound>* x;
00047   std::vector<infbound>* cache;
00048   const model* mod;
00049   void *p;
00050   infbound d;
00051   int info;
00052   infbound r;
00053   unsigned int n;
00054 };
00055 
00056 class infbound_eval : public
00057   cached_forward_evaluator_base<infbound_eval_type,expression_node,infbound,
00058                                 model::walker>
00059 {
00060 private:
00061   typedef cached_forward_evaluator_base<infbound_eval_type,expression_node,
00062                                         infbound,model::walker> _Base;
00063 
00064 protected:
00065   bool is_cached(const node_data_type& __data)
00066   {
00067     if(__data.operator_type == EXPRINFO_LIN ||
00068        __data.operator_type == EXPRINFO_QUAD)
00069       return true;
00070     else
00071       return false;
00072 #if 0
00073     if(eval_data.cache && __data.n_parents > 1 && __data.n_children > 0)
00074       return true;
00075     else
00076       return false;
00077 #endif
00078   }
00079 
00080 private:
00081   /*  infbound __power(double __coeff, infbound __x, int __exp)
00082   {
00083     if(__exp == 0)
00084       return 1.;
00085     else
00086     {
00087       infbound k = __coeff*__x;
00088       switch(__exp)
00089       {
00090         case 1:
00091           return k;
00092           break;
00093         case 2:
00094           return sqr(k);
00095           break;
00096         case -1:
00097           return 1./k;
00098           break;
00099         case -2:
00100           return 1./sqr(k);
00101           break;
00102         default:
00103           return ipow(k, __exp);
00104           break;
00105       }
00106     }
00107     return 0;           // we never come here!
00108   }
00109   */
00110 public:
00111   infbound_eval(const std::vector<infbound>& __x, const variable_indicator& __v,
00112                 const model& __m, std::vector<infbound>* __c) : _Base()
00113   {
00114     eval_data.x = &__x;
00115     eval_data.cache = __c;
00116     eval_data.mod = &__m;
00117     eval_data.d = 0.;
00118     eval_data.p = NULL;
00119     v_ind = &__v;
00120     eval_data.n = 0;
00121   }
00122 
00123   infbound_eval(const infbound_eval& __v) : _Base(__v) {}
00124   
00125   ~infbound_eval() {}
00126 
00127   model::walker short_cut_to(const expression_node& __data)
00128   { return eval_data.mod->node(0); }    // return anything
00129 
00130   void initialize() { return; }
00131   
00132   int initialize(const expression_node& __data)
00133   {
00134     if(__data.ev && (*__data.ev)[FUNC_INFB])
00135     // is there a short-cut evaluator defined?
00136     {
00137       eval_data.r =
00138         (*(infbound_evaluator)(*__data.ev)[FUNC_INFB])(eval_data.x,
00139                                                                  *v_ind);
00140       return 0;     // don't perform the remaining graph walk
00141     }
00142     else
00143     {
00144       switch(__data.operator_type)
00145       {
00146         case EXPRINFO_SUM:
00147         case EXPRINFO_PROD:
00148         case EXPRINFO_MAX:
00149         case EXPRINFO_MIN:
00150         case EXPRINFO_INVERT:
00151         case EXPRINFO_DIV:
00152           eval_data.r = __data.params.nd();
00153           break;
00154         case EXPRINFO_MONOME:
00155         case EXPRINFO_IN:
00156         case EXPRINFO_AND:
00157         case EXPRINFO_NOGOOD:
00158           eval_data.r = 1.;
00159           break;
00160         case EXPRINFO_ALLDIFF:
00161           eval_data.p = (void*) new std::vector<infbound>;
00162           ((std::vector<infbound>*)eval_data.p)->reserve(__data.n_children);
00163           // no break!
00164         case EXPRINFO_MEAN:
00165         case EXPRINFO_IF:
00166         case EXPRINFO_OR:
00167         case EXPRINFO_NOT:
00168         case EXPRINFO_COUNT:
00169         case EXPRINFO_SCPROD:
00170         case EXPRINFO_NORM:
00171         case EXPRINFO_LEVEL:
00172           eval_data.r = 0.;
00173           break;
00174         case EXPRINFO_DET:
00175         case EXPRINFO_PSD:
00176           // here construct square infbound matrix
00177           break;
00178         case EXPRINFO_COND:
00179         case EXPRINFO_FEM:
00180         case EXPRINFO_MPROD:
00181           // here construct rectangular infbound matrix
00182           break;
00183       }
00184       return 1;
00185     }
00186   }
00187 
00188   void calculate(const expression_node& __data)
00189   {
00190 #if 0
00191     if(__data.operator_type > 0)
00192     {
00193       eval_data.r = __data.i_evaluate(-1, __data.params.nn(), *eval_data.x,
00194                                       *v_ind, eval_data.r, cintval(0.0), NULL);
00195     }
00196     eval_data.r.intersect(__data.f_bounds);
00197 #endif
00198   }
00199 
00200   void retrieve_from_cache(const expression_node& __data)
00201   {
00202     if(__data.operator_type == EXPRINFO_LIN)
00203     {
00204       const matrix<double>::Row& lrw(eval_data.mod->lin[__data.params.nn()]);
00205       matrix<double>::Row::const_iterator _x, _e;
00206 
00207       eval_data.r = infbound(0.);
00208       for(_x = lrw.begin(); _x != _e; ++_x)
00209         eval_data.r += (*eval_data.x)[_x.index()] * *_x;
00210     }
00211     else if(__data.operator_type == EXPRINFO_QUAD)
00212     {
00213       throw "Interval Evaluation of QUAD: NYI!";
00214     }
00215     else
00216       eval_data.r = (*eval_data.cache)[__data.node_num];
00217   }
00218 
00219   int update(const infbound& __rval)
00220   {
00221     eval_data.r = __rval;
00222     return 0;
00223   }
00224 
00225   int update(const expression_node& __data, const infbound& __rval)
00226   {
00227     infbound __x;
00228     int ret = 0;
00229     if(__data.operator_type < 0)
00230     {
00231       switch(__data.operator_type)
00232       {
00233         case EXPRINFO_CONSTANT:
00234           eval_data.r = __data.params.nd();
00235           break;
00236         case EXPRINFO_VARIABLE:
00237           eval_data.r = (*eval_data.x)[__data.params.nn()];
00238           break;
00239         case EXPRINFO_SUM:
00240         case EXPRINFO_MEAN:
00241           eval_data.r += __data.coeffs[eval_data.n++]*__rval;
00242           break;
00243         case EXPRINFO_PROD:
00244           // the coefficients MUST be collected in __data.params.nd()
00245           eval_data.r *= __rval;
00246           if(eval_data.r == 0.) ret = -1;
00247           break;
00248         case EXPRINFO_MONOME:
00249           // the coefficients MUST be collected in __data.params.nd()
00250           //eval_data.r *= __power(__data.coeffs[eval_data.n], __rval,
00251           //                       __data.params.n()[eval_data.n]);
00252           //if(eval_data.r == 0.) ret = -1;
00253           //eval_data.n++;
00254           std::cerr << "Momomials NYI" << std::endl;
00255           throw "NYI";
00256           break;
00257         case EXPRINFO_MAX:
00258           /* CHANGE HERE */
00259           //{ infbound h = __rval * __data.coeffs[eval_data.n++];
00260           //  eval_data.r = imax(eval_data.r, h);
00261           // }
00262           std::cerr << "MAXIMUM  NYI" << std::endl;
00263           throw "NYI";
00264           break;
00265         case EXPRINFO_MIN:
00266           /* CHANGE HERE */
00267           std::cerr << "MAXIMUM  NYI" << std::endl;
00268           throw "NYI";
00269           break;
00270           //         { infbound h = __rval * __data.coeffs[eval_data.n++];
00271           //  eval_data.r = imin(eval_data.r, h);
00272           //}
00273           // break;
00274         case EXPRINFO_SCPROD:
00275           { infbound h = __data.coeffs[eval_data.n]*__rval;
00276             // if the number of children is odd, the list is implicitly
00277             // lengthened by one null element (i.e. implicitly shortened)
00278             if(eval_data.n & 1) // y_n
00279               eval_data.r += __data.coeffs[eval_data.n]*__rval*h;
00280             else // x_n
00281               eval_data.d = h;
00282           }
00283           eval_data.n++;
00284           break;
00285         case EXPRINFO_NORM:
00286           if(__data.params.nd() != 2.)
00287           {
00288             std::cerr << "Non-euclidean norms NYI" << std::endl;
00289             throw "NYI";
00290           }
00291           else
00292           {
00293             infbound h = __data.coeffs[eval_data.n++]*__rval;
00294             eval_data.r += sqr(h);
00295           }
00296           if(eval_data.n == __data.n_children && __data.params.nd() == 2.)
00297             eval_data.r = sqrt(eval_data.r);
00298           break;
00299         case EXPRINFO_INVERT:
00300           eval_data.r /= __rval;
00301           break;
00302         case EXPRINFO_DIV:
00303           // this evaluator requires, that the second coefficient
00304           // is put into the first.
00305           if(eval_data.n == 0)
00306             eval_data.r *= __rval;
00307           else
00308             eval_data.r /= __rval;
00309           ++eval_data.n;
00310           break;
00311         case EXPRINFO_SQUARE:
00312           { infbound h = __data.coeffs[0]*__rval+__data.params.nd();
00313             eval_data.r = sqr(h);
00314           }
00315           break;
00316         case EXPRINFO_INTPOWER:
00317           std::cerr << "INTPOWER  NYI" << std::endl;
00318           throw "NYI";
00319           break;
00320  //eval_data.r = __power(__data.coeffs[0], __rval, __data.params.nn());
00321  //          break;
00322         case EXPRINFO_SQROOT:
00323           eval_data.r = sqrt(__data.coeffs[0]*__rval+__data.params.nd());
00324           break;
00325         case EXPRINFO_ABS:
00326           eval_data.r = abs(__data.coeffs[0]*__rval+__data.params.nd());
00327           break;
00328         case EXPRINFO_POW:
00329           std::cerr << "cinterval^cinterval NYI" << std::endl;
00330           throw "NYI";
00331           break;
00332           //          { infbound h = __rval * __data.coeffs[eval_data.n];
00333           // if(eval_data.n == 0)
00334           //    eval_data.r = h+__data.params.nd();
00335           // else
00336           //    eval_data.r = pow(eval_data.r, h);
00337           //}
00338           //++eval_data.n;
00339           //break;
00340         case EXPRINFO_EXP:
00341           eval_data.r = exp(__rval*__data.coeffs[0]+__data.params.nd());
00342           break;
00343         case EXPRINFO_LOG:
00344           std::cerr << "LOG(infb) NYI" << std::endl;
00345           throw "NYI";
00346           //   eval_data.r = log(__rval*__data.coeffs[0]+__data.params.nd());
00347           break;
00348         case EXPRINFO_SIN:
00349           eval_data.r = sin(__rval*__data.coeffs[0]+__data.params.nd());
00350           break;
00351         case EXPRINFO_COS:
00352           std::cerr << "LOG(infb) NYI" << std::endl;
00353           throw "NYI";
00354           //   eval_data.r = cos(__rval*__data.coeffs[0]+__data.params.nd());
00355           break;
00356         case EXPRINFO_ATAN2:
00357           std::cerr << "ATAN2 NYI" << std::endl;
00358           throw "NYI";
00359           break;
00360           /*
00361           { infbound h = __rval * __data.coeffs[eval_data.n];
00362             if(eval_data.n == 0)
00363               eval_data.r = h;
00364             else
00365               eval_data.r = atan2(eval_data.r, h);
00366             ++eval_data.n;
00367           }
00368           break; */
00369         case EXPRINFO_GAUSS:
00370          std::cerr << "Polynomes NYI" << std::endl;
00371           throw "NYI";
00372           break;
00373           /*  { infbound h = (__data.coeffs[0]*__rval-__data.params.d()[0])/
00374                                 __data.params.d()[1];
00375             eval_data.r = gauss(h);
00376           }
00377           break;*/
00378         case EXPRINFO_POLY:
00379           std::cerr << "Polynomials NYI" << std::endl;
00380           throw "NYI";
00381           break;
00382         case EXPRINFO_LIN:
00383         case EXPRINFO_QUAD:
00384           // we will never be here
00385           break;
00386         case EXPRINFO_IN:
00387          std::cerr << "Containment NYI" << std::endl;
00388           throw "NYI";
00389           break;
00390           /*           {
00391             __x = __data.coeffs[eval_data.n]*__rval;
00392             const infbound& i(__data.params.i()[eval_data.n]);
00393             if(i.disjoint(__x))     // it is not in
00394             {
00395               eval_data.r = -1.;
00396               ret = -1;
00397             }
00398             else if(eval_data.r != infbound(-1.))
00399             {
00400               if(!i.superset(__x))  // in and out are possible
00401               {
00402                 if(i.sup() == __x.inf() || i.inf() == __x.sup())
00403                 // intersection is only on the border
00404                   eval_data.r = infbound(-1.,0.);
00405                 else if(eval_data.r.sup() > 0)
00406                   eval_data.r = infbound(-1.,1.);
00407               }
00408               else if(i.inf() == __x.inf() || i.sup() == __x.sup())
00409               // they are not disjoint, and i is a superset of __x
00410               // but a border is possible
00411               {
00412                 if(eval_data.r.inf() == 1.)
00413                 {
00414                   if(__x.is_thin())       // only border
00415                     eval_data.r = 0.;
00416                   else                    // interior and border possible
00417                     eval_data.r = infbound(0.,1.);
00418                 }
00419                 else if(__x.is_thin() && eval_data.r.inf() == 0.)
00420                   eval_data.r = 0.;
00421               }
00422               // if __x is in the interior of i eval_data.r does not change
00423             }
00424           }
00425           eval_data.n++;
00426           break; */
00427         case EXPRINFO_IF:
00428         std::cerr << "Cinterval-IF's NYI" << std::endl;
00429           throw "NYI";
00430           break;
00431           /*          __x = __rval * __data.coeffs[eval_data.n];
00432           if(eval_data.n == 0) // this is the condition
00433           {
00434             const infbound& i(__data.params.ni());
00435             if(i.superset(__x))      // always true
00436               eval_data.info = 0;
00437             else if(i.disjoint(__x)) // never true
00438             {
00439               eval_data.info = 1;
00440               ret = 1;               // skip if part
00441             }
00442             else                     // both is possible
00443               eval_data.info = 2;
00444           }
00445           else if(eval_data.n == 1)  // this is the if part
00446           {
00447             eval_data.r = __x;
00448             if(eval_data.info == 0)  // it was always true
00449               ret = -1;              // don't continue walking
00450           }
00451           else // this is the else part
00452           {
00453             if(eval_data.info == 1) // only the else part
00454               eval_data.r = __x;
00455             else                      // both parts
00456               eval_data.r = eval_data.r.hull(__x);
00457           }
00458           eval_data.n += ret+1;
00459           break;
00460           */
00461          case EXPRINFO_AND:
00462          std::cerr << "Cinterval-AND's NYI" << std::endl;
00463           throw "NYI";
00464           break;
00465           /*           { __x = __data.coeffs[eval_data.n]*__rval;
00466             const infbound& i(__data.params.i()[eval_data.n]);
00467             if(eval_data.r != 0.)
00468             {
00469               if(i.disjoint(__x))
00470               {
00471                 eval_data.r = 0;
00472                 ret = -1;         // result cannot become more false
00473               }
00474               else if(!i.superset(__x))
00475                 eval_data.r = infbound(0.,1.);
00476               // else this does not change the value
00477             }
00478           }
00479           eval_data.n++;
00480           break; */
00481        case EXPRINFO_OR:
00482         std::cerr << "Cinterval-OR's NYI" << std::endl;
00483           throw "NYI";
00484           break;
00485           /*            { __x = __data.coeffs[eval_data.n]*__rval;
00486             const infbound& i(__data.params.i()[eval_data.n]);
00487             if(eval_data.r != 1.)
00488             {
00489               if(i.superset(__x))
00490               {
00491                 eval_data.r = 1;
00492                 ret = -1;         // result cannot become more true
00493               }
00494               else if(!i.disjoint(__x))
00495                 eval_data.r = infbound(0.,1.);
00496             }
00497           }
00498           eval_data.n++;
00499           break; */
00500         case EXPRINFO_NOT:
00501         std::cerr << "Cinterval-NOT's NYI" << std::endl;
00502           throw "NYI";
00503           break;
00504           /*             { __x = __data.coeffs[0]*__rval;
00505             const infbound& i(__data.params.ni());
00506             if(i.superset(__x))
00507               eval_data.r = 0;
00508             else if(i.disjoint(__x))
00509               eval_data.r = 1;
00510             else
00511               eval_data.r = infbound(0.,1.);
00512           }
00513           break; */
00514         case EXPRINFO_IMPLIES:
00515          std::cerr << "Cinterval-IMPLIES NYI" << std::endl;
00516           throw "NYI";
00517           break; /*
00518          { const infbound& i(__data.params.i()[eval_data.n]);
00519             __x = __rval * __data.coeffs[eval_data.n];
00520             if(eval_data.n == 0)
00521             {
00522               if(i.disjoint(__x))
00523               {
00524                 eval_data.r = 1.;
00525                 ret = -1;        // ex falso quodlibet
00526               }
00527               else if(!i.superset(__x))
00528                 eval_data.r = infbound(0.,1.);
00529               else
00530                 eval_data.r = infbound(0.);
00531             }
00532             else // we only get here if first clause might be true
00533             {
00534               if(i.superset(__x))
00535                 eval_data.r = 1.;
00536               else if(!i.disjoint(__x))
00537                 eval_data.r = infbound(0.,1.);
00538               // else the value does not change
00539             }
00540             ++eval_data.n;
00541           }
00542           break; */
00543         case EXPRINFO_COUNT:
00544          std::cerr << "Cinterval-COUNT NYI" << std::endl;
00545           throw "NYI";
00546           break; /*
00547           { __x = __data.coeffs[eval_data.n]*__rval;
00548             const infbound& i(__data.params.i()[eval_data.n]);
00549             if(i.superset(__x))
00550               eval_data.r += 1;
00551             else if(!i.disjoint(__x))
00552               eval_data.r += infbound(0.,1.);
00553               }
00554           eval_data.n++;
00555           break; */
00556         case EXPRINFO_ALLDIFF:
00557          std::cerr << "Cinterval-ALLDIFF NYI" << std::endl;
00558           throw "NYI";
00559           break; /*
00560           { __x = __data.coeffs[eval_data.n]*__rval;
00561             for(std::vector<infbound>::const_iterator _b =
00562                         ((std::vector<infbound>*)eval_data.p)->begin();
00563                 _b != ((std::vector<infbound>*)eval_data.p)->end(); ++_b)
00564             {
00565               infbound __h = abs(__x-*_b);
00566               if(__h.sup() <= __data.params.nd())  // they are always equal
00567               {
00568                 eval_data.r = 0;
00569                 ret = -1;               // don't continue
00570                 break;
00571               }
00572               else if(__h.inf() <= __data.params.nd()) // they are not always different
00573                 eval_data.r = infbound(0.,1.);
00574             }
00575             if(ret != -1)
00576               ((std::vector<infbound>*) eval_data.p)->push_back(__x);
00577           }
00578           eval_data.n++;
00579           if(eval_data.n == __data.n_children || ret == -1)
00580             delete (std::vector<infbound>*) eval_data.p;
00581             break; */
00582         case EXPRINFO_HISTOGRAM:
00583           std::cerr << "int_evaluator: histogram NYI" << std::endl;
00584           throw "NYI";
00585           break;
00586         case EXPRINFO_LEVEL:
00587           std::cerr << "Cinterval-LEVEL NYI" << std::endl;
00588           throw "NYI";
00589           break; /*
00590          { int lo = (int)eval_data.r.inf();
00591             int hi = (int)eval_data.r.sup();
00592             __x = __data.coeffs[eval_data.n]*__rval;
00593             infbound _h;
00594 
00595             // first adjust upper bound
00596             if(hi != INT_MAX)
00597             {
00598               while(hi < __data.params.im().nrows())
00599               { 
00600                 _h = __data.params.im()[hi][eval_data.n];
00601                 if(_h.superset(__x))
00602                   break;
00603                 hi++;
00604               }
00605               if(hi == __data.params.im().nrows())
00606                 hi = INT_MAX;
00607             }
00608             // then adjust lower bound
00609             if(lo != INT_MAX)
00610             {
00611               while(lo < __data.params.im().nrows())
00612               { 
00613                 _h = __data.params.im()[lo][eval_data.n];
00614                 if(!_h.disjoint(__x))
00615                   break;
00616                 lo++;
00617               }
00618               if(lo == __data.params.im().nrows())
00619                 lo = INT_MAX;
00620             }
00621             if(hi == INT_MAX && lo == INT_MAX)
00622             {
00623               eval_data.r = INT_MAX;
00624               ret = -1;
00625             }
00626             else
00627               eval_data.r = infbound(lo+0.,hi+0.);
00628           }
00629           eval_data.n++;
00630           break; */
00631         case EXPRINFO_NEIGHBOR:
00632           std::cerr << "Cinterval-Neighbor NYI" << std::endl;
00633           throw "NYI";
00634           break; /*
00635           // this is suboptimal. It does not take into account
00636           // all the possibilities to proove that the result actually
00637           // EQUALS 1
00638           if(eval_data.n == 0)
00639             eval_data.r = __data.coeffs[0]*__rval;
00640           else
00641           {
00642             infbound h = eval_data.r;
00643             eval_data.r = 0;
00644             __x = __data.coeffs[1]*__rval;
00645             for(unsigned int i = 0; i < __data.params.n().size(); i+=2)
00646             {
00647               if(h == __data.params.n()[i]+0. &&
00648                  __x == __data.params.n()[i+1]+0.)
00649               {
00650                 eval_data.r = 1;
00651                 break;
00652               }
00653               else if(h.contains(__data.params.n()[i]+0.) &&
00654                       __x.contains(__data.params.n()[i+1]+0.))
00655               {
00656                 eval_data.r = infbound(0.,1.);
00657                 break;
00658               }
00659             }
00660           }
00661           eval_data.n++;
00662           break; */
00663         case EXPRINFO_NOGOOD:
00664           std::cerr << "Cinterval-nogood NYI" << std::endl;
00665           throw "NYI";
00666           break; /*
00667           __x = __data.coeffs[eval_data.n]*__rval;
00668           if(eval_data.r != 0.)
00669           { 
00670             if(!__x.contains(__data.params.n()[eval_data.n]+0.))
00671             {
00672               eval_data.r = 0.;
00673               ret = -1;
00674             }
00675             else if(__x != __data.params.n()[eval_data.n]+0.)
00676               eval_data.r = infbound(0.,1.);
00677           }
00678           eval_data.n++;
00679           break;*/
00680         case EXPRINFO_EXPECTATION:
00681           std::cerr << "int_evaluator: E NYI" << std::endl;
00682           throw "NYI";
00683           break;
00684         case EXPRINFO_INTEGRAL:
00685           std::cerr << "int_evaluator: INT NYI" << std::endl;
00686           throw "NYI";
00687           break;
00688         case EXPRINFO_LOOKUP:
00689         case EXPRINFO_PWLIN:
00690         case EXPRINFO_SPLINE:
00691         case EXPRINFO_PWCONSTLC:
00692         case EXPRINFO_PWCONSTRC:
00693           std::cerr << "int_evaluator: Table Operations NYI" << std::endl;
00694           throw "NYI";
00695           break;
00696         case EXPRINFO_DET:
00697         case EXPRINFO_COND:
00698         case EXPRINFO_PSD:
00699         case EXPRINFO_MPROD:
00700         case EXPRINFO_FEM:
00701           std::cerr << "int_evaluator: Matrix Operations NYI" << std::endl;
00702           throw "NYI";
00703           break;
00704         case EXPRINFO_RE:
00705         case EXPRINFO_IM:
00706         case EXPRINFO_ARG:
00707         case EXPRINFO_CPLXCONJ:
00708           std::cerr << "int_evaluator: Complex Numbers NYI" << std::endl;
00709           throw "NYI";
00710           break;
00711         case EXPRINFO_CMPROD:
00712         case EXPRINFO_CGFEM:
00713           std::cerr << "int_evaluator: Const Matrix Operations NYI" << std::endl;
00714           throw "NYI";
00715           break;
00716         default:
00717           std::cerr << "int_evaluator: unknown function type " <<
00718                    __data.operator_type << std::endl;
00719           throw "Programming error";
00720           break;
00721       }
00722     }
00723 #if 0
00724     else if(__data.operator_type > 0)
00725       // update the function arguments
00726       // eval_data.r = __data.i_evaluate(eval_data.n++, __data.params.nn(),
00727       //                 *eval_data.x, *v_ind, eval_data.r, __rval, NULL);
00728     // use the cache only if it is worthwhile
00729     //    if(eval_data.cache && __data.n_parents > 1 && __data.n_children > 0)
00730 #endif
00731     if(eval_data.cache)
00732       (*eval_data.cache)[__data.node_num] = eval_data.r;
00733     return ret;
00734   }
00735 
00736   infbound calculate_value(bool eval_all)
00737   {
00738     return eval_data.r;
00739   }
00740 };
00741 
00742 #endif /* _INFB_EVALUATOR_H_ */

Generated on Tue Nov 4 01:57:57 2003 for COCONUT API by doxygen1.2.18