File: rsample.h

package info (click to toggle)
smalt 0.7.6-13
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 72,824 kB
  • sloc: ansic: 26,340; sh: 3,826; python: 1,472; makefile: 323
file content (31 lines) | stat: -rw-r--r-- 801 bytes parent folder | download | duplicates (6)
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
/** Draw random samples from probability distributions */

#ifdef __cplusplus
extern "C"
{
#endif

#ifndef RSAMPLE_H
#define RSAMPLE_H

#include "randef.h"

  int rsampleNormal(double *val, int n, double mu, double va);
  /**< Generate a sample of n N(mu,va) normal distributed values.
   * \param val Array of n elements returning the sample.
   * \param n Sample size (number of elements in array val).
   * \param mu Distribution mean.
   * \param va Distribution variance.
   */

  int rsampleGeometric(int *val, int n, double p);
  /**< Generate a sample of size n from the geometric distribution
   * \param val Array of n elements returning the sample.
   * \param  n Sample size (number of elements in array val).
   * \param p Probability 0 < p < 1.
   */

#endif
#ifdef __cplusplus
}
#endif