bpp-core  2.2.0
MultipleDiscreteDistribution.h
Go to the documentation of this file.
1 //
2 // File: MultipleDiscreteDistribution.h
3 // Created by: Laurent Guéguen
4 // Created on: mardi 20 juillet 2010, à 14h 52
5 //
6 
7 /*
8  Copyright or © or Copr. Bio++ Development Team, (November 19, 2004)
9 
10  This software is a computer program whose purpose is to provide classes
11  for numerical calculus.
12 
13  This software is governed by the CeCILL license under French law and
14  abiding by the rules of distribution of free software. You can use,
15  modify and/ or redistribute the software under the terms of the CeCILL
16  license as circulated by CEA, CNRS and INRIA at the following URL
17  "http://www.cecill.info".
18 
19  As a counterpart to the access to the source code and rights to copy,
20  modify and redistribute granted by the license, users are provided only
21  with a limited warranty and the software's author, the holder of the
22  economic rights, and the successive licensors have only limited
23  liability.
24 
25  In this respect, the user's attention is drawn to the risks associated
26  with loading, using, modifying and/or developing or reproducing the
27  software by the user in light of its specific status of free software,
28  that may mean that it is complicated to manipulate, and that also
29  therefore means that it is reserved for developers and experienced
30  professionals having in-depth computer knowledge. Users are therefore
31  encouraged to load and test the software's suitability as regards their
32  requirements in conditions enabling the security of their systems and/or
33  data to be ensured and, more generally, to use and operate it in the
34  same conditions as regards security.
35 
36  The fact that you are presently reading this means that you have had
37  knowledge of the CeCILL license and that you accept its terms.
38 */
39 
40 #ifndef _MULTIPLEDISCRETEDISTRIBUTION_H_
41 #define _MULTIPLEDISCRETEDISTRIBUTION_H_
42 
43 #include "../VectorTools.h"
44 #include "../ParameterAliasable.h"
45 #include "../../Exceptions.h"
46 #include "../../Io/OutputStream.h"
47 
48 namespace bpp
49 {
50 
69  public virtual ParameterAliasable
70  {
71  public:
73 
75 
76 #ifndef NO_VIRTUAL_COV
77  MultipleDiscreteDistribution * clone() const = 0;
78 #endif
79 
80  public:
81 
85  virtual size_t getNumberOfCategories() const = 0;
86 
94  virtual Vdouble getValueCategory(Vdouble& Vvalue) const = 0;
95 
100  virtual double getProbability(Vdouble& category) const = 0;
101 
102 
103  public:
104 
113  virtual Vdouble rand() const = 0;
114 
123  virtual Vdouble randC() const = 0;
124 
137  //virtual bool adaptToConstraint(const std::vector<Constraint&>& vc, bool f=true) = 0;
138 
144  // virtual void print(OutputStream& out) const = 0;
145 
146  };
147 
148 } //end of namespace bpp.
149 
150 #endif //_MULTIPLEDISCRETEDISTRIBUTION_H_
151 
Interface for multiple discrete distribution objects.
Extend the Parametrizable interface with support for parameter aliases.
This class allows to perform a correspondence analysis.
virtual Vdouble getValueCategory(Vdouble &Vvalue) const =0
virtual size_t getNumberOfCategories() const =0
virtual double getProbability(Vdouble &category) const =0
std::vector< double > Vdouble
Definition: VectorTools.h:67
MultipleDiscreteDistribution * clone() const =0
Create a copy of this object and send a pointer to it.
virtual Vdouble rand() const =0
Draw a random vector from this distribution.
virtual Vdouble randC() const =0
Draw a random vector from the continuous version of this distribution, if it exists.