DDD  1.9.0.20240425101308
statistic.hpp
Go to the documentation of this file.
1 /****************************************************************************/
2 /* */
3 /* This file is part of libDDD, a library for manipulation of DDD and SDD. */
4 /* */
5 /* Copyright (C) 2001-2008 Yann Thierry-Mieg, Jean-Michel Couvreur */
6 /* and Denis Poitrenaud */
7 /* */
8 /* This program is free software; you can redistribute it and/or modify */
9 /* it under the terms of the GNU Lesser General Public License as */
10 /* published by the Free Software Foundation; either version 3 of the */
11 /* License, or (at your option) any later version. */
12 /* This program is distributed in the hope that it will be useful, */
13 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
14 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
15 /* GNU LEsserGeneral Public License for more details. */
16 /* */
17 /* You should have received a copy of the GNU Lesser General Public License */
18 /* along with this program; if not, write to the Free Software */
19 /*Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
20 /* */
21 /****************************************************************************/
22 
23 #include <iostream>
24 #include <string>
25 #include "ddd/SDD.h"
26 #include "ddd/DDD.h"
27 
28 
29 
30 typedef enum {CSV, LATEX} OutputType;
31 
32 class Statistic {
34  long double nb_Stat;
36  long double DDD_size;
38  long double SDD_size;
40  long double DDD_peak_size;
42  long double SDD_peak_size;
44  double total_time;
46  size_t memory;
48  double nbHom;
50  double nbShom;
52  double ddd_cache;
54  double sdd_cache;
56  bool isPureDDD;
60  std::string stat_name;
61 
63  size_t shom_cache;
64 
66  bool show_peak;
68  void load (const SDD & s);
70  void load (const DDD & s);
71 public:
72 
79  Statistic (const SDD & s, const std::string & name, OutputType style=LATEX, bool show_peak = true);
86  Statistic (const DDD & s, const std::string & name, OutputType style=LATEX, bool show_peak = true);
87 
90  void print_header (std::ostream & os);
91 
94  void print_trailer (std::ostream & os, bool withLegend=true);
95 
98  void print_line (std::ostream &os);
99 
103  void print_table (std::ostream & os);
104 
107  void print_legend (std::ostream & os);
108 
111 
113  double getTime() const { return total_time; }
114  long double getNbStates () const { return nb_Stat; }
115 
116 };
117 
This class is the public interface for manipulating Data Decision Diagrams.
Definition: DDD.h:255
This class is the public interface for manipulating Data Decision Diagrams.
Definition: SDD.h:279
Definition: statistic.hpp:32
bool show_peak
show peak
Definition: statistic.hpp:66
long double SDD_size
number of final SDD nodes
Definition: statistic.hpp:38
long double getNbStates() const
Definition: statistic.hpp:114
long double DDD_size
number of final DDD nodes
Definition: statistic.hpp:36
bool isPureDDD
Mode : include SDD or not.
Definition: statistic.hpp:56
Statistic(const SDD &s, const std::string &name, OutputType style=LATEX, bool show_peak=true)
Create a statistic for the current SDD s, style LATEX by default.
Definition: statistic.cpp:40
double nbShom
SHom final.
Definition: statistic.hpp:50
void print_table(std::ostream &os)
Convenience print a table.
Definition: statistic.cpp:139
OutputType style
Mode : outputType.
Definition: statistic.hpp:58
size_t shom_cache
Size of SHom cache.
Definition: statistic.hpp:63
double getTime() const
Accessors.
Definition: statistic.hpp:113
double nbHom
Hom final.
Definition: statistic.hpp:48
void print_line(std::ostream &os)
Print a line for current statistic.
Definition: statistic.cpp:113
long double nb_Stat
number of final states
Definition: statistic.hpp:34
double ddd_cache
DDD cache.
Definition: statistic.hpp:52
void print_header(std::ostream &os)
Print column headers, using current style.
Definition: statistic.cpp:83
double sdd_cache
SDD cache peak.
Definition: statistic.hpp:54
void setStyle(OutputType style)
Setter for style.
void load(const SDD &s)
load from a SDD
Definition: statistic.cpp:48
long double SDD_peak_size
peak DDD unicity table size
Definition: statistic.hpp:42
void print_legend(std::ostream &os)
Print a legend to the table.
Definition: statistic.cpp:147
double total_time
total time
Definition: statistic.hpp:44
std::string stat_name
Name of this statistic.
Definition: statistic.hpp:60
long double DDD_peak_size
peak DDD unicity table size
Definition: statistic.hpp:40
size_t memory
resident mem (kb)
Definition: statistic.hpp:46
void print_trailer(std::ostream &os, bool withLegend=true)
Print trailer.
Definition: statistic.cpp:132
OutputType
Definition: statistic.hpp:30
@ CSV
Definition: statistic.hpp:30
@ LATEX
Definition: statistic.hpp:30

Please comment this page and report errors about it on the RefDocComments page.
Generated on Thu Apr 25 2024 10:15:16 for DDD by doxygen 1.9.1