Documentation of CSL
sort.h
Go to the documentation of this file.
1 // This file is part of MARTY.
2 //
3 // MARTY is free software: you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation, either version 3 of the License, or
6 // (at your option) any later version.
7 //
8 // MARTY is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License
14 // along with MARTY. If not, see <https://www.gnu.org/licenses/>.
15 
33 #ifndef CSL_SORT_H_INCLUDED
34 #define CSL_SORT_H_INCLUDED
35 
36 #include "abstract.h"
37 
38 namespace csl {
39 
46  inline size_t minMergeSize = 10;
47 
53  void sort(std::vector<Expr> &argument);
60  void sort(
61  std::vector<Expr>::iterator first,
62  std::vector<Expr>::iterator last
63  );
64 
65 
72  void selectionSort(std::vector<Expr> &argument);
80  void selectionSort(
81  std::vector<Expr>::iterator first,
82  std::vector<Expr>::iterator last
83  );
84 
99  void mergeSort(std::vector<Expr> &argument);
115  void mergeSort(
116  std::vector<Expr>::iterator first,
117  std::vector<Expr>::iterator last
118  );
119 
120 } // End of namespace csl
121 
122 #endif
Namespace for csl library.
Definition: abreviation.h:34
void sort(std::vector< Expr > &argument)
Sorts a container using mergeSort().
Definition: sort.cpp:89
size_t minMergeSize
Minimum size for a container to be sorted with mergeSort().
Definition: sort.h:46
void mergeSort(std::vector< Expr > &argument)
Applies the merge sort algorithm on a container.
Definition: sort.cpp:105
void selectionSort(std::vector< Expr > &argument)
Applies the selection sort algorithm on a container.
Definition: sort.cpp:40
Base classes for all exprs in the program.