00001
00035 #include "jbltools/sfh/FloatFun.h"
00036 #include "jbltools/sfh/FloatFunHelpers.h"
00037 #include "jbltools/sfh/IntFun.h"
00038
00039 #include "jbltools/sfh/FillIterator.h"
00040
00041 #include <cmath>
00042
00043 #include <values.h>
00044 #include <iostream>
00045 #include <cassert>
00046
00047 #include <stdio.h>
00048 #include <cstring>
00049
00050
00051 FloatFun& abs (const FloatFun& arg_) {
00052 return *new AnyFloatFun1<std::abs>("abs", arg_);
00053 }
00054
00055 FloatFun& acos (const FloatFun& arg_) {
00056 return *new AnyFloatFun1<std::acos>("acos", arg_);
00057 }
00058
00059
00060
00061
00062
00063 FloatFun& asin (const FloatFun& arg_) {
00064 return *new AnyFloatFun1<std::asin>("asin", arg_);
00065 }
00066
00067
00068
00069
00070
00071 FloatFun& atan (const FloatFun& arg_) {
00072 return *new AnyFloatFun1<std::atan>("atan", arg_);
00073 }
00074
00075
00076
00077
00078
00079 FloatFun& ceil (const FloatFun& arg_) {
00080 return *new AnyFloatFun1<std::ceil>("ceil", arg_);
00081 }
00082
00083 FloatFun& cos (const FloatFun& arg_) {
00084 return *new AnyFloatFun1<std::cos>("cos", arg_);
00085 }
00086
00087 FloatFun& cosh (const FloatFun& arg_) {
00088 return *new AnyFloatFun1<std::cosh>("cosh", arg_);
00089 }
00090
00091 FloatFun& exp (const FloatFun& arg_) {
00092 return *new AnyFloatFun1<std::exp>("exp", arg_);
00093 }
00094
00095 FloatFun& fabs (const FloatFun& arg_) {
00096 return *new AnyFloatFun1<std::fabs>("fabs", arg_);
00097 }
00098
00099 FloatFun& floor (const FloatFun& arg_) {
00100 return *new AnyFloatFun1<std::floor>("floor", arg_);
00101 }
00102
00103 FloatFun& log (const FloatFun& arg_) {
00104 return *new AnyFloatFun1<std::log>("log", arg_);
00105 }
00106
00107 FloatFun& log10 (const FloatFun& arg_) {
00108 return *new AnyFloatFun1<std::log10>("log10", arg_);
00109 }
00110
00111 FloatFun& sin (const FloatFun& arg_) {
00112 return *new AnyFloatFun1<std::sin>("sin", arg_);
00113 }
00114
00115 FloatFun& sinh (const FloatFun& arg_) {
00116 return *new AnyFloatFun1<std::sinh>("sinh", arg_);
00117 }
00118
00119 FloatFun& sqrt (const FloatFun& arg_) {
00120 return *new AnyFloatFun1<std::sqrt>("sqrt", arg_);
00121 }
00122
00123 FloatFun& tan (const FloatFun& arg_) {
00124 return *new AnyFloatFun1<std::tan>("tan", arg_);
00125 }
00126
00127 FloatFun& tanh (const FloatFun& arg_) {
00128 return *new AnyFloatFun1<std::tanh>("tanh", arg_);
00129 }
00130
00131 FloatFun& square (const FloatFun& arg_) {
00132 return *new AnyFloatFun1<square>("square", arg_);
00133 }
00134
00135 FloatFun& rad (const FloatFun& arg_) {
00136 return *new AnyFloatFun1<rad>("rad", arg_);
00137 }
00138
00139 FloatFun& deg (const FloatFun& arg_) {
00140 return *new AnyFloatFun1<deg>("deg", arg_);
00141 }
00142
00143 FloatFun& atan2 (const FloatFun& lhs, const FloatFun& rhs) {
00144 return *new AnyFloatFun2<std::atan2>("atan2", lhs, rhs);
00145 }
00146
00147 FloatFun& pow (const FloatFun& arg1, const FloatFun& arg2) {
00148 return *new AnyFloatFun2<std::pow>("pow", arg1, arg2);
00149 }
00150
00151 Float_FF MaxFloatFun::operator() () const {
00152
00153 Float_FF result = -(MAXFLOAT);
00154 if (intiter->reset()) {
00155 do {
00156 if (!cut || (*cut)()) {
00157 Float_FF f = fun ? (*fun)() : 0;
00158 if (f > result) result = f;
00159 }
00160 } while (intiter->next());
00161 }
00162 return result;
00163 }
00164
00165 Float_FF MinFloatFun::operator() () const {
00166
00167 Float_FF result = MAXFLOAT;
00168 if (intiter->reset()) {
00169 do {
00170 if (!cut || (*cut)()) {
00171 Float_FF f = fun ? (*fun)() : 0;
00172 if (f < result) result = f;
00173 }
00174 } while (intiter->next());
00175 }
00176 return result;
00177 }
00178
00179 Float_FF SumFloatFun::operator() () const {
00180 Float_FF sum = 0;
00181 if (intiter->reset()) {
00182 do {
00183 if (!cut || (*cut)()) {
00184 Float_FF f = fun ? (*fun)() : 1;
00185 sum += f;
00186 }
00187 } while (intiter->next());
00188 }
00189 return sum;
00190 }
00191
00192 Float_FF AverageFloatFun::operator() () const {
00193 Float_FF sum = 0;
00194 int n = 0;
00195 if (intiter->reset()) {
00196 do {
00197 if (!cut || (*cut)()) {
00198 Float_FF f = fun ? (*fun)() : 1;
00199 sum +=f;
00200 ++n;
00201 }
00202 } while (intiter->next());
00203 }
00204 return n ? (sum/n) : 0;
00205 }
00206
00207 OneFunCompound::OneFunCompound (const std::string& funname_, const FloatFun& arg_)
00208 : FloatFun (funname_+'('+arg_.getName()+')'), arg (arg_)
00209 {}
00210
00211 OneFunCompound::OneFunCompound (const char *funname_, const FloatFun& arg_)
00212 : FloatFun (std::string (funname_)+'('+arg_.getName()+')'), arg (arg_)
00213 {}
00214
00215 OneFunCompound::OneFunCompound (const FloatFun& arg_, const std::string& name_)
00216 : FloatFun (name_), arg (arg_)
00217 {}
00218
00219 TwoFunCompound::TwoFunCompound (const FloatFun& lhs_, const std::string opname_, const FloatFun& rhs_)
00220 : FloatFun (str('(')+lhs_.getName()+')'+opname_+'('+rhs_.getName()+')'), lhs (lhs_), rhs (rhs_)
00221 {}
00222
00223 TwoFunCompound::TwoFunCompound (const std::string funname_, const FloatFun& lhs_, const FloatFun& rhs_)
00224 : FloatFun (funname_+'('+lhs_.getName()+','+rhs_.getName()+')'), lhs (lhs_), rhs (rhs_)
00225 {}
00226
00227 TwoFunCompound::TwoFunCompound (const FloatFun& lhs_, const FloatFun& rhs_, const std::string name_)
00228 : FloatFun (name_), lhs (lhs_), rhs (rhs_)
00229 {}
00230
00231 const FillIterator *TwoFunCompound::getIterator() const {
00232 assert (!lhs.getIterator() || !rhs.getIterator() || lhs.getIterator()==rhs.getIterator());
00233 return (lhs.getIterator()) ? lhs.getIterator() : rhs.getIterator();
00234 }
00235
00236 TwoFloatFunComp::TwoFloatFunComp (const FloatFun& lhs_, const std::string& opname_, const FloatFun& rhs_)
00237 : FloatFunComp(str('(')+lhs_.getName()+')'+opname_+'('+rhs_.getName()+')'),
00238 lhs (lhs_),
00239 rhs (rhs_)
00240 {
00241 assert (&lhs);
00242 assert (&rhs);
00243 }
00244
00245 const FillIterator *TwoFloatFunComp::getIterator() const {
00246 assert (!lhs.getIterator() || !rhs.getIterator() || lhs.getIterator()==rhs.getIterator());
00247 return (lhs.getIterator()) ? lhs.getIterator() : rhs.getIterator();
00248 }
00249
00250 ChainComparison::ChainComparison (const FloatFunComp& lhs_, const std::string& opname_, const FloatFun& rhs_)
00251 : FloatFunComp (lhs_.getName()+opname_+'('+rhs_.getName()+')'),
00252 lhs (lhs_),
00253 rhs (rhs_)
00254 {
00255 assert (&lhs);
00256 assert (&rhs);
00257 }
00258
00259 const FillIterator *ChainComparison::getIterator() const {
00260 assert (!lhs.getIterator() || !rhs.getIterator() || lhs.getIterator()==rhs.getIterator());
00261 return (lhs.getIterator()) ? lhs.getIterator() : rhs.getIterator();
00262 }
00263
00264
00265 ChainCompFloat::ChainCompFloat (const FloatFunComp& lhs_, const std::string& opname_, Float_FF rhs_)
00266 : FloatFunComp (lhs_.getName()+opname_+str(rhs_)),
00267 lhs (lhs_),
00268 rhs (rhs_)
00269 {
00270 assert (&lhs);
00271 }
00272
00273 FloatFloatFunComp::FloatFloatFunComp (Float_FF lhs_, const std::string& opname_, const FloatFun& rhs_)
00274 : FloatFunComp (str(lhs_)+opname_+'('+rhs_.getName()+')'),
00275 lhs (lhs_),
00276 rhs (rhs_)
00277 {
00278 assert (&rhs);
00279 }
00280
00281 FloatFunFloatComp::FloatFunFloatComp (const FloatFun& lhs_, const std::string& opname_, Float_FF rhs_)
00282 : FloatFunComp (str('(')+lhs_.getName()+')'+opname_+str(rhs_)),
00283 lhs (lhs_),
00284 rhs (rhs_)
00285 {
00286 assert (&lhs);
00287 }
00288
00289 CollectiveFloatFun::CollectiveFloatFun (const std::string& funname_,
00290 const FloatFunPoRConst& fun_,
00291 const BaseCutPoRConst& cut_,
00292 const FillIteratorPoR& intiter_,
00293 const FillIteratorPoRConst& extiter_)
00294 : FloatFun (makeName (funname_, fun_, cut_, intiter_, extiter_)),
00295 fun (fun_.pff),
00296 cut (cut_.pbc),
00297 intiter (intiter_.pfi),
00298 extiter (extiter_.pfi)
00299 {
00300 checkIterators();
00301 setName (makeName (funname_, fun, cut, intiter, extiter));
00302 }
00303
00304 std::string CollectiveFloatFun::makeName(const std::string& funname_,
00305 const FloatFunPoRConst& fun_,
00306 const BaseCutPoRConst& cut_,
00307 const FillIteratorPoR& intiter_,
00308 const FillIteratorPoRConst& extiter_
00309 ){
00310 const char *fname = fun_.pff ? fun_.pff->getName() : 0;
00311 const char *cutname = cut_.pbc ? cut_.pbc->getName() : 0;
00312 const char *intitername = intiter_.pfi ? intiter_.pfi->getName() : 0;
00313 const char *extitername = extiter_.pfi ? extiter_.pfi->getName() : 0;
00314 if (!fname) fname="1";
00315 if (!cutname) cutname="true";
00316 std::string result = funname_+'('+fname+", "+cutname+')';
00317 if (extitername) result = result + '['+intitername+']';
00318
00319 return result;
00320 }
00321
00322 void CollectiveFloatFun::checkIterators() {
00323
00324
00325
00326
00327
00328 FillIterator *funiter = fun ? const_cast<FillIterator *>(fun->getIterator()) : 0;
00329 FillIterator *cutiter = cut ? const_cast<FillIterator *>(cut->getIterator()) : 0;
00330
00331 if (!intiter) {
00332
00333 if (funiter && cutiter) {
00334
00335 if (funiter == cutiter) {
00336 if (funiter != extiter) {
00337 intiter = funiter;
00338 #if (DEBUG>=2)
00339 std::cerr << "CollectiveFloatFun '" << getName() << "': taking intiter from funiter '"
00340 << funiter->getName() << "' == cutiter\n";
00341 #endif
00342 }
00343 }
00344 else {
00345
00346
00347 if (funiter == extiter) {
00348 intiter = cutiter;
00349 std::cerr << "CollectiveFloatFun '" << getName() << "': taking intiter from cutiter '"
00350 << cutiter->getName() << "' != funiter\n";
00351 }
00352 else if (cutiter == extiter) {
00353 intiter = funiter;
00354 std::cerr << "CollectiveFloatFun '" << getName() << "': taking intiter from funiter '"
00355 << funiter->getName() << "'!= cutiter\n";
00356 }
00357 }
00358 }
00359 else if (funiter) {
00360
00361 if (funiter != extiter) {
00362 std::cerr << "CollectiveFloatFun '" << getName() << "': taking intiter from funiter'"
00363 << funiter->getName() << "', cutiter==0\n";
00364 intiter = funiter;
00365 }
00366 }
00367 else if (cutiter) {
00368
00369 if (cutiter != extiter) {
00370 std::cerr << "CollectiveFloatFun '" << getName() << "': taking intiter from cutiter'"
00371 << cutiter->getName() << "', cutiter==0\n";
00372 intiter = cutiter;
00373 }
00374 }
00375 else {
00376
00377 std::cerr << "CollectiveFloatFun '" << getName() << "': Error! cutiter, floatiter and intiter all 0!\n";
00378 }
00379 }
00380
00381 if (!intiter) {
00382 std::cerr << "CollectiveFloatFun '" << getName() << "': Cannot determine intiter from fun and cut!\n";
00383 }
00384
00385 assert (intiter);
00386 assert (!extiter || extiter!=intiter);
00387 assert (!funiter || funiter==intiter || funiter==extiter);
00388 assert (!cutiter || cutiter==intiter || cutiter==extiter);
00389 }
00390
00391 CachedFloatFun::CachedFloatFun (const ROListPoR& rol,
00392 const FloatFun& arg_
00393 )
00394 : FloatFun (std::string("cached(")+arg_.getName()+')'),
00395 CachedO (rol),
00396 arg(arg_),
00397 cacheValid (false)
00398 {
00399 assert (&arg);
00400 }
00401
00402 Float_FF CachedFloatFun::operator() () const {
00403 if (!cacheValid) {
00404 cachedValue = arg();
00405 cacheValid = true;
00406 }
00407 return cachedValue;
00408 }
00409
00410 CachedFloatFunIt::CachedFloatFunIt (const ROListPoR& rol,
00411 const FloatFun& arg_,
00412 const FillIterator& iter_
00413 )
00414 : FloatFun (std::string("cached(")+arg_.getName()+','+iter_.getName()+')'),
00415 CachedO (rol),
00416 arg (arg_),
00417 iter (iter_),
00418 cacheValid (),
00419 cachedValues ()
00420 {
00421 assert (&arg);
00422 assert (&iter);
00423 }
00424
00425 Float_FF CachedFloatFunIt::operator() () const {
00426 int i = iter();
00427 assert (i >= 0);
00428 if (static_cast<unsigned int>(i) >= cacheValid.size()) growCache (i+1);
00429 if (!cacheValid[i]) {
00430 cacheValid[i] = true;
00431 cachedValues[i] = arg();
00432 }
00433 return cachedValues[i];
00434 }
00435
00436 void CachedFloatFunIt::growCache (unsigned int s) const {
00437 unsigned int oldsize = cacheValid.size();
00438 if (s < oldsize) return;
00439 cacheValid.resize (s);
00440 cachedValues.resize(s);
00441 for (unsigned int i = oldsize; i < s; ++i) cacheValid[i] = false;
00442 }
00443
00444 FloatFun& cached (const ROListPoR& rol,
00445 const FloatFunPoR& fun,
00446 const FillIteratorPoR& iter
00447 ) {
00448 assert (fun.pff);
00449 if (iter.pfi) return *new CachedFloatFunIt (rol, *fun.pff, *iter.pfi);
00450 if (const FillIterator *fi = fun.pff->getIterator())
00451 return *new CachedFloatFunIt (rol, *fun.pff, *fi);
00452 return *new CachedFloatFun (rol, *fun.pff);
00453 }
00454
00455 FloatFun& operator+ (const FloatFun& lhs_, const FloatFun& rhs_) {
00456 return *new SumOfTwoFuns (lhs_, rhs_);
00457 }
00458
00459 FloatFun& operator+ (const FloatFun& lhs_, Float_FF rhs_) {
00460 return *new ScalarSumFloatFun (rhs_, lhs_);
00461 }
00462
00463 FloatFun& operator+ (Float_FF lhs_, const FloatFun& rhs_) {
00464 return *new ScalarSumFloatFun (lhs_, rhs_);
00465 }
00466
00467 FloatFun& operator- (const FloatFun& lhs_, const FloatFun& rhs_) {
00468 return *new DiffOfTwoFuns (lhs_, rhs_);
00469 }
00470
00471 FloatFun& operator- (const FloatFun& lhs_, Float_FF rhs_) {
00472 return *new ScalarSumFloatFun (-rhs_, lhs_, 1, NamedO::str('(')+lhs_.getName()+")-"+NamedO::str(rhs_));
00473 }
00474
00475 FloatFun& operator- (Float_FF lhs_, const FloatFun& rhs_) {
00476 return *new ScalarSumFloatFun (lhs_, rhs_, -1, NamedO::str(lhs_)+"-("+rhs_.getName()+')');
00477 }
00478
00479 FloatFun& operator- (const FloatFun& arg_) {
00480 return *new ScalarProductFloatFun ("-", -1, arg_);
00481 }
00482
00483 const FloatFun& operator+ (const FloatFun& arg_) {
00484 return arg_;
00485 }
00486 FloatFun& operator+ (FloatFun& arg_) {
00487 return arg_;
00488 }
00489
00490 FloatFun& operator* (const FloatFun& lhs_, const FloatFun& rhs_) {
00491 if (&lhs_ == &rhs_) return square (lhs_);
00492 return *new ProdOfTwoFuns (lhs_, rhs_);
00493 }
00494
00495 FloatFun& operator* (Float_FF lhs_, const FloatFun& rhs_) {
00496 return *new ScalarProductFloatFun (lhs_, rhs_);
00497 }
00498
00499 FloatFun& operator* (const FloatFun& lhs_, Float_FF rhs_) {
00500 return *new ScalarProductFloatFun (rhs_, lhs_);
00501 }
00502
00503 FloatFun& operator/ (const FloatFun& lhs_, const FloatFun& rhs_) {
00504 return *new DivOfTwoFuns (lhs_, rhs_);
00505 }
00506
00507 FloatFun& operator/ (Float_FF lhs_, const FloatFun& rhs_) {
00508 return *new ScalarDivisionFloatFun (lhs_, rhs_);
00509 }
00510
00511 FloatFun& operator/ (const FloatFun& lhs_, Float_FF rhs_) {
00512 return *new ScalarProductFloatFun (1./rhs_, lhs_);
00513 }
00514
00515
00516
00517 FloatFunComp& operator< (const FloatFun& lhs_, const FloatFun& rhs_) {
00518 return *new FloatFunLess (lhs_, rhs_);
00519 }
00520
00521 FloatFunComp& operator> (const FloatFun& lhs_, const FloatFun& rhs_) {
00522 return *new FloatFunGreater (lhs_, rhs_);
00523 }
00524
00525 FloatFunComp& operator<= (const FloatFun& lhs_, const FloatFun& rhs_) {
00526 return *new FloatFunLessEqual (lhs_, rhs_);
00527 }
00528
00529 FloatFunComp& operator>= (const FloatFun& lhs_, const FloatFun& rhs_) {
00530 return *new FloatFunGreaterEqual (lhs_, rhs_);
00531 }
00532
00533 FloatFunComp& operator== (const FloatFun& lhs_, const FloatFun& rhs_) {
00534 return *new FloatFunEqual (lhs_, rhs_);
00535 }
00536
00537 FloatFunComp& operator!= (const FloatFun& lhs_, const FloatFun& rhs_) {
00538 return *new FloatFunNotEqual (rhs_, lhs_);
00539 }
00540
00541
00542
00543
00544 FloatFunComp& operator< (Float_FF lhs_, const FloatFun& rhs_) {
00545 return *new FloatFloatFunLess (lhs_, rhs_);
00546 }
00547
00548 FloatFunComp& operator<= (Float_FF lhs_, const FloatFun& rhs_) {
00549 return *new FloatFloatFunLessEqual (lhs_, rhs_);
00550 }
00551
00552 FloatFunComp& operator> (Float_FF lhs_, const FloatFun& rhs_) {
00553 return *new FloatFloatFunGreater (lhs_, rhs_);
00554 }
00555
00556 FloatFunComp& operator>= (Float_FF lhs_, const FloatFun& rhs_) {
00557 return *new FloatFloatFunGreaterEqual (lhs_, rhs_);
00558 }
00559
00560 FloatFunComp& operator== (Float_FF lhs_, const FloatFun& rhs_) {
00561 return *new FloatFloatFunEqual (lhs_, rhs_);
00562 }
00563
00564 FloatFunComp& operator!= (Float_FF lhs_, const FloatFun& rhs_) {
00565 return *new FloatFloatFunNotEqual (lhs_, rhs_);
00566 }
00567
00568
00569
00570
00571 FloatFunComp& operator< (const FloatFun& lhs_, Float_FF rhs_) {
00572 return *new FloatFunFloatLess (lhs_, rhs_);
00573 }
00574
00575 FloatFunComp& operator<= (const FloatFun& lhs_, Float_FF rhs_) {
00576 return *new FloatFunFloatLessEqual (lhs_, rhs_);
00577 }
00578
00579 FloatFunComp& operator> (const FloatFun& lhs_, Float_FF rhs_) {
00580 return *new FloatFunFloatGreater (lhs_, rhs_);
00581 }
00582
00583 FloatFunComp& operator>= (const FloatFun& lhs_, Float_FF rhs_) {
00584 return *new FloatFunFloatGreaterEqual (lhs_, rhs_);
00585 }
00586
00587 FloatFunComp& operator== (const FloatFun& lhs_, Float_FF rhs_) {
00588 return *new FloatFunFloatEqual (lhs_, rhs_);
00589 }
00590
00591 FloatFunComp& operator!= (const FloatFun& lhs_, Float_FF rhs_) {
00592 return *new FloatFunFloatNotEqual (lhs_, rhs_);
00593 }
00594
00595
00596
00597
00598
00599 FloatFunComp& operator< (const FloatFunComp& lhs_, const FloatFun& rhs_) {
00600 return *new ChainCompLess (lhs_, rhs_);
00601 }
00602
00603 FloatFunComp& operator<= (const FloatFunComp& lhs_, const FloatFun& rhs_) {
00604 return *new ChainCompLessEqual (lhs_, rhs_);
00605 }
00606
00607 FloatFunComp& operator> (const FloatFunComp& lhs_, const FloatFun& rhs_) {
00608 return *new ChainCompGreater (lhs_, rhs_);
00609 }
00610
00611 FloatFunComp& operator>= (const FloatFunComp& lhs_, const FloatFun& rhs_) {
00612 return *new ChainCompGreaterEqual (lhs_, rhs_);
00613 }
00614
00615 FloatFunComp& operator== (const FloatFunComp& lhs_, const FloatFun& rhs_) {
00616 return *new ChainCompEqual (lhs_, rhs_);
00617 }
00618
00619 FloatFunComp& operator!= (const FloatFunComp& lhs_, const FloatFun& rhs_) {
00620 return *new ChainCompNotEqual (lhs_, rhs_);
00621 }
00622
00623 FloatFunComp& operator< (const FloatFunComp& lhs_, Float_FF rhs_) {
00624 return *new ChainCompFloatLess (lhs_, rhs_);
00625 }
00626
00627 FloatFunComp& operator<= (const FloatFunComp& lhs_, Float_FF rhs_) {
00628 return *new ChainCompFloatLessEqual (lhs_, rhs_);
00629 }
00630
00631 FloatFunComp& operator> (const FloatFunComp& lhs_, Float_FF rhs_) {
00632 return *new ChainCompFloatGreater (lhs_, rhs_);
00633 }
00634
00635 FloatFunComp& operator>= (const FloatFunComp& lhs_, Float_FF rhs_) {
00636 return *new ChainCompFloatGreaterEqual (lhs_, rhs_);
00637 }
00638
00639 FloatFunComp& operator== (const FloatFunComp& lhs_, Float_FF rhs_) {
00640 return *new ChainCompFloatEqual (lhs_, rhs_);
00641 }
00642
00643 FloatFunComp& operator!= (const FloatFunComp& lhs_, Float_FF rhs_) {
00644 return *new ChainCompFloatNotEqual (lhs_, rhs_);
00645 }
00646
00647
00648 FloatFun& max (const FloatFunPoRConst& fun,
00649 const BaseCutPoRConst& cut,
00650 const FillIteratorPoR& intiter,
00651 const FillIteratorPoRConst& extiter
00652 ) {
00653 return *new MaxFloatFun (fun, cut, intiter, extiter);
00654 }
00655
00656 FloatFun& min (const FloatFunPoRConst& fun,
00657 const BaseCutPoRConst& cut,
00658 const FillIteratorPoR& intiter,
00659 const FillIteratorPoRConst& extiter
00660 ) {
00661 return *new MinFloatFun (fun, cut, intiter, extiter);
00662 }
00663
00664 FloatFun& sum (const FloatFunPoRConst& fun,
00665 const BaseCutPoRConst& cut,
00666 const FillIteratorPoR& intiter,
00667 const FillIteratorPoRConst& extiter
00668 ) {
00669 return *new SumFloatFun (fun, cut, intiter, extiter);
00670 }
00671
00672 FloatFun& average (const FloatFunPoRConst& fun,
00673 const BaseCutPoRConst& cut,
00674 const FillIteratorPoR& intiter,
00675 const FillIteratorPoRConst& extiter
00676 ) {
00677 return *new AverageFloatFun (fun, cut, intiter, extiter);
00678 }
00679