~ubuntu-branches/ubuntu/raring/blitz++/raring

« back to all changes in this revision

Viewing changes to blitz/vecmax.cc

  • Committer: Bazaar Package Importer
  • Author(s): Konstantinos Margaritis
  • Date: 2005-02-28 20:25:01 UTC
  • mfrom: (2.1.2 hoary)
  • Revision ID: james.westby@ubuntu.com-20050228202501-3i4f2sknnprsqfhz
Tags: 1:0.8-4
Added missing build-depends (Closes: #297323)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * $Id: vecmax.cc,v 1.1.1.1 2000/06/19 12:26:08 tveldhui Exp $
 
2
 * $Id: vecmax.cc,v 1.3 2003/12/11 03:44:22 julianc Exp $
3
3
 *
4
4
 * Copyright (C) 1997 Todd Veldhuizen <tveldhui@oonumerics.org>
5
5
 * All rights reserved.  Please see <blitz/blitz.h> for terms and
6
6
 * conditions of use.
7
7
 *
8
 
 * $Log: vecmax.cc,v $
9
 
 * Revision 1.1.1.1  2000/06/19 12:26:08  tveldhui
10
 
 * Imported sources
11
 
 *
12
 
 * Revision 1.4  1998/03/14 00:04:47  tveldhui
13
 
 * 0.2-alpha-05
14
 
 *
15
 
 * Revision 1.3  1997/07/16 14:51:20  tveldhui
16
 
 * Update: Alpha release 0.2 (Arrays)
17
 
 *
18
 
 * Revision 1.2  1997/01/24 14:42:00  tveldhui
19
 
 * Periodic RCS update
20
 
 *
21
8
 */
22
9
 
23
10
#ifndef BZ_VECMAX_CC
29
16
 
30
17
BZ_NAMESPACE(blitz)
31
18
 
32
 
template<class P_expr>
 
19
template<typename P_expr>
33
20
inline
34
21
Extremum<_bz_typename P_expr::T_numtype, int> _bz_vec_max(P_expr vector)
35
22
{
67
54
}
68
55
 
69
56
// max(vector)
70
 
template<class P_numtype>
 
57
template<typename P_numtype>
71
58
inline
72
59
Extremum<P_numtype, int> max(const Vector<P_numtype>& x)
73
60
{
75
62
}
76
63
 
77
64
// max(expr)
78
 
template<class P_expr>
 
65
template<typename P_expr>
79
66
inline
80
67
Extremum<_bz_typename P_expr::T_numtype,int> max(_bz_VecExpr<P_expr> x)
81
68
{
83
70
}
84
71
 
85
72
// max(vecpick)
86
 
template<class P_numtype>
 
73
template<typename P_numtype>
87
74
inline
88
75
Extremum<P_numtype, int> max(const VectorPick<P_numtype>& x)
89
76
{
91
78
}
92
79
 
93
80
// max(TinyVector)
94
 
template<class P_numtype, int N_length>
 
81
template<typename P_numtype, int N_length>
95
82
inline
96
83
Extremum<P_numtype, int>
97
84
max(const TinyVector<P_numtype, N_length>& x)
101
88
 
102
89
 
103
90
// maxIndex(vector)
104
 
template<class P_numtype>
 
91
template<typename P_numtype>
105
92
inline
106
93
int  maxIndex(const Vector<P_numtype>& x)
107
94
{
109
96
}
110
97
 
111
98
// maxIndex(expr)
112
 
template<class P_expr>
 
99
template<typename P_expr>
113
100
inline
114
101
int maxIndex(_bz_VecExpr<P_expr> x)
115
102
{
117
104
}
118
105
 
119
106
// maxIndex(vecpick)
120
 
template<class P_numtype>
 
107
template<typename P_numtype>
121
108
int  maxIndex(const VectorPick<P_numtype>& x)
122
109
{
123
110
    return _bz_vec_max(x._bz_asVecExpr()).index();
124
111
}
125
112
 
126
113
// maxIndex(TinyVector)
127
 
template<class P_numtype, int N_length>
 
114
template<typename P_numtype, int N_length>
128
115
int  maxIndex(const TinyVector<P_numtype, N_length>& x)
129
116
{
130
117
    return _bz_vec_max(x._bz_asVecExpr()).index();
131
118
}
132
119
 
133
120
// maxValue(vector)
134
 
template<class P_numtype>
 
121
template<typename P_numtype>
135
122
inline
136
123
int  maxValue(const Vector<P_numtype>& x)
137
124
{
139
126
}
140
127
 
141
128
// maxValue(expr)
142
 
template<class P_expr>
 
129
template<typename P_expr>
143
130
inline
144
131
int  maxValue(_bz_VecExpr<P_expr> x)
145
132
{
147
134
}
148
135
 
149
136
// maxValue(vecpick)
150
 
template<class P_numtype>
 
137
template<typename P_numtype>
151
138
int  maxValue(const VectorPick<P_numtype>& x)
152
139
{
153
140
    return _bz_vec_max(x._bz_asVecExpr()).value();
154
141
}
155
142
 
156
143
// maxValue(TinyVector)
157
 
template<class P_numtype, int N_length>
 
144
template<typename P_numtype, int N_length>
158
145
int  maxValue(const TinyVector<P_numtype, N_length>& x)
159
146
{
160
147
    return _bz_vec_max(x._bz_asVecExpr()).value();