- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

# bencher.hh

    00001 // bencher.hh: this file is part of the Vaucanson project.
    00002 //
    00003 // Vaucanson, a generic library for finite state machines.
    00004 // Copyright (C) 2007 The Vaucanson Group.
    00005 //
    00006 // This library is free software; you can redistribute it and/or
    00007 // modify it under the terms of the GNU Lesser General Public
    00008 // License as published by the Free Software Foundation; either
    00009 // version 2.1 of the License, or 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 GNU
    00014 // Lesser General Public License for more details.
    00015 //
    00016 // You should have received a copy of the GNU Lesser General Public
    00017 // License along with this library; if not, write to the Free Software
    00018 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
    00019 //
    00020
    00021 #ifndef BENCHER_HH
    00022 # define BENCHER_HH
    00023
    00024 # include <vector>
    00025 # include <iostream>
    00026
    00027 # include <vaucanson/misc/timer.hh>
    00028
    00029 NAMESPACE_VCSN_BEGIN
    00030
    00031 namespace misc
    00032 {
    00033   class Bencher
    00034   {
    00035   public:
    00037     void push (const Timer& t);
    00038
    00040     std::ostream& print (std::ostream& o) const;
    00041
    00042     void plot (std::ostream& o) const;
    00043
    00045     Timer sum() const;
    00046
    00048     Timer mean() const;
    00049
    00051     Timer min() const;
    00052
    00054     Timer max() const;
    00055
    00056   private:
    00058     Timer prepare (Timer t) const;
    00059
    00061     std::vector<Timer> timers_;
    00062   };
    00063
    00064
    00066   std::ostream& operator<< (std::ostream& o, const Bencher& t);
    00067 }
    00068
    00069 NAMESPACE_VCSN_END
    00070
    00071 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
    00072 #  include <vaucanson/misc/bencher.hxx>
    00073 #  if VAUCANSON
    00074 #   include <vaucanson/misc/bencher.cc>
    00075 #  endif
    00076 # endif // VCSN_USE_INTERFACE_ONLY
    00077
    00078 #endif // !BENCHER_HH