ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Macros | Functions
ivsort.cpp File Reference

(Last Changed on May 10, 2017 for git-revision b206c39ca51480fcead960f4aaa48f65452eb624.)

Has routines for sorting an ivector. More...

#include <fvar.hpp>
#include "qsort.h"

Go to the source code of this file.

Macros

#define int_lt(a, b)   ((*a)<(*b))
 
#define int_lt(a, b)   ((*a)<(*b))
 

Functions

void int_qsort (int *arr, unsigned n)
 A subroutine used in Quicksort. More...
 
void int_qsort2 (int *arr, int *arr2, unsigned n)
 A subroutine used in Quicksort. More...
 
ivector sort (const ivector &v, int NSTACK)
 Quicksort. More...
 
ivector sort (const ivector &v, const ivector &_index, int NSTACK)
 Quicksort. More...
 

Detailed Description

Has routines for sorting an ivector.

Definition in file ivsort.cpp.

Macro Definition Documentation

#define int_lt (   a,
 
)    ((*a)<(*b))

Referenced by int_qsort(), and int_qsort2().

#define int_lt (   a,
 
)    ((*a)<(*b))

Function Documentation

void int_qsort ( int *  arr,
unsigned  n 
)

A subroutine used in Quicksort.

Definition at line 17 of file ivsort.cpp.

Referenced by sort().

void int_qsort2 ( int *  arr,
int *  arr2,
unsigned  n 
)

A subroutine used in Quicksort.

Definition at line 26 of file ivsort.cpp.

Referenced by sort().

ivector sort ( const ivector v,
int  NSTACK 
)

Quicksort.

Parameters
vVector of integers to be sorted
NSTACKNot used.
Returns
ivector object containing the input vector sorted in ascending order.



Adopted from the GNU C Library. http://www.corpit.ru/mjt/qsort.html

Definition at line 40 of file ivsort.cpp.

ivector sort ( const ivector v,
const ivector _index,
int  NSTACK 
)

Quicksort.

Parameters
_vVector of integers to be sorted
_indexivector on return containing the input order of the original vector.
NSTACKNot used.
Returns
ivector object containing the input vector sorted in ascending order.



Adopted from the GNU C Library. http://www.corpit.ru/mjt/qsort.html

Definition at line 78 of file ivsort.cpp.