/* nag_stable_sort (m01ctc) Example Program. * * Copyright 1990 Numerical Algorithms Group. * * Mark 2 revised, 1992. * Mark 7 revised, 2001. * Mark 8 revised, 2004. * */ #include #include #include #include #include #ifdef __cplusplus extern "C" { #endif static Integer NAG_CALL compare(const Nag_Pointer a, const Nag_Pointer b) { double x = *((const double *)a); double y = *((const double *)b); return (x=0 && n>=0 && k>=0 && k<=n) { if ( !( vec = NAG_ALLOC(m*n, double)) ) { Vprintf("Allocation failure\n"); exit_status = -1; goto END; } tdvec = n; } else { Vprintf("Invalid m or n or k.\n"); exit_status = 1; return exit_status; } for (i=0; i