source: trunk/src/gslapi_utility.h @ 259

Last change on this file since 259 was 259, checked in by Jari Häkkinen, 17 years ago

Moved out shuffle from vecotr class.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.2 KB
Line 
1// $Id: gslapi_utility.h 259 2005-03-04 01:09:55Z jari $
2
3#ifndef _theplu_gslapi_utility_
4#define _theplu_gslapi_utility_
5
6#include <utility>
7
8#include "vector.h"
9
10namespace theplu {
11// Jari, this should probably go somewhere else for doxygen to process.
12///
13/// All GSL wrapper functionality is to be defined within gslapi
14/// namespace.
15///
16/// There are a number of support operators and functions for the
17/// wrapper classes that do not belong to the classes themselves, but
18/// still are defined in this namespace.
19///
20namespace gslapi {
21
22  ///
23  /// This function returns the indices of the minimum and maximum
24  /// values in the sub-vector (defined by \a subset), storing them in
25  /// imin and imax. When there are several equal minimum or maximum
26  /// elements then the lowest indices are returned. The returned
27  /// index is the index from the complete vector (not the sub-vector)
28  ///
29  /// @return Index corresponding to the smallest and largest value.
30  ///
31  /// @note If \a subset is emtpy, the result is undefined.
32  ///
33  std::pair<size_t,size_t> minmax_index(const vector& vec,
34                                        const std::vector<size_t>& subset);
35
36  ///
37  /// Randomly shuffles the elements in vector \a invec
38  ///
39  void shuffle(vector& invec); 
40
41}} // of namespace gslapi and namespace theplu
42
43#endif
Note: See TracBrowser for help on using the repository browser.