source: Sophya/trunk/SophyaLib/HiStats/ntupintf.cc@ 2213

Last change on this file since 2213 was 2142, checked in by ansari, 23 years ago

MAJ ntupintf.cc pour autodoc (doc PI) - Reza 29/7/2002

  • Property svn:executable set to *
File size: 4.8 KB
Line 
1
2#include "ntupintf.h"
3#include <stdlib.h>
4#include <stdio.h>
5
6/*!
7 \class SOPHYA::NTupleInterface
8 \ingroup HiStats
9 Interface class (pure virtual) defining generic operations on NTuple,
10 a 2-dimensional data set with named columns
11*/
12
13//++
14// Class NTupleInterface
15// Lib HiStats
16// include ntupintf.h
17//
18// Interface permettant de construire des vues NTuples (tableau lignes-colonnes)
19// pour differents objets. Toutes les methodes ont une implementation par defaut.
20//--
21
22//++
23// NTupleInterface()
24// Constructeur.
25// virtual ~NTupleInterface()
26// Destructeur
27// uint_4 NbLines() const
28// Nombre de lignes du tableau
29// uint_4 NbColumns() const
30// Nombre de colonnes du tableau
31// r_8 * GetLineD(int n) const
32// Renvoie un tableau avec le contenu de la ligne "n"
33// r_8 GetCell(int n, int k) const
34// Renvoie le contenu de la cellule correspondant a la ligne "n"
35// et colonne "k"
36// r_8 GetCell(int n, string const & nom) const
37// Renvoie le contenu de la cellule correspondant a la ligne "n"
38// pour la colonne identifiee par "nom"
39// string GetCelltoString(int n, int k) const
40// Renvoie le contenu de la cellule correspondant a la ligne "n"
41// et colonne "k", sous forme de chaine de caracteres.
42// string GetCell(int n, string const & nom) const
43// Renvoie le contenu de la cellule correspondant a la ligne "n"
44// pour la colonne identifiee par "nom", sous forme de chaine de caracteres.
45// void GetMinMax(int k, double& min, double& max) const
46// Renvoie la valeur mini et maxi de la colonne numero "k"
47// void GetMinMax(string const & nom, double& min, double& max)
48// Renvoie la valeur mini et maxi de la colonne identifiee par "nom"
49// int ColumnIndex(string const & nom) const
50// Renvoie le numero de colonne identifiee par "nom". Renvoie -1 (negatif)
51// si colonne "nom" n'existe pas.
52// string ColumnName(int k) const
53// Renvoie le nom de la colonne numero "k"
54// string VarList_C(const char* nomx=NULL) const
55// Renvoie une chaine avec les declarations "C" pour les
56// variables avec les noms de colonnes
57// string LineHeaderToString()
58// Renvoie une chaine avec les noms de colonnes, utilisables pour l'impression
59// string LineToString(int n)
60// Renvoie une chaine avec le contenu de la ligne "n", utilisable pour l'impression
61//--
62
63/* --Methode-- */
64NTupleInterface::NTupleInterface()
65{
66}
67/* --Methode-- */
68NTupleInterface::~NTupleInterface()
69{
70}
71
72//! Retuns the number of lines (rows) of the data set
73/* --Methode-- */
74uint_4 NTupleInterface::NbLines() const
75{
76return(0);
77}
78
79//! Retuns the number of columns of the data set
80/* --Methode-- */
81uint_4 NTupleInterface::NbColumns() const
82{
83return(0);
84}
85
86//! Retuns the content of a given line
87/*!
88 An array (double *) containg all cells of a given line, converted to
89 float values is returned
90*/
91/* --Methode-- */
92r_8 * NTupleInterface::GetLineD(int ) const
93{
94return(NULL);
95}
96
97//! Returns the content of a given cell
98/*!
99 The cell is identified by the line and column number. Its content is
100 converted to a floating value.
101*/
102/* --Methode-- */
103r_8 NTupleInterface::GetCell(int , int ) const
104{
105return(0.);
106}
107
108//! Returns the content of a given cell
109/*!
110 The cell is identified by the line number and column name. Its content is
111 converted to a floating value.
112*/
113/* --Methode-- */
114r_8 NTupleInterface::GetCell(int n, string const & nom) const
115{
116return(GetCell(n, ColumnIndex(nom)));
117}
118
119//! Returns the string representation of a given cell
120/*!
121 The cell is identified by the line and column number. Its content is
122 converted to a string.
123*/
124string NTupleInterface::GetCelltoString(int n, int k) const
125{
126char strg[64];
127//sprintf(strg,"C%d= %g\n", k, GetCell(n, k));
128sprintf(strg,"%g\n", GetCell(n, k));
129return(strg);
130}
131
132//! Returns the string representation of a given cell
133/*!
134 The cell is identified by the line number and column name. Its content is
135 converted to a string.
136*/
137string NTupleInterface::GetCelltoString(int n, string const & nom) const
138{
139return(GetCelltoString(n, ColumnIndex(nom)));
140}
141
142//! Returns the minimum and maximum values for a given column
143/* --Methode-- */
144void NTupleInterface::GetMinMax(int , double& min, double& max) const
145{
146min = max = 0.;
147}
148
149/* --Methode-- */
150//! Returns the minimum and maximum values for a given named column
151void NTupleInterface::GetMinMax(string const & , double& min, double& max) const
152{
153min = max = 0.;
154}
155
156/* --Methode-- */
157//! Returns the column index given the column name
158int NTupleInterface::ColumnIndex(string const & nom) const
159{
160return(-1);
161}
162
163/* --Methode-- */
164//! Returns the column name corresponding to a column index.
165string NTupleInterface::ColumnName(int k) const
166{
167return("");
168}
169
170/* --Methode-- */
171string NTupleInterface::VarList_C(const char*) const
172{
173return("");
174}
175
176/* --Methode-- */
177string NTupleInterface::LineHeaderToString() const
178{
179return("");
180}
181
182/* --Methode-- */
183string NTupleInterface::LineToString(int ) const
184{
185return("");
186}
187
188
189
Note: See TracBrowser for help on using the repository browser.