25 # include <sys/types.h> 50 cout <<
"Vector before sort: " << v << endl;
52 cout <<
"Index array after sort: " << i << endl;
53 cout <<
"Sorted Vector: ";
55 cout <<
" " << setw (3) << v[i[j]];
79 cout <<
"Array before sort: " << a << endl;
81 cout <<
"Index array after sort: " << i << endl;
82 cout <<
"Sorted Array: ";
84 cout <<
" " << setw (3) << a[i[j]];
89 profileVector (
Index n)
91 cout <<
"Creating Vector with random numbers" << endl;
93 srandom ((
unsigned int)time (NULL));
95 for (
Index i = 0; i < n; i++)
98 cout <<
"Now sorting" << endl;
107 #ifdef _POSIX_VERSION 111 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.
void get_sorted_indexes(ArrayOfIndex &sorted, const T &data)
get_sorted_indexes
This can be used to make arrays out of anything.