Generated on Mon Aug 25 11:35:45 2008 for Gecode by doxygen 1.5.6

test.icc

Go to the documentation of this file.
00001 /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
00002 /*
00003  *  Main authors:
00004  *     Christian Schulte <schulte@gecode.org>
00005  *
00006  *  Copyright:
00007  *     Christian Schulte, 2007
00008  *
00009  *  Last modified:
00010  *     $Date: 2007-11-13 16:40:29 +0100 (Tue, 13 Nov 2007) $ by $Author: zayenz $
00011  *     $Revision: 5284 $
00012  *
00013  *  This file is part of Gecode, the generic constraint
00014  *  development environment:
00015  *     http://www.gecode.org
00016  *
00017  *  Permission is hereby granted, free of charge, to any person obtaining
00018  *  a copy of this software and associated documentation files (the
00019  *  "Software"), to deal in the Software without restriction, including
00020  *  without limitation the rights to use, copy, modify, merge, publish,
00021  *  distribute, sublicense, and/or sell copies of the Software, and to
00022  *  permit persons to whom the Software is furnished to do so, subject to
00023  *  the following conditions:
00024  *
00025  *  The above copyright notice and this permission notice shall be
00026  *  included in all copies or substantial portions of the Software.
00027  *
00028  *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00029  *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00030  *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
00031  *  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
00032  *  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
00033  *  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
00034  *  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00035  *
00036  */
00037 
00038 namespace Test {
00039 
00040   /*
00041    * Iterator for propagation kinds
00042    *
00043    */
00044   inline
00045   PropKinds::PropKinds(void) 
00046     : i(sizeof(pks)/sizeof(Gecode::PropKind)-1) {}
00047   inline bool 
00048   PropKinds::operator()(void) const {
00049     return i>=0;
00050   }
00051   inline void 
00052   PropKinds::operator++(void) {
00053     i--;
00054   }
00055   inline Gecode::PropKind
00056   PropKinds::pk(void) const {
00057     return pks[i];
00058   }
00059 
00060 
00061   /*
00062    * Commandline options
00063    *
00064    */
00065   inline
00066   Options::Options(void)
00067     : seed(0), iter(defiter), fixprob(deffixprob), reflection(true), stop(true), log(false)
00068   {}
00069     
00070   /*
00071    * Base class for tests
00072    *
00073    */
00074   inline const std::string& 
00075   Base::name(void) const {
00076     return _name;
00077   }
00078   inline Base* 
00079   Base::tests(void) {
00080     return _tests;
00081   }
00082   inline Base* 
00083   Base::next(void) const {
00084     return _next;
00085   }
00086   inline bool
00087   Base::fixpoint(void) {
00088     return rand(opt.fixprob) == 0;
00089   }
00090 
00091 }
00092 
00093 // STATISTICS: test-core