File: const_additional.c

package info (click to toggle)
ruby-gsl 1.15.3%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 5,528 kB
  • ctags: 6,328
  • sloc: ansic: 62,164; ruby: 17,917; makefile: 18; sh: 15
file content (120 lines) | stat: -rw-r--r-- 4,409 bytes parent folder | download | duplicates (4)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
/*
  const_additional.c
  Ruby/GSL: Ruby extension library for GSL (GNU Scientific Library)
    (C) Copyright 2001-2006 by Yoshiki Tsunesada

  Ruby/GSL is free software: you can redistribute it and/or modify it
  under the terms of the GNU General Public License.
  This library is distributed in the hope that it will be useful, but
  WITHOUT ANY WARRANTY.
*/
#include "rb_gsl_config.h"
#include "rb_gsl_const.h"

#ifndef GSL_1_4_9_LATER
#define MKS_STEFAN_BOLTZMANN_CONSTANT (5.6703993443638e-08)
#define MKS_THOMSON_CROSS_SECTION (6.65245852869236e-29)
#define CGS_STEFAN_BOLTZMANN_CONSTANT (5.6703993443638e-05)
#define CGS_THOMSON_CROSS_SECTION (6.65245852869236e-25)
#endif

#define MKS_CLASSICAL_ELECTRON_RADIUS (2.81794028310825e-15)
#define MKS_RADIATION_DENSITY_CONSTANT (7.56576650685962e-16)
#define MKS_RADIATION_NUMBER_DENSITY_CONSTANT (20.2869161066108e-6)
#define MKS_SOLAR_TIME (4.925490947e-6)
#define MKS_SOLAR_GM (1.3271243999e20)
#define MKS_PLANCK_MASS (2.17664610503472e-08)
#define MKS_PLANCK_LENGTH (1.61609744261067e-35)
#define MKS_PLANCK_TIME (5.39072081196475e-44)

#define CGS_CLASSICAL_ELECTRON_RADIUS (2.81794028310825e-13)
#define CGS_RADIATION_DENSITY_CONSTANT (7.56576650685962e-15)
#define CGS_RADIATION_NUMBER_DENSITY_CONSTANT (20.2869161066108)
#define CGS_SOLAR_TIME (4.925490947e-6)
#define CGS_SOLAR_GM (1.3271243999e26)
#define CGS_PLANCK_MASS (2.17664610503472e-05)
#define CGS_PLANCK_LENGTH (1.61609744261067e-33)
#define CGS_PLANCK_TIME (5.39072081196475e-44)

static void rb_gsl_const_mks(VALUE module);
static void rb_gsl_const_cgs(VALUE module);
static void rb_gsl_const_num(VALUE module);

static void rb_gsl_const_mks(VALUE module)
{
  rb_define_const(module, "RADIATION_DENSITY_CONSTANT",
		  rb_float_new(MKS_RADIATION_DENSITY_CONSTANT));
  rb_define_const(module, "RADIATION_NUMBER_DENSITY_CONSTANT", 
		  rb_float_new(MKS_RADIATION_NUMBER_DENSITY_CONSTANT));
  rb_define_const(module, "CLASSICAL_ELECTRON_RADIUS",
		  rb_float_new(MKS_CLASSICAL_ELECTRON_RADIUS));
  rb_define_const(module, "SOLAR_TIME", rb_float_new(MKS_SOLAR_TIME));
  rb_define_const(module, "SOLAR_GM", rb_float_new(MKS_SOLAR_GM));

  rb_define_const(module, "PLANCK_MASS", rb_float_new(MKS_PLANCK_MASS));
  rb_define_const(module, "PLANCK_LENGTH", rb_float_new(MKS_PLANCK_LENGTH));
  rb_define_const(module, "PLANCK_TIME", rb_float_new(MKS_PLANCK_TIME));

#ifndef GSL_1_4_9_LATER
  rb_define_const(module, "STEFAN_BOLTZMANN_CONSTANT", 
		  rb_float_new(MKS_STEFAN_BOLTZMANN_CONSTANT));
  rb_define_const(module, "THOMSON_CROSS_SECTION", 
		  rb_float_new(MKS_THOMSON_CROSS_SECTION));
#endif
}

static void rb_gsl_const_cgs(VALUE module)
{
  rb_define_const(module, "RADIATION_DENSITY_CONSTANT", 
		  rb_float_new(CGS_RADIATION_DENSITY_CONSTANT));
  rb_define_const(module, "RADIATION_NUMBER_DENSITY_CONSTANT", 
		  rb_float_new(CGS_RADIATION_NUMBER_DENSITY_CONSTANT));
  rb_define_const(module, "CLASSICAL_ELECTRON_RADIUS", 
		  rb_float_new(CGS_CLASSICAL_ELECTRON_RADIUS));
  rb_define_const(module, "SOLAR_TIME", rb_float_new(CGS_SOLAR_TIME));
  rb_define_const(module, "SOLAR_GM", rb_float_new(CGS_SOLAR_GM));

  rb_define_const(module, "PLANCK_MASS", rb_float_new(CGS_PLANCK_MASS));
  rb_define_const(module, "PLANCK_LENGTH", rb_float_new(CGS_PLANCK_LENGTH));
  rb_define_const(module, "PLANCK_TIME", rb_float_new(CGS_PLANCK_TIME));

#ifndef GSL_1_4_9_LATER
  rb_define_const(module, "STEFAN_BOLTZMANN_CONSTANT", 
		  rb_float_new(CGS_STEFAN_BOLTZMANN_CONSTANT));
  rb_define_const(module, "THOMSON_CROSS_SECTION", 
		  rb_float_new(CGS_THOMSON_CROSS_SECTION));
#endif
}

static void rb_gsl_const_num(VALUE module)
{

}

void Init_gsl_const_additional(VALUE mmks, VALUE mcgs, VALUE mnum)
{
  rb_gsl_const_mks(mmks);
  rb_gsl_const_cgs(mcgs);
  rb_gsl_const_num(mnum);
}

#undef MKS_CLASSICAL_ELECTRON_RADIUS
#undef MKS_STEFAN_BOLTZMANN_CONSTANT
#undef MKS_RADIATION_DENSITY_CONSTANT
#undef MKS_RADIATION_NUMBER_DENSITY_CONSTANT
#undef CGS_CLASSICAL_ELECTRON_RADIUS 
#undef CGS_STEFAN_BOLTZMANN_CONSTANT 
#undef CGS_RADIATION_DENSITY_CONSTANT
#undef CGS_RADIATION_NUMBER_DENSITY_CONSTANT
#undef CGS_THOMSON_CROSS_SECTION
#undef MKS_THOMSON_CROSS_SECTION
#undef MKS_SOLAR_TIME
#undef CGS_SOLAR_TIME
#undef MKS_SOLAR_GM
#undef CGS_SOLAR_GM
#undef MKS_PLANCK_MASS
#undef MKS_PLANCK_LENGTH
#undef MKS_PLANCK_TIME
#undef CGS_PLANCK_MASS
#undef CGS_PLANCK_LENGTH
#undef CGS_PLANCK_TIME