4 #ifndef __UTIL_MATH_CDF_H__
5 #define __UTIL_MATH_CDF_H__
14 template<
typename Functor>
16 const int resolution,
const float from,
const float to, Functor functor,
vector<float> &cdf)
18 const int cdf_count = resolution + 1;
19 const float range = to -
from;
20 cdf.resize(cdf_count);
23 for (
int i = 0; i < resolution; ++i) {
24 float x =
from + range * (
float)i / (resolution - 1);
26 cdf[i + 1] = cdf[i] +
fabsf(
y);
29 for (
int i = 0; i <= resolution; i++) {
30 cdf[i] /= cdf[resolution];
39 const bool make_symmetric,
43 template<
typename Functor>
48 const bool make_symmetric,
typedef float(TangentPoint)[2]
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
#define CCL_NAMESPACE_END
CCL_NAMESPACE_BEGIN void util_cdf_evaluate(const int resolution, const float from, const float to, Functor functor, vector< float > &cdf)
void util_cdf_invert(const int resolution, const float from, const float to, const vector< float > &cdf, const bool make_symmetric, vector< float > &inv_cdf)
void util_cdf_inverted(const int resolution, const float from, const float to, Functor functor, const bool make_symmetric, vector< float > &inv_cdf)