Last change
on this file since 597 was
304,
checked in by Peter, 17 years ago
|
moved namespace dox to separate file
|
-
Property svn:eol-style set to
native
-
Property svn:keywords set to
Id
|
File size:
927 bytes
|
Line | |
---|
1 | // $Id: utility.h 304 2005-05-02 14:10:50Z peter $ |
---|
2 | |
---|
3 | #ifndef _theplu_gslapi_utility_ |
---|
4 | #define _theplu_gslapi_utility_ |
---|
5 | |
---|
6 | #include <utility> |
---|
7 | |
---|
8 | #include <c++_tools/gslapi/vector.h> |
---|
9 | |
---|
10 | |
---|
11 | namespace theplu { |
---|
12 | namespace gslapi { |
---|
13 | |
---|
14 | /// |
---|
15 | /// This function returns the indices of the minimum and maximum |
---|
16 | /// values in the sub-vector (defined by \a subset), storing them in |
---|
17 | /// imin and imax. When there are several equal minimum or maximum |
---|
18 | /// elements then the lowest indices are returned. The returned |
---|
19 | /// index is the index from the complete vector (not the sub-vector) |
---|
20 | /// |
---|
21 | /// @return Index corresponding to the smallest and largest value. |
---|
22 | /// |
---|
23 | /// @note If \a subset is emtpy, the result is undefined. |
---|
24 | /// |
---|
25 | std::pair<size_t,size_t> minmax_index(const vector& vec, |
---|
26 | const std::vector<size_t>& subset); |
---|
27 | |
---|
28 | /// |
---|
29 | /// Randomly shuffles the elements in vector \a invec |
---|
30 | /// |
---|
31 | void shuffle(vector& invec); |
---|
32 | |
---|
33 | }} // of namespace gslapi and namespace theplu |
---|
34 | |
---|
35 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.