numerics.h Source File (original) (raw)
00001 00014 00015 00016 00017 00018 00019 00020 00021 00022 00023 00024 00025 00026 00027 00028 00029 #ifndef _GAN_NUMERICS_H 00030 #define _GAN_NUMERICS_H 00031 00032 #include <stdlib.h> 00033 #include <gandalf/common/misc_defs.h> 00034 #include <gandalf/common/complex.h> 00035 00036 #ifdef __cplusplus 00037 extern "C" { 00038 #endif 00039 00050 00051 int gan_sqr_i ( int x ); 00052 unsigned gan_sqr_ui ( unsigned x ); 00053 long gan_sqr_l ( long x ); 00054 float gan_sqr_f ( float x ); 00055 double gan_sqr_d ( double x ); 00056 double gan_cbrt ( double x ); 00057 double gan_normal_sample ( double mu, double sigma ); 00058 int gan_solve_quadratic ( double a, double b, double c, 00059 Gan_Complex x[2] ); 00060 int gan_solve_cubic ( double a, double b, double c, double d, 00061 Gan_Complex x[3] ); 00062 00066 double gan_sqr ( double x ); 00067 00071 long gan_random(void); 00072 00076 void gan_random_set_seed ( unsigned seed ); 00077 00081 double gan_random_01(void); 00082 00086 double gan_random_m11(void); 00087 00088 void *gan_kth_highest ( void *base, size_t nmemb, size_t size, 00089 unsigned int k, 00090 int (*compar)(const void *, const void *) ); 00091 00100 #ifdef __cplusplus 00101 } 00102 #endif 00103 00104 #endif