Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

emptiness_stats.hh

Go to the documentation of this file.
00001 // Copyright (C) 2004, 2005  Laboratoire d'Informatique de Paris 6 (LIP6),
00002 // département Systèmes Répartis Coopératifs (SRC), Université Pierre
00003 // et Marie Curie.
00004 //
00005 // This file is part of Spot, a model checking library.
00006 //
00007 // Spot is free software; you can redistribute it and/or modify it
00008 // under the terms of the GNU General Public License as published by
00009 // the Free Software Foundation; either version 2 of the License, or
00010 // (at your option) any later version.
00011 //
00012 // Spot is distributed in the hope that it will be useful, but WITHOUT
00013 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
00014 // or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
00015 // License for more details.
00016 //
00017 // You should have received a copy of the GNU General Public License
00018 // along with Spot; see the file COPYING.  If not, write to the Free
00019 // Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
00020 // 02111-1307, USA.
00021 
00022 #ifndef SPOT_TGBAALGOS_EMPTINESS_STATS_HH
00023 # define SPOT_TGBAALGOS_EMPTINESS_STATS_HH
00024 
00025 #include <cassert>
00026 
00027 namespace spot
00028 {
00029 
00032 
00038   class ec_statistics
00039   {
00040   public :
00041     ec_statistics()
00042     : states_(0), transitions_(0), depth_(0), max_depth_(0)
00043     {
00044     }
00045 
00046     void
00047     set_states(unsigned n)
00048     {
00049       states_ = n;
00050     }
00051 
00052     void
00053     inc_states()
00054     {
00055       ++states_;
00056     }
00057 
00058     void
00059     inc_transitions()
00060     {
00061       ++transitions_;
00062     }
00063 
00064     void
00065     inc_depth(unsigned n = 1)
00066     {
00067       depth_ += n;
00068       if (depth_ > max_depth_)
00069         max_depth_ = depth_;
00070     }
00071 
00072     void
00073     dec_depth(unsigned n = 1)
00074     {
00075       assert(depth_ >= n);
00076       depth_ -= n;
00077     }
00078 
00079     int
00080     states() const
00081     {
00082       return states_;
00083     }
00084 
00085     int
00086     transitions() const
00087     {
00088       return transitions_;
00089     }
00090 
00091     int
00092     max_depth() const
00093     {
00094       return max_depth_;
00095     }
00096 
00097     int
00098     depth() const
00099     {
00100       return depth_;
00101     }
00102 
00103   private :
00104     unsigned states_;           
00105     unsigned transitions_;      
00106     unsigned depth_;            
00107     unsigned max_depth_;        
00108   };
00109 
00115   class acss_statistics
00116   {
00117   public:
00119     virtual int acss_states() const = 0;
00120   };
00121 
00127   class ars_statistics
00128   {
00129   public:
00130     ars_statistics()
00131       : prefix_states_(0), cycle_states_(0)
00132     {
00133     }
00134 
00135     void
00136     inc_ars_prefix_states()
00137     {
00138       ++prefix_states_;
00139     }
00140 
00141     int
00142     ars_prefix_states() const
00143     {
00144       return prefix_states_;
00145     }
00146 
00147     void
00148     inc_ars_cycle_states()
00149     {
00150       ++cycle_states_;
00151     }
00152 
00153     int
00154     ars_cycle_states() const
00155     {
00156       return cycle_states_;
00157     }
00158 
00159   private:
00160     unsigned prefix_states_;    
00161     unsigned cycle_states_;     
00162   };
00163 
00165 }
00166 
00167 #endif // SPOT_TGBAALGOS_EMPTINESS_STATS_HH

Please comment this page and report errors about it on the RefDocComments page.
Generated on Mon Jan 31 12:54:24 2005 for spot by doxygen 1.4.0