ADMB Documentation  11.1.2428
 All Classes Files Functions Variables Typedefs Friends Defines
Defines | Functions
dvsort.cpp File Reference

(* $Id: dvsort.cpp 1657 2014-02-19 23:22:28Z johnoel $)

Has routines for sorting a dvector. More...

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

Go to the source code of this file.

Defines

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

Functions

void double_qsort (double *arr, unsigned n)
 A subroutine used in Quicksort.
void double_qsort2 (double *arr, int *arr2, unsigned n)
 A subroutine used in Quicksort.
dvector sort (const dvector &v, int NSTACK)
 Quicksort.
dvector sort (const dvector &_v, const ivector &_index, int NSTACK)
 Quicksort.

Detailed Description

Has routines for sorting a dvector.

Definition in file dvsort.cpp.


Define Documentation

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

Referenced by double_qsort(), and double_qsort2().

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

Function Documentation

void double_qsort ( double *  arr,
unsigned  n 
)

A subroutine used in Quicksort.

Definition at line 17 of file dvsort.cpp.

Referenced by sort().

void double_qsort2 ( double *  arr,
int *  arr2,
unsigned  n 
)

A subroutine used in Quicksort.

Definition at line 26 of file dvsort.cpp.

Referenced by sort().

dvector sort ( const dvector v,
int  NSTACK 
)

Quicksort.

Parameters:
vA dvector to be sorted.
NSTACKNot used.
Returns:
dvector 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 dvsort.cpp.

dvector sort ( const dvector _v,
const ivector _index,
int  NSTACK 
)

Quicksort.

Parameters:
_vA dvector 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 75 of file dvsort.cpp.