mirror of
https://git.gfz-potsdam.de/naaice/iphreeqc.git
synced 2025-12-16 16:44:49 +01:00
Sorted results for list_s_s
git-svn-id: svn://136.177.114.72/svn_GW/phreeqcpp/trunk@5513 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
parent
c9b1781f37
commit
68b9c041de
@ -551,6 +551,20 @@ cxxNameDouble::merge_redox(const cxxNameDouble & source)
|
||||
|
||||
}
|
||||
}
|
||||
struct DblCmp {
|
||||
bool operator()(const std::pair<std::string, double> &lhs, std::pair<std::string, double> &rhs)
|
||||
{
|
||||
return lhs.second > rhs.second;
|
||||
}
|
||||
};
|
||||
std::vector<std::pair<std::string, double>>
|
||||
cxxNameDouble::sort_second(void)
|
||||
{
|
||||
std::vector<std::pair<std::string, double>> myvec(this->begin(), this->end());
|
||||
std::sort(myvec.begin(), myvec.end(), DblCmp());
|
||||
|
||||
return myvec;
|
||||
}
|
||||
#ifdef USE_MPI
|
||||
void
|
||||
cxxNameDouble::mpi_pack(std::vector < int >&ints,
|
||||
|
||||
@ -69,6 +69,9 @@ class cxxNameDouble:public
|
||||
void
|
||||
merge_redox(const cxxNameDouble & source);
|
||||
|
||||
std::vector<std::pair<std::string, double>>
|
||||
sort_second(void);
|
||||
|
||||
void
|
||||
insert(char *str, double d)
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user