NEURON
math.cpp
Go to the documentation of this file.
1
#ifdef HAVE_CONFIG_H
2
#include <../../nrnconf.h>
3
#endif
4
/*
5
* Copyright (c) 1991 Stanford University
6
* Copyright (c) 1991 Silicon Graphics, Inc.
7
*
8
* Permission to use, copy, modify, distribute, and sell this software and
9
* its documentation for any purpose is hereby granted without fee, provided
10
* that (i) the above copyright notices and this permission notice appear in
11
* all copies of the software and related documentation, and (ii) the names of
12
* Stanford and Silicon Graphics may not be used in any advertising or
13
* publicity relating to the software without the specific, prior written
14
* permission of Stanford and Silicon Graphics.
15
*
16
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
17
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
18
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
19
*
20
* IN NO EVENT SHALL STANFORD OR SILICON GRAPHICS BE LIABLE FOR
21
* ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
22
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
23
* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
24
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
25
* OF THIS SOFTWARE.
26
*/
27
28
#include <stdlib.h>
29
#include <
math.h
>
30
#include <
OS/math.h
>
31
32
/* would that these lived in a standard place ... */
33
#if defined(IVOS_FABS)
34
#define myfabs IVOS_FABS
35
#else
36
extern
"C"
{
37
extern
int
abs
(
int
);
38
extern
double
fabs
(
double
);
39
}
// extern "C"
40
#define myfabs ::fabs
41
#endif
42
43
int
Math::abs
(
int
x) {
return ::abs
(x); }
44
long
Math::abs
(
long
x) {
return
x >= 0 ? x : -x; }
45
double
Math::abs
(
double
x) {
return
myfabs
(x); }
46
47
48
#include <
InterViews/geometry.h
>
49
50
Extension::Extension
() {}
51
52
void
Extension::set_xy
(
Canvas
*,
Coord
left
,
Coord
bottom,
Coord
right
,
Coord
top) {
53
x_begin_
=
left
;
y_begin_
=
bottom
;
x_end_
=
right
;
y_end_
=
top
;
54
}
Canvas
#define Canvas
Definition:
_defines.h:65
Coord
#define Coord
Definition:
_defines.h:19
Extension::left
Coord left() const
Definition:
geometry.h:297
Extension::set_xy
void set_xy(Canvas *, Coord left, Coord bottom, Coord right, Coord top)
Definition:
math.cpp:52
Extension::top
Coord top() const
Definition:
geometry.h:300
Extension::y_begin_
Coord y_begin_
Definition:
geometry.h:201
Extension::x_end_
Coord x_end_
Definition:
geometry.h:200
Extension::bottom
Coord bottom() const
Definition:
geometry.h:298
Extension::right
Coord right() const
Definition:
geometry.h:299
Extension::Extension
Extension()
Definition:
math.cpp:50
Extension::x_begin_
Coord x_begin_
Definition:
geometry.h:199
Extension::y_end_
Coord y_end_
Definition:
geometry.h:202
Math::abs
static int abs(int)
Definition:
math.cpp:43
geometry.h
fabs
double fabs(double)
abs
int abs(int)
myfabs
#define myfabs
Definition:
math.cpp:40
math.h
left
#define left
Definition:
rbtqueue.cpp:45
right
#define right
Definition:
rbtqueue.cpp:46
src
ivos
math.cpp