Bsoft  2.1.0
Bernard's software package
math_util.h
Go to the documentation of this file.
1 
9 #include <stdlib.h>
10 #include <cmath>
11 #ifdef SUNOS
12 #include <ieeefp.h>
13 #endif
14 
15 #include "Bstring.h"
16 #include "utilities.h"
17 
18 // Function prototypes
19 double bfloor(double value, int places);
20 double bround(double value, int places);
21 double factorial(int n);
22 double number_of_combinations(int n, int r);
23 int partition(vector<double>& a, int n, int k);
24 int partition(double* a, int n, int k);
25 long* prime_factors(long number, long& n);
26 long smallest_prime(long number);
28 double fishers_z_transform(double value);
29 double betacf(double a, double b, double x);
30 double betai (double a, double b, double x);
31 double kmeans_threshold(long n, double* v);
32 
33 
bfloor
double bfloor(double value, int places)
Truncates a value to a specified number of decimal places.
Definition: math_util.cpp:21
Bstring
Definition: Bstring.h:29
factorial
double factorial(int n)
Calculates the factorial of n.
Definition: math_util.cpp:66
betacf
double betacf(double a, double b, double x)
Evaluates the continued fraction for the incomplete beta function.
Definition: math_util.cpp:268
number_of_combinations
double number_of_combinations(int n, int r)
Calculates the number of combinations of size r in set of size n.
Definition: math_util.cpp:97
Bstring.h
Header file for the string class.
partition
int partition(vector< double > &a, int n, int k)
Determines the index k'th value in the array.
Definition: math_util.cpp:123
prime_factors
long * prime_factors(long number, long &n)
Finds all the prime factor for the input number.
Definition: math_util.cpp:152
utilities.h
Header file for general utilities.
kmeans_threshold
double kmeans_threshold(long n, double *v)
Finds a threshold that partitions an array into foreground and background clusters.
Definition: math_util.cpp:345
fishers_z_transform
double fishers_z_transform(double value)
Calculates Fisher's z-transform.
Definition: math_util.cpp:249
bround
double bround(double value, int places)
Rounds a value to a specified number of decimal places.
Definition: math_util.cpp:39
smallest_prime
long smallest_prime(long number)
Finds the smallest prime number factor of the input number.
Definition: math_util.cpp:191
betai
double betai(double a, double b, double x)
Calculates the incomplete beta function Ix(a,b).
Definition: math_util.cpp:320
next_permutation
int next_permutation(Bstring &s)
Produces the next permutation in lexical order.
Definition: math_util.cpp:220