-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcurves.h
More file actions
129 lines (98 loc) · 4.03 KB
/
Copy pathcurves.h
File metadata and controls
129 lines (98 loc) · 4.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
/* -*-c++-*-
* ----------------------------------------------------------------------------
*
* StructureAnalysis: Identifying patterns in plant architecture and development
*
* Copyright 1995-2018 CIRAD AGAP
*
* File author(s): Yann Guedon (yann.guedon@cirad.fr)
*
* $Source$
* $Id$
*
* Forum for StructureAnalysis developers:
*
* ----------------------------------------------------------------------------
*
* GNU General Public Licence
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS For A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; see the file COPYING. If not,
* write to the Free Software Foundation, Inc., 59
* Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* ----------------------------------------------------------------------------
*/
#ifndef CURVES_H
#define CURVES_H
#include "stat_tools.h"
namespace stat_tool {
/****************************************************************
*
* Constants
*/
/// maximum frequency for smoothing curves
const int MAX_FREQUENCY = 50;
/// maximum half-width of the smoothing window
const int MAX_RANGE = 2;
/// maximum number of curves (Gnuplot output)
const int PLOT_NB_CURVE = 12;
/// minimum frequency for plotting curve points (Gnuplot output)
const int PLOT_MIN_FREQUENCY = 10;
enum curve_transformation {
CURVE_COPY ,
SMOOTHING
};
/****************************************************************
*
* Class definition
*/
/// \brief Family of curves with frequencies
class STAT_TOOL_API Curves {
friend std::ostream& operator<<(std::ostream& , const Curves&);
public :
int nb_curve; ///< number of curves
int length; ///< curve length
int offset; ///< index of the beginning of the curves
int *index_parameter; ///< explicit index parameters
int *frequency; ///< frequency for each index
double **point; ///< curves
void copy(const Curves&);
void smooth(const Curves &curves , int max_frequency);
void remove();
Curves();
Curves(int inb_curve , int ilength , bool frequency_flag = false ,
bool index_parameter_flag = false , bool init_flag = true);
Curves(const Curves &curves , curve_transformation transform = CURVE_COPY ,
int max_frequency = MAX_FREQUENCY);
Curves(const Distribution &dist);
Curves(const FrequencyDistribution &histo);
~Curves();
Curves& operator=(const Curves &curves);
std::ostream& ascii_print(std::ostream &os , bool file_flag = false ,
const Curves *curves = NULL) const;
std::ostream& spreadsheet_print(std::ostream &os , const Curves *curves = NULL) const;
int plot_length_computation() const;
bool plot_print(const char *path , int ilength = I_DEFAULT ,
const Curves *curves_0 = NULL , const Curves *curves_1 = NULL) const;
bool plot_print_standard_residual(const char *path , double *standard_residual = NULL) const; // sequence_analysis
void plotable_write(int index , SinglePlot &plot) const;
void plotable_write(MultiPlot &plot) const;
void plotable_frequency_write(SinglePlot &plot) const;
int max_frequency_computation() const;
int nb_element_computation() const;
double mean_computation(int index) const;
double total_square_sum_computation(int index , double mean) const;
};
}; // namespace stat_tool
#endif