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

(Last Changed on May 09, 2017 for git-revision c1b83ac1cae29a7c6397457f5d3d3cad1a32214e.)

Has routines for sorting a dvector. More...

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

Go to the source code of this file.

Macros

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

Detailed Description

Has routines for sorting a dvector.

Definition in file dvsort.cpp.

Macro Definition 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 79 of file dvsort.cpp.