Overview
Comment:Declared functions static to eliminate linker errors due to multiple definitions.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/merging-ode2odes-exe | trunk
Files: files | file ages | folders
SHA3-256: d04076ccfb35de7a24ef30aaa94ffea031cd9345b105ac2e255a0f827d7a8144
User & Date: geraint@users.sourceforge.net on 2001-03-03 00:49:33
Other Links: branch diff | manifest | tags
Context
2001-03-03
06:50:38
Added #SUMMARY lines for ode2odes. check-in: f52b542e3f user: geraint@users.sourceforge.net tags: origin/merging-ode2odes-exe, trunk
00:49:33
Declared functions static to eliminate linker errors due to multiple definitions. check-in: d04076ccfb user: geraint@users.sourceforge.net tags: origin/merging-ode2odes-exe, trunk
00:27:14
Fixed ar options to work with GNU ar. Allow mtt to create dependencies for mtt_%.cc when making mtt_%.oct. check-in: 83b666d596 user: geraint@users.sourceforge.net tags: origin/merging-ode2odes-exe, trunk
Changes

Modified mttroot/mtt/cc/include/useful-functions.hh from [f8dd1f5d60] to [6bacf30342].

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
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







-
+





-
+





-
+








-
+






-
+




















-
+






-
+







#define inline			// strip from pre-processed file
#define class_t double
#endif // __CPLUSPLUS


// == Template functions ==

inline class_t
static inline class_t
max (const class_t &x1, const class_t &x2)
{
  return ((x1 >= x2) ? x1 : (x1 < x2) ? x2 : 0);
}

inline class_t
static inline class_t
min (const class_t &x1, const class_t &x2)
{
  return ((x1 <= x2) ? x1 : (x1 > x2) ? x2 : 0);
}

inline class_t
static inline class_t
sign (const class_t &x)
{
  return ((x > 0) ? +1 : (x < 0) ? -1 : 0);
}


// == Octave functions ==

inline Matrix
static inline Matrix
ones (const int r = 1, const int c = 1)
{
  Matrix m (r, c, 1.0);
  return m;
}

inline ColumnVector
static inline ColumnVector
nozeros (const ColumnVector v0, const double tol = 0.0)
{
  ColumnVector v (v0.length ());
  register int i, j;
  for (i = j = 0; i < v.length (); i++)
    if (tol < abs (v0 (i)))
      {
	v (j) = v0 (i);
	j++;
      }
  if (0 == j)
    {
      return *new ColumnVector ();
    }
  else
    {
      return (v.extract (0, --j));
    }
}

inline ColumnVector
static inline ColumnVector
zeros (const int r)
{
  ColumnVector v (r, 0.0);
  return v;
}

inline Matrix
static inline Matrix
zeros (const int r, const int c)
{
  Matrix m (r, c, 0.0);
  return m;
}

#endif // HAVE_USEFUL_FUNCTIONS_HH


MTT: Model Transformation Tools
GitHub | SourceHut | Sourceforge | Fossil RSS ]