25 #include <sys/types.h> 48 cout <<
"Vector before sort: " << v << endl;
50 cout <<
"Index array after sort: " << i << endl;
51 cout <<
"Sorted Vector: ";
52 for (
Index j = 0; j < v.
nelem(); j++) cout <<
" " << setw(3) << v[i[j]];
73 cout <<
"Array before sort: " << a << endl;
75 cout <<
"Index array after sort: " << i << endl;
76 cout <<
"Sorted Array: ";
77 for (
Index j = 0; j < a.
nelem(); j++) cout <<
" " << setw(3) << a[i[j]];
81 void profileVector(
Index n) {
82 cout <<
"Creating Vector with random numbers" << endl;
84 srandom((
unsigned int)time(NULL));
88 cout <<
"Now sorting" << endl;
99 cerr <<
"This test is only available when compiled with POSIX support." INDEX Index
The type to use for all integer numbers and indices.
Index nelem() const
Number of elements.
Index nelem() const
Returns the number of elements.
Contains sorting routines.
The global header file for ARTS.
NUMERIC Numeric
The type to use for all floating point numbers.
Implementation of Matrix, Vector, and such stuff.
void get_sorted_indexes(ArrayOfIndex &sorted, const T &data)
get_sorted_indexes
This can be used to make arrays out of anything.