UQTk: Uncertainty Quantification Toolkit 3.1.5
minmax.h
Go to the documentation of this file.
1/* =====================================================================================
2
3 The UQ Toolkit (UQTk) version 3.1.5
4 Copyright (2024) NTESS
5 https://www.sandia.gov/UQToolkit/
6 https://github.com/sandialabs/UQTk
7
8 Copyright 2024 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 https://github.com/sandialabs/UQTk/discussions
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
46double maxVal(Array1D<double>& vector) ;
48int maxVal(const Array1D<int> &vector) ;
50double maxVal(const Array2D<double> &vector) ;
52int maxVal(const Array2D<int> &vector) ;
53
55double minVal(const Array1D<double> &vector) ;
57int minVal(const Array1D<int> &vector) ;
59double minVal(const Array2D<double> &vector) ;
61int minVal(const Array2D<int> &vector) ;
62
64int maxIndex(Array1D<double>& vector);
66int maxIndex(Array1D<int>& vector);
68int minIndex(Array1D<double>& vector);
70int 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);
78int maxIndexC_2D(const Array2D<double>& vector, const int icol);
80int minIndexC_2D(const Array2D<double>& vector, const int icol);
81
82#endif // MINMAX_H
Stores data of any type T in a 1D array.
Definition Array1D.h:61
Stores data of any type T in a 2D array.
Definition Array2D.h:60
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