UQTk: Uncertainty Quantification Toolkit  3.1.1
minmax.h
Go to the documentation of this file.
1 /* =====================================================================================
2 
3  The UQ Toolkit (UQTk) version 3.1.1
4  Copyright (2021) NTESS
5  https://www.sandia.gov/UQToolkit/
6  https://github.com/sandialabs/UQTk
7 
8  Copyright 2021 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
9  Under the terms of Contract DE-NA0003525 with NTESS, the U.S. Government
10  retains certain rights in this software.
11 
12  This file is part of The UQ Toolkit (UQTk)
13 
14  UQTk is open source software: you can redistribute it and/or modify
15  it under the terms of BSD 3-Clause License
16 
17  UQTk is distributed in the hope that it will be useful,
18  but WITHOUT ANY WARRANTY; without even the implied warranty of
19  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  BSD 3 Clause License for more details.
21 
22  You should have received a copy of the BSD 3 Clause License
23  along with UQTk. If not, see https://choosealicense.com/licenses/bsd-3-clause/.
24 
25  Questions? Contact the UQTk Developers at <uqtk-developers@software.sandia.gov>
26  Sandia National Laboratories, Livermore, CA, USA
27 ===================================================================================== */
28 #ifndef MINMAX_H
29 #define MINMAX_H
30 
37 #ifndef M_PI
38 #define M_PI atan(1.0) * 4.0
39 #endif
40 
41 
44 
46 double maxVal(Array1D<double>& vector) ;
48 int maxVal(const Array1D<int> &vector) ;
50 double maxVal(const Array2D<double> &vector) ;
52 int maxVal(const Array2D<int> &vector) ;
53 
55 double minVal(const Array1D<double> &vector) ;
57 int minVal(const Array1D<int> &vector) ;
59 double minVal(const Array2D<double> &vector) ;
61 int minVal(const Array2D<int> &vector) ;
62 
64 int maxIndex(Array1D<double>& vector);
66 int maxIndex(Array1D<int>& vector);
68 int minIndex(Array1D<double>& vector);
70 int minIndex(Array1D<int>& vector);
71 
72 
74 //int maxIndexR_2D(const Array2D<double>& vector, const int irow);
76 //int minIndexR_2D(const Array2D<double>& vector, const int irow);
78 int maxIndexC_2D(const Array2D<double>& vector, const int icol);
80 int minIndexC_2D(const Array2D<double>& vector, const int icol);
81 
82 #endif // MINMAX_H
Definition: Array1D.h:472
Definition: Array1D.h:262
int maxIndex(Array1D< double > &vector)
Returns the index of the maximal value of a 1d double array.
Definition: minmax.cpp:158
int maxIndexC_2D(const Array2D< double > &vector, const int icol)
Returns the column number of the maximal element in the irow-th row of a 2d double array.
Definition: minmax.cpp:240
double minVal(const Array1D< double > &vector)
Returns the minimum value of a 1d double array.
Definition: minmax.cpp:112
int minIndexC_2D(const Array2D< double > &vector, const int icol)
Returns the row number of the minimal element in the icol-th column of a 2d double array.
Definition: minmax.cpp:259
void getDomain(Array2D< double > &data_in, Array1D< double > &a, Array1D< double > &b)
Get domain of the data.
Definition: minmax.cpp:38
double maxVal(Array1D< double > &vector)
Returns the maximum value of a 1d double array.
Definition: minmax.cpp:65
int minIndex(Array1D< double > &vector)
Returns the index of the minimal value of a 1d double array.
Definition: minmax.cpp:169