Last change
on this file since 295 was
295,
checked in by Peter, 18 years ago
|
file structure modifications. NOTE, this revision is not working, please wait for the next...
|
-
Property svn:eol-style set to
native
-
Property svn:keywords set to
Id
|
File size:
1.2 KB
|
Line | |
---|
1 | // $Id: utility.h 295 2005-04-29 09:15:58Z 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 | // Jari, this should probably go somewhere else for doxygen to process. |
---|
13 | /// |
---|
14 | /// All GSL wrapper functionality is to be defined within gslapi |
---|
15 | /// namespace. |
---|
16 | /// |
---|
17 | /// There are a number of support operators and functions for the |
---|
18 | /// wrapper classes that do not belong to the classes themselves, but |
---|
19 | /// still are defined in this namespace. |
---|
20 | /// |
---|
21 | namespace gslapi { |
---|
22 | |
---|
23 | /// |
---|
24 | /// This function returns the indices of the minimum and maximum |
---|
25 | /// values in the sub-vector (defined by \a subset), storing them in |
---|
26 | /// imin and imax. When there are several equal minimum or maximum |
---|
27 | /// elements then the lowest indices are returned. The returned |
---|
28 | /// index is the index from the complete vector (not the sub-vector) |
---|
29 | /// |
---|
30 | /// @return Index corresponding to the smallest and largest value. |
---|
31 | /// |
---|
32 | /// @note If \a subset is emtpy, the result is undefined. |
---|
33 | /// |
---|
34 | std::pair<size_t,size_t> minmax_index(const vector& vec, |
---|
35 | const std::vector<size_t>& subset); |
---|
36 | |
---|
37 | /// |
---|
38 | /// Randomly shuffles the elements in vector \a invec |
---|
39 | /// |
---|
40 | void shuffle(vector& invec); |
---|
41 | |
---|
42 | }} // of namespace gslapi and namespace theplu |
---|
43 | |
---|
44 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.