Alternaria
fit cylinders and ellipsoids to fungus
density.h
Go to the documentation of this file.
00001 /*
00002  * This work is licensed under a Creative Commons 
00003  * Attribution-Noncommercial-Share Alike 3.0 United States License.
00004  * 
00005  *    http://creativecommons.org/licenses/by-nc-sa/3.0/us/
00006  * 
00007  * You are free:
00008  * 
00009  *    to Share - to copy, distribute, display, and perform the work
00010  *    to Remix - to make derivative works
00011  * 
00012  * Under the following conditions:
00013  * 
00014  *    Attribution. You must attribute the work in the manner specified by the
00015  *    author or licensor (but not in any way that suggests that they endorse you
00016  *    or your use of the work).
00017  * 
00018  *    Noncommercial. You may not use this work for commercial purposes.
00019  * 
00020  *    Share Alike. If you alter, transform, or build upon this work, you may
00021  *    distribute the resulting work only under the same or similar license to
00022  *    this one.
00023  * 
00024  * For any reuse or distribution, you must make clear to others the license
00025  * terms of this work. The best way to do this is by including this header.
00026  * 
00027  * Any of the above conditions can be waived if you get permission from the
00028  * copyright holder.
00029  * 
00030  * Apart from the remix rights granted under this license, nothing in this
00031  * license impairs or restricts the author's moral rights.
00032  */
00033 
00034 
00046 #ifndef DENSITY_H
00047 #define DENSITY_H
00048 
00049 
00050 #include <config.h>
00051 
00052 #include <iostream>
00053 
00054 #include <jwsc++/base/exception.h>
00055 
00056 
00057 namespace Density {
00058 
00059 
00065 class Uniform_params
00066 {
00067     public:
00068 
00072         Uniform_params(float min=0, float max=0) 
00073             throw (jwscxx::base::Arg_error);
00074 
00075 
00077         virtual ~Uniform_params() { }
00078 
00079 
00081         virtual void set(float min, float max) throw (jwscxx::base::Arg_error);
00082 
00083 
00085         float get_min() const { return min; }
00086 
00087 
00089         float get_max() const { return max; }
00090 
00091 
00093         friend std::ostream& operator<<(std::ostream&, const Uniform_params&);
00094 
00095 
00097         friend std::istream& operator>>(std::istream&, Uniform_params&);
00098 
00099 
00100     protected:
00101 
00103         float min;
00104 
00106         float max;
00107 };
00108 
00109 
00110 
00111 
00117 class Gaussian_params
00118 {
00119     public:
00120 
00124         Gaussian_params
00125         (
00126             float mu=0, 
00127             float sigma=1, 
00128             float min=0, 
00129             float max=0
00130         ) 
00131         throw (jwscxx::base::Arg_error);
00132 
00133 
00135         virtual ~Gaussian_params() { }
00136 
00137 
00139         void set
00140         (
00141             float mu, 
00142             float sigma, 
00143             float min, 
00144             float max
00145         ) 
00146         throw (jwscxx::base::Arg_error);
00147 
00148 
00150         float get_mu() const { return mu; }
00151 
00152 
00154         float get_sigma() const { return sigma; }
00155 
00156 
00158         float get_min() const { return min; }
00159 
00160 
00162         float get_max() const { return max; }
00163 
00164 
00166         friend std::ostream& operator<<(std::ostream&, const Gaussian_params&);
00167 
00168 
00170         friend std::istream& operator>>(std::istream&, Gaussian_params&);
00171 
00172 
00173     protected:
00174 
00176         float mu;
00177 
00179         float sigma;
00180 
00182         float min;
00183 
00185         float max;
00186 };
00187 
00188 
00189 }
00190 
00191 
00192 #endif