]> www.ginac.de Git - ginac.git/blob - ginac/utils.cpp
ae0160d43dc0f494067d5667091d636c40e73dc7
[ginac.git] / ginac / utils.cpp
1 /** @file utils.cpp
2  *
3  *  Implementation of several small and furry utilities. */
4
5 unsigned log2(unsigned n)
6 {
7     unsigned k;
8     for (k = 0; n > 1; n >>= 1) ++k;
9     return k;
10 }
11
12 int compare_pointers(void const * a, void const * b)
13 {
14     if (a<b) {
15         return -1;
16     } else if (a>b) {
17         return 1;
18     }
19     return 0;
20 }
21
22 // comment skeletton for header files
23
24
25 // member functions
26
27     // default constructor, destructor, copy constructor assignment operator and helpers
28     // none
29
30     // other constructors
31     // none
32
33     // functions overriding virtual functions from bases classes
34     // none
35     
36     // new virtual functions which can be overridden by derived classes
37     // none
38
39     // non-virtual functions in this class
40     // none
41
42 // member variables
43 // none
44     
45
46
47 // comment skeletton for implementation files
48
49
50 //////////
51 // default constructor, destructor, copy constructor assignment operator and helpers
52 //////////
53
54 // public
55 // protected
56
57 //////////
58 // other constructors
59 //////////
60
61 // public
62 // none
63
64 //////////
65 // functions overriding virtual functions from bases classes
66 //////////
67
68 // public
69 // protected
70 // none
71
72 //////////
73 // new virtual functions which can be overridden by derived classes
74 //////////
75
76 // public
77 // protected
78 // none
79
80 //////////
81 // non-virtual functions in this class
82 //////////
83
84 // public
85 // protected
86 // none
87
88 //////////
89 // static member variables
90 //////////
91
92 // protected
93 // private
94 // none
95
96
97
98