53 #ifndef KJB_LEARNED_DISCRETE_PRIOR_H_
54 #define KJB_LEARNED_DISCRETE_PRIOR_H_
145 virtual void write(std::ostream& out)
const
149 virtual void write(
const char * fname)
const
173 static void find_min_max(
double & hmax,
double & hmin,
const char* fname);
178 find_bin(dbin, value, num_bins, histo_min, histo_max);
180 return histo_bins(bin);
const Vector & get_histo_bins() const
Returns the Vector containing the count of points in each bin.
Definition: learned_discrete_prior.cpp:350
Abstract class to write this object to an output stream.
Definition: l_writeable.h:41
void find_bin(double &bin, double element, int numBins, double min, double max) const
Determines which bin in the histogram the given element should be put in.
Definition: learned_discrete_prior.cpp:408
Int_matrix::Value_type max(const Int_matrix &mat)
Return the maximum value in this matrix.
Definition: l_int_matrix.h:1397
Abstract class to read this object from an input stream.
Definition: l_readable.h:39
virtual void read(std::istream &in)
Reads this parametric_parapiped from an input stream.
Definition: learned_discrete_prior.cpp:228
Learned_discrete_prior & operator=(const Learned_discrete_prior &dp)
Assignment operator.
Definition: learned_discrete_prior.cpp:214
virtual void write(const char *fname) const
Writes this parametric_parapiped to an output stream.
Definition: learned_discrete_prior.h:149
virtual void write(std::ostream &out) const
Writes this parametric_parapiped to a file.
Definition: learned_discrete_prior.cpp:308
~Learned_discrete_prior()
Destructor.
Definition: learned_discrete_prior.cpp:203
Learned_discrete_prior(const char *fname)
Constructs a parametric_parapiped from an input file.
Definition: learned_discrete_prior.h:115
This class implements vectors, in the linear-algebra sense, with real-valued elements.
Definition: m_vector.h:87
virtual void write(std::ostream &out) const =0
Writes this Writeable to an output stream.
double get_histo_min() const
Returns the minimum value of the histogram.
Definition: learned_discrete_prior.cpp:342
int plot_histogram(const char *name=NULL) const
Creates a plot of the histogram and saves it in ps format in a file with the provided name or plot...
Definition: learned_discrete_prior.cpp:362
Int_matrix floor(const Matrix &m)
Definition: m_matrix.cpp:2026
virtual void read(const char *fname)
Reads this parametric_parapiped from a file.
Definition: learned_discrete_prior.h:139
Learned_discrete_prior()
Definition: learned_discrete_prior.h:104
Int_matrix::Value_type min(const Int_matrix &mat)
Return the minimum value in this matrix.
Definition: l_int_matrix.h:1385
Learned_discrete_prior(std::istream &in)
Constructs a parametric_parapiped from an input stream.
Definition: learned_discrete_prior.h:122
This class creates a histogram of a list of points and stores the number of bins in num_bins...
Definition: learned_discrete_prior.h:71
int get_num_bins() const
Returns the number of bins.
Definition: learned_discrete_prior.cpp:326
Object thrown when an argument to a function is not acceptable.
Definition: l_exception.h:377
static void find_min_max(double &hmax, double &hmin, const char *fname)
Definition: learned_discrete_prior.cpp:431
virtual void read(std::istream &in)=0
Reads this Readable from an input stream.
Object thrown when input or output fails.
Definition: l_exception.h:496
double get_histo_max() const
Returns the maximum value of the histogram.
Definition: learned_discrete_prior.cpp:334
double evaluate_prior(double value) const
Definition: learned_discrete_prior.h:175
Definition for the Vector class, a thin wrapper on the KJB Vector struct and its related functionalit...