]> www.ginac.de Git - ginac.git/blob - ginac/utils.cpp
- docs now under automake control
[ginac.git] / ginac / utils.cpp
1 /** @file utils.cpp
2  *
3  *  Implementation of several small and furry utilities.
4  *
5  *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
6  *
7  *  This program is free software; you can redistribute it and/or modify
8  *  it under the terms of the GNU General Public License as published by
9  *  the Free Software Foundation; either version 2 of the License, or
10  *  (at your option) any later version.
11  *
12  *  This program is distributed in the hope that it will be useful,
13  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  *  GNU General Public License for more details.
16  *
17  *  You should have received a copy of the GNU General Public License
18  *  along with this program; if not, write to the Free Software
19  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20  */
21
22 #include "utils.h"
23
24 unsigned log2(unsigned n)
25 {
26     unsigned k;
27     for (k = 0; n > 1; n >>= 1) ++k;
28     return k;
29 }
30
31 int compare_pointers(void const * a, void const * b)
32 {
33     if (a<b) {
34         return -1;
35     } else if (a>b) {
36         return 1;
37     }
38     return 0;
39 }
40
41 // comment skeletton for header files
42
43
44 // member functions
45
46     // default constructor, destructor, copy constructor assignment operator and helpers
47     // none
48
49     // other constructors
50     // none
51
52     // functions overriding virtual functions from bases classes
53     // none
54     
55     // new virtual functions which can be overridden by derived classes
56     // none
57
58     // non-virtual functions in this class
59     // none
60
61 // member variables
62 // none
63     
64
65
66 // comment skeletton for implementation files
67
68
69 //////////
70 // default constructor, destructor, copy constructor assignment operator and helpers
71 //////////
72
73 // public
74 // protected
75
76 //////////
77 // other constructors
78 //////////
79
80 // public
81 // none
82
83 //////////
84 // functions overriding virtual functions from bases classes
85 //////////
86
87 // public
88 // protected
89 // none
90
91 //////////
92 // new virtual functions which can be overridden by derived classes
93 //////////
94
95 // public
96 // protected
97 // none
98
99 //////////
100 // non-virtual functions in this class
101 //////////
102
103 // public
104 // protected
105 // none
106
107 //////////
108 // static member variables
109 //////////
110
111 // protected
112 // private
113 // none
114
115
116
117