diff --git a/test_problems/SConscript b/test_problems/SConscript index 6aaf97e66..18f144b78 100644 --- a/test_problems/SConscript +++ b/test_problems/SConscript @@ -129,7 +129,7 @@ CompileAndTest('HMW_dupl_test', CompileAndTest('HMW_graph_CpvT', pjoin('cathermo', 'HMW_graph_CpvT'), 'HMW_graph_CpvT', 'output_blessed.txt', - extensions=['^HMW_graph_CpvT.cpp', '^sortAlgorithms.cpp'], + extensions=['^HMW_graph_CpvT.cpp'], arguments='HMW_NaCl_sp1977_alt.xml') CompileAndTest('HMW_graph_GvI', pjoin('cathermo', 'HMW_graph_GvI'), @@ -141,17 +141,17 @@ CompileAndTest('HMW_graph_GvI', CompileAndTest('HMW_graph_GvT', pjoin('cathermo', 'HMW_graph_GvT'), 'HMW_graph_GvT', 'output_blessed.txt', - extensions=['^HMW_graph_GvT.cpp', '^sortAlgorithms.cpp'], + extensions=['^HMW_graph_GvT.cpp'], arguments='HMW_NaCl_sp1977_alt.xml') CompileAndTest('HMW_graph_HvT', pjoin('cathermo', 'HMW_graph_HvT'), 'HMW_graph_HvT', 'output_blessed.txt', - extensions=['^HMW_graph_HvT.cpp', '^sortAlgorithms.cpp'], + extensions=['^HMW_graph_HvT.cpp'], arguments='HMW_NaCl_sp1977_alt.xml') CompileAndTest('HMW_graph_VvT', pjoin('cathermo', 'HMW_graph_VvT'), 'HMW_graph_VvT', 'output_blessed.txt', - extensions=['^HMW_graph_VvT.cpp', '^sortAlgorithms.cpp'], + extensions=['^HMW_graph_VvT.cpp'], arguments='HMW_NaCl_sp1977_alt.xml') CompileAndTest('HMW_test_1', pjoin('cathermo', 'HMW_test_1'), diff --git a/test_problems/cathermo/HMW_dupl_test/TemperatureTable.h b/test_problems/cathermo/HMW_dupl_test/TemperatureTable.h index a68e94b10..a6384575f 100644 --- a/test_problems/cathermo/HMW_dupl_test/TemperatureTable.h +++ b/test_problems/cathermo/HMW_dupl_test/TemperatureTable.h @@ -8,7 +8,6 @@ #ifndef TEMPERATURE_TABLE_H #define TEMPERATURE_TABLE_H -#include "sortAlgorithms.h" //#include "mdp_allo.h" #include using std::vector; @@ -75,10 +74,7 @@ public: } NPoints += numAdded; } - - sort_dbl_1(DATA_PTR(T), NPoints); - - + std::sort(T.begin(), T.end()); } /***********************************************************************/ /***********************************************************************/ diff --git a/test_problems/cathermo/HMW_dupl_test/sortAlgorithms.cpp b/test_problems/cathermo/HMW_dupl_test/sortAlgorithms.cpp deleted file mode 100644 index 4b75761a9..000000000 --- a/test_problems/cathermo/HMW_dupl_test/sortAlgorithms.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* - * @file sortAlgorithms.h - */ -/* - * Copywrite 2004 Sandia Corporation. Under the terms of Contract - * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government - * retains certain rights in this software. - * See file License.txt for licensing information. - */ - -#include "sortAlgorithms.h" - -/**************************************************************/ - -void sort_dbl_1(double * const x, const int n) { - double rra; - int ll = n/2; - int iret = n - 1; - while (1 > 0) { - if (ll > 0) { - ll--; - rra = x[ll]; - } else { - rra = x[iret]; - x[iret] = x[0]; - iret--; - if (iret == 0) { - x[0] = rra; - return; - } - } - int i = ll; - int j = ll + ll + 1; - while (j <= iret) { - if (j < iret) { - if (x[j] < x[j+1]) - j++; - } - if (rra < x[j]) { - x[i] = x[j]; - i = j; - j = j + j + 1; - } else { - j = iret + 1; - } - } - x[i] = rra; - } -} -/*****************************************************/ diff --git a/test_problems/cathermo/HMW_dupl_test/sortAlgorithms.h b/test_problems/cathermo/HMW_dupl_test/sortAlgorithms.h deleted file mode 100644 index ba8915c84..000000000 --- a/test_problems/cathermo/HMW_dupl_test/sortAlgorithms.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - * @file sortAlgorithms.h - */ -/* - * Copywrite 2004 Sandia Corporation. Under the terms of Contract - * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government - * retains certain rights in this software. - * See file License.txt for licensing information. - */ - -#ifndef SORTALGORITHMS_H -#define SORTALGORITHMS_H - - -void sort_dbl_1(double * const x, const int n); - -#endif diff --git a/test_problems/cathermo/HMW_graph_CpVT/TemperatureTable.h b/test_problems/cathermo/HMW_graph_CpVT/TemperatureTable.h new file mode 100644 index 000000000..a6384575f --- /dev/null +++ b/test_problems/cathermo/HMW_graph_CpVT/TemperatureTable.h @@ -0,0 +1,123 @@ + +/* + * Copywrite 2004 Sandia Corporation. Under the terms of Contract + * DE-AC04-94AL85000, there is a non-exclusive license for use of this + * work by or on behalf of the U.S. Government. Export of this program + * may require a license from the United States Government. + */ + +#ifndef TEMPERATURE_TABLE_H +#define TEMPERATURE_TABLE_H +//#include "mdp_allo.h" +#include +using std::vector; + +/***********************************************************************/ +/***********************************************************************/ +/***********************************************************************/ +/** + * This Class constructs a vector of temperature from which to make + * a table. + */ +class TemperatureTable { + +public: + int NPoints; + bool Include298; + double Tlow; //!< Min temperature for thermo data fit + double Thigh; //!< Max temperature for thermo table + double DeltaT; + vector T; + int numAddedTs; + vector AddedTempVector; +public: + /* + * Default constructor for TemperatureTable() + */ + TemperatureTable(const int nPts = 14, + const bool inc298 = true, + const double tlow = 300., + const double deltaT = 100., + const int numAdded = 0, + const double *addedTempVector = 0) : + NPoints(nPts), + Include298(inc298), + Tlow(tlow), + DeltaT(deltaT), + T(0), + numAddedTs(numAdded) { + /****************************/ + int i; + // AddedTempVector = mdp_alloc_dbl_1(numAdded, 0.0); + AddedTempVector.resize(numAdded, 0.0); + for (int i = 0; i < numAdded; i++) { + AddedTempVector[i] = addedTempVector[i]; + } + //mdp_copy_dbl_1(AddedTempVector, addedTempVector, numAdded); + // T = mdp_alloc_dbl_1(NPoints, 0.0); + T.resize(NPoints, 0.0); + double TCurrent = Tlow; + for (i = 0; i < NPoints; i++) { + T[i] = TCurrent; + TCurrent += DeltaT; + } + if (Include298) { + T.push_back(298.15); + //mdp_realloc_dbl_1(&T, NPoints+1, NPoints, 298.15); + NPoints++; + } + if (numAdded > 0) { + //mdp_realloc_dbl_1(&T, NPoints+numAdded, NPoints, 0.0); + T.resize( NPoints+numAdded, 0.0); + for (i = 0; i < numAdded; i++) { + T[i+NPoints] = addedTempVector[i]; + } + NPoints += numAdded; + } + std::sort(T.begin(), T.end()); + } + /***********************************************************************/ + /***********************************************************************/ + /***********************************************************************/ + /* + * Destructor + */ + ~TemperatureTable() { + //mdp_safe_free((void **) &AddedTempVector); + // mdp_safe_free((void **) &T); + } + + /***********************************************************************/ + /***********************************************************************/ + /***********************************************************************/ + /* + * Overloaded operator[] + * + * return the array value in the vector + */ + double operator[](const int i) { + return T[i]; + } + /***********************************************************************/ + /***********************************************************************/ + /***********************************************************************/ + /* + * size() + */ + int size() { + return NPoints; + } +/***********************************************************************/ +/***********************************************************************/ +/***********************************************************************/ + /* + * Block assignment and copy constructors: not needed. + */ +private: + TemperatureTable(const TemperatureTable &); + TemperatureTable& operator=(const TemperatureTable&); +}; +/***********************************************************************/ +/***********************************************************************/ +/***********************************************************************/ +#endif diff --git a/test_problems/cathermo/HMW_graph_CpvT/TemperatureTable.h b/test_problems/cathermo/HMW_graph_CpvT/TemperatureTable.h index a68e94b10..a6384575f 100644 --- a/test_problems/cathermo/HMW_graph_CpvT/TemperatureTable.h +++ b/test_problems/cathermo/HMW_graph_CpvT/TemperatureTable.h @@ -8,7 +8,6 @@ #ifndef TEMPERATURE_TABLE_H #define TEMPERATURE_TABLE_H -#include "sortAlgorithms.h" //#include "mdp_allo.h" #include using std::vector; @@ -75,10 +74,7 @@ public: } NPoints += numAdded; } - - sort_dbl_1(DATA_PTR(T), NPoints); - - + std::sort(T.begin(), T.end()); } /***********************************************************************/ /***********************************************************************/ diff --git a/test_problems/cathermo/HMW_graph_CpvT/sortAlgorithms.cpp b/test_problems/cathermo/HMW_graph_CpvT/sortAlgorithms.cpp deleted file mode 100644 index 4b75761a9..000000000 --- a/test_problems/cathermo/HMW_graph_CpvT/sortAlgorithms.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* - * @file sortAlgorithms.h - */ -/* - * Copywrite 2004 Sandia Corporation. Under the terms of Contract - * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government - * retains certain rights in this software. - * See file License.txt for licensing information. - */ - -#include "sortAlgorithms.h" - -/**************************************************************/ - -void sort_dbl_1(double * const x, const int n) { - double rra; - int ll = n/2; - int iret = n - 1; - while (1 > 0) { - if (ll > 0) { - ll--; - rra = x[ll]; - } else { - rra = x[iret]; - x[iret] = x[0]; - iret--; - if (iret == 0) { - x[0] = rra; - return; - } - } - int i = ll; - int j = ll + ll + 1; - while (j <= iret) { - if (j < iret) { - if (x[j] < x[j+1]) - j++; - } - if (rra < x[j]) { - x[i] = x[j]; - i = j; - j = j + j + 1; - } else { - j = iret + 1; - } - } - x[i] = rra; - } -} -/*****************************************************/ diff --git a/test_problems/cathermo/HMW_graph_CpvT/sortAlgorithms.h b/test_problems/cathermo/HMW_graph_CpvT/sortAlgorithms.h deleted file mode 100644 index ba8915c84..000000000 --- a/test_problems/cathermo/HMW_graph_CpvT/sortAlgorithms.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - * @file sortAlgorithms.h - */ -/* - * Copywrite 2004 Sandia Corporation. Under the terms of Contract - * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government - * retains certain rights in this software. - * See file License.txt for licensing information. - */ - -#ifndef SORTALGORITHMS_H -#define SORTALGORITHMS_H - - -void sort_dbl_1(double * const x, const int n); - -#endif diff --git a/test_problems/cathermo/HMW_graph_GvI/TemperatureTable.h b/test_problems/cathermo/HMW_graph_GvI/TemperatureTable.h index a68e94b10..a6384575f 100644 --- a/test_problems/cathermo/HMW_graph_GvI/TemperatureTable.h +++ b/test_problems/cathermo/HMW_graph_GvI/TemperatureTable.h @@ -8,7 +8,6 @@ #ifndef TEMPERATURE_TABLE_H #define TEMPERATURE_TABLE_H -#include "sortAlgorithms.h" //#include "mdp_allo.h" #include using std::vector; @@ -75,10 +74,7 @@ public: } NPoints += numAdded; } - - sort_dbl_1(DATA_PTR(T), NPoints); - - + std::sort(T.begin(), T.end()); } /***********************************************************************/ /***********************************************************************/ diff --git a/test_problems/cathermo/HMW_graph_GvI/sortAlgorithms.cpp b/test_problems/cathermo/HMW_graph_GvI/sortAlgorithms.cpp deleted file mode 100644 index 4b75761a9..000000000 --- a/test_problems/cathermo/HMW_graph_GvI/sortAlgorithms.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* - * @file sortAlgorithms.h - */ -/* - * Copywrite 2004 Sandia Corporation. Under the terms of Contract - * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government - * retains certain rights in this software. - * See file License.txt for licensing information. - */ - -#include "sortAlgorithms.h" - -/**************************************************************/ - -void sort_dbl_1(double * const x, const int n) { - double rra; - int ll = n/2; - int iret = n - 1; - while (1 > 0) { - if (ll > 0) { - ll--; - rra = x[ll]; - } else { - rra = x[iret]; - x[iret] = x[0]; - iret--; - if (iret == 0) { - x[0] = rra; - return; - } - } - int i = ll; - int j = ll + ll + 1; - while (j <= iret) { - if (j < iret) { - if (x[j] < x[j+1]) - j++; - } - if (rra < x[j]) { - x[i] = x[j]; - i = j; - j = j + j + 1; - } else { - j = iret + 1; - } - } - x[i] = rra; - } -} -/*****************************************************/ diff --git a/test_problems/cathermo/HMW_graph_GvI/sortAlgorithms.h b/test_problems/cathermo/HMW_graph_GvI/sortAlgorithms.h deleted file mode 100644 index ba8915c84..000000000 --- a/test_problems/cathermo/HMW_graph_GvI/sortAlgorithms.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - * @file sortAlgorithms.h - */ -/* - * Copywrite 2004 Sandia Corporation. Under the terms of Contract - * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government - * retains certain rights in this software. - * See file License.txt for licensing information. - */ - -#ifndef SORTALGORITHMS_H -#define SORTALGORITHMS_H - - -void sort_dbl_1(double * const x, const int n); - -#endif diff --git a/test_problems/cathermo/HMW_graph_GvT/TemperatureTable.h b/test_problems/cathermo/HMW_graph_GvT/TemperatureTable.h index a68e94b10..a6384575f 100644 --- a/test_problems/cathermo/HMW_graph_GvT/TemperatureTable.h +++ b/test_problems/cathermo/HMW_graph_GvT/TemperatureTable.h @@ -8,7 +8,6 @@ #ifndef TEMPERATURE_TABLE_H #define TEMPERATURE_TABLE_H -#include "sortAlgorithms.h" //#include "mdp_allo.h" #include using std::vector; @@ -75,10 +74,7 @@ public: } NPoints += numAdded; } - - sort_dbl_1(DATA_PTR(T), NPoints); - - + std::sort(T.begin(), T.end()); } /***********************************************************************/ /***********************************************************************/ diff --git a/test_problems/cathermo/HMW_graph_GvT/sortAlgorithms.cpp b/test_problems/cathermo/HMW_graph_GvT/sortAlgorithms.cpp deleted file mode 100644 index 4b75761a9..000000000 --- a/test_problems/cathermo/HMW_graph_GvT/sortAlgorithms.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* - * @file sortAlgorithms.h - */ -/* - * Copywrite 2004 Sandia Corporation. Under the terms of Contract - * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government - * retains certain rights in this software. - * See file License.txt for licensing information. - */ - -#include "sortAlgorithms.h" - -/**************************************************************/ - -void sort_dbl_1(double * const x, const int n) { - double rra; - int ll = n/2; - int iret = n - 1; - while (1 > 0) { - if (ll > 0) { - ll--; - rra = x[ll]; - } else { - rra = x[iret]; - x[iret] = x[0]; - iret--; - if (iret == 0) { - x[0] = rra; - return; - } - } - int i = ll; - int j = ll + ll + 1; - while (j <= iret) { - if (j < iret) { - if (x[j] < x[j+1]) - j++; - } - if (rra < x[j]) { - x[i] = x[j]; - i = j; - j = j + j + 1; - } else { - j = iret + 1; - } - } - x[i] = rra; - } -} -/*****************************************************/ diff --git a/test_problems/cathermo/HMW_graph_GvT/sortAlgorithms.h b/test_problems/cathermo/HMW_graph_GvT/sortAlgorithms.h deleted file mode 100644 index ba8915c84..000000000 --- a/test_problems/cathermo/HMW_graph_GvT/sortAlgorithms.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - * @file sortAlgorithms.h - */ -/* - * Copywrite 2004 Sandia Corporation. Under the terms of Contract - * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government - * retains certain rights in this software. - * See file License.txt for licensing information. - */ - -#ifndef SORTALGORITHMS_H -#define SORTALGORITHMS_H - - -void sort_dbl_1(double * const x, const int n); - -#endif diff --git a/test_problems/cathermo/HMW_graph_HvT/TemperatureTable.h b/test_problems/cathermo/HMW_graph_HvT/TemperatureTable.h index a68e94b10..a6384575f 100644 --- a/test_problems/cathermo/HMW_graph_HvT/TemperatureTable.h +++ b/test_problems/cathermo/HMW_graph_HvT/TemperatureTable.h @@ -8,7 +8,6 @@ #ifndef TEMPERATURE_TABLE_H #define TEMPERATURE_TABLE_H -#include "sortAlgorithms.h" //#include "mdp_allo.h" #include using std::vector; @@ -75,10 +74,7 @@ public: } NPoints += numAdded; } - - sort_dbl_1(DATA_PTR(T), NPoints); - - + std::sort(T.begin(), T.end()); } /***********************************************************************/ /***********************************************************************/ diff --git a/test_problems/cathermo/HMW_graph_HvT/sortAlgorithms.cpp b/test_problems/cathermo/HMW_graph_HvT/sortAlgorithms.cpp deleted file mode 100644 index 4b75761a9..000000000 --- a/test_problems/cathermo/HMW_graph_HvT/sortAlgorithms.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* - * @file sortAlgorithms.h - */ -/* - * Copywrite 2004 Sandia Corporation. Under the terms of Contract - * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government - * retains certain rights in this software. - * See file License.txt for licensing information. - */ - -#include "sortAlgorithms.h" - -/**************************************************************/ - -void sort_dbl_1(double * const x, const int n) { - double rra; - int ll = n/2; - int iret = n - 1; - while (1 > 0) { - if (ll > 0) { - ll--; - rra = x[ll]; - } else { - rra = x[iret]; - x[iret] = x[0]; - iret--; - if (iret == 0) { - x[0] = rra; - return; - } - } - int i = ll; - int j = ll + ll + 1; - while (j <= iret) { - if (j < iret) { - if (x[j] < x[j+1]) - j++; - } - if (rra < x[j]) { - x[i] = x[j]; - i = j; - j = j + j + 1; - } else { - j = iret + 1; - } - } - x[i] = rra; - } -} -/*****************************************************/ diff --git a/test_problems/cathermo/HMW_graph_HvT/sortAlgorithms.h b/test_problems/cathermo/HMW_graph_HvT/sortAlgorithms.h deleted file mode 100644 index ba8915c84..000000000 --- a/test_problems/cathermo/HMW_graph_HvT/sortAlgorithms.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - * @file sortAlgorithms.h - */ -/* - * Copywrite 2004 Sandia Corporation. Under the terms of Contract - * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government - * retains certain rights in this software. - * See file License.txt for licensing information. - */ - -#ifndef SORTALGORITHMS_H -#define SORTALGORITHMS_H - - -void sort_dbl_1(double * const x, const int n); - -#endif diff --git a/test_problems/cathermo/HMW_graph_VvT/TemperatureTable.h b/test_problems/cathermo/HMW_graph_VvT/TemperatureTable.h index a68e94b10..a6384575f 100644 --- a/test_problems/cathermo/HMW_graph_VvT/TemperatureTable.h +++ b/test_problems/cathermo/HMW_graph_VvT/TemperatureTable.h @@ -8,7 +8,6 @@ #ifndef TEMPERATURE_TABLE_H #define TEMPERATURE_TABLE_H -#include "sortAlgorithms.h" //#include "mdp_allo.h" #include using std::vector; @@ -75,10 +74,7 @@ public: } NPoints += numAdded; } - - sort_dbl_1(DATA_PTR(T), NPoints); - - + std::sort(T.begin(), T.end()); } /***********************************************************************/ /***********************************************************************/ diff --git a/test_problems/cathermo/HMW_graph_VvT/sortAlgorithms.cpp b/test_problems/cathermo/HMW_graph_VvT/sortAlgorithms.cpp deleted file mode 100644 index 4b75761a9..000000000 --- a/test_problems/cathermo/HMW_graph_VvT/sortAlgorithms.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* - * @file sortAlgorithms.h - */ -/* - * Copywrite 2004 Sandia Corporation. Under the terms of Contract - * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government - * retains certain rights in this software. - * See file License.txt for licensing information. - */ - -#include "sortAlgorithms.h" - -/**************************************************************/ - -void sort_dbl_1(double * const x, const int n) { - double rra; - int ll = n/2; - int iret = n - 1; - while (1 > 0) { - if (ll > 0) { - ll--; - rra = x[ll]; - } else { - rra = x[iret]; - x[iret] = x[0]; - iret--; - if (iret == 0) { - x[0] = rra; - return; - } - } - int i = ll; - int j = ll + ll + 1; - while (j <= iret) { - if (j < iret) { - if (x[j] < x[j+1]) - j++; - } - if (rra < x[j]) { - x[i] = x[j]; - i = j; - j = j + j + 1; - } else { - j = iret + 1; - } - } - x[i] = rra; - } -} -/*****************************************************/ diff --git a/test_problems/cathermo/HMW_graph_VvT/sortAlgorithms.h b/test_problems/cathermo/HMW_graph_VvT/sortAlgorithms.h deleted file mode 100644 index ba8915c84..000000000 --- a/test_problems/cathermo/HMW_graph_VvT/sortAlgorithms.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - * @file sortAlgorithms.h - */ -/* - * Copywrite 2004 Sandia Corporation. Under the terms of Contract - * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government - * retains certain rights in this software. - * See file License.txt for licensing information. - */ - -#ifndef SORTALGORITHMS_H -#define SORTALGORITHMS_H - - -void sort_dbl_1(double * const x, const int n); - -#endif diff --git a/test_problems/cathermo/stoichSubSSTP/TemperatureTable.h b/test_problems/cathermo/stoichSubSSTP/TemperatureTable.h index a68e94b10..a6384575f 100644 --- a/test_problems/cathermo/stoichSubSSTP/TemperatureTable.h +++ b/test_problems/cathermo/stoichSubSSTP/TemperatureTable.h @@ -8,7 +8,6 @@ #ifndef TEMPERATURE_TABLE_H #define TEMPERATURE_TABLE_H -#include "sortAlgorithms.h" //#include "mdp_allo.h" #include using std::vector; @@ -75,10 +74,7 @@ public: } NPoints += numAdded; } - - sort_dbl_1(DATA_PTR(T), NPoints); - - + std::sort(T.begin(), T.end()); } /***********************************************************************/ /***********************************************************************/ diff --git a/test_problems/cathermo/stoichSubSSTP/sortAlgorithms.cpp b/test_problems/cathermo/stoichSubSSTP/sortAlgorithms.cpp deleted file mode 100644 index 4b75761a9..000000000 --- a/test_problems/cathermo/stoichSubSSTP/sortAlgorithms.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* - * @file sortAlgorithms.h - */ -/* - * Copywrite 2004 Sandia Corporation. Under the terms of Contract - * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government - * retains certain rights in this software. - * See file License.txt for licensing information. - */ - -#include "sortAlgorithms.h" - -/**************************************************************/ - -void sort_dbl_1(double * const x, const int n) { - double rra; - int ll = n/2; - int iret = n - 1; - while (1 > 0) { - if (ll > 0) { - ll--; - rra = x[ll]; - } else { - rra = x[iret]; - x[iret] = x[0]; - iret--; - if (iret == 0) { - x[0] = rra; - return; - } - } - int i = ll; - int j = ll + ll + 1; - while (j <= iret) { - if (j < iret) { - if (x[j] < x[j+1]) - j++; - } - if (rra < x[j]) { - x[i] = x[j]; - i = j; - j = j + j + 1; - } else { - j = iret + 1; - } - } - x[i] = rra; - } -} -/*****************************************************/ diff --git a/test_problems/cathermo/stoichSubSSTP/sortAlgorithms.h b/test_problems/cathermo/stoichSubSSTP/sortAlgorithms.h deleted file mode 100644 index ba8915c84..000000000 --- a/test_problems/cathermo/stoichSubSSTP/sortAlgorithms.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - * @file sortAlgorithms.h - */ -/* - * Copywrite 2004 Sandia Corporation. Under the terms of Contract - * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government - * retains certain rights in this software. - * See file License.txt for licensing information. - */ - -#ifndef SORTALGORITHMS_H -#define SORTALGORITHMS_H - - -void sort_dbl_1(double * const x, const int n); - -#endif