ADMB Documentation  11.5.3197
 All Classes Files Functions Variables Typedefs Friends Defines
Defines | Functions
ivsort.cpp File Reference

(* $Id$)

Has routines for sorting an ivector. More...

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

Go to the source code of this file.

Defines

#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.
void int_qsort2 (int *arr, int *arr2, unsigned n)
 A subroutine used in Quicksort.
ivector sort (const ivector &v, int NSTACK)
 Quicksort.
ivector sort (const ivector &_v, const ivector &_index, int NSTACK)
 Quicksort.

Detailed Description

Has routines for sorting an ivector.

Definition in file ivsort.cpp.


Define 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 74 of file ivsort.cpp.