annotate Problems/private/omputils.h @ 56:40bcdc445c91

(none)
author idamnjanovic
date Mon, 14 Mar 2011 17:05:42 +0000
parents 217a33ac374e
children
rev   line source
idamnjanovic@51 1 /**************************************************************************
idamnjanovic@51 2 *
idamnjanovic@51 3 * File name: omputils.h
idamnjanovic@51 4 *
idamnjanovic@51 5 * Ron Rubinstein
idamnjanovic@51 6 * Computer Science Department
idamnjanovic@51 7 * Technion, Haifa 32000 Israel
idamnjanovic@51 8 * ronrubin@cs
idamnjanovic@51 9 *
idamnjanovic@51 10 * Last Updated: 18.8.2009
idamnjanovic@51 11 *
idamnjanovic@51 12 * Utility definitions and functions for the OMP library.
idamnjanovic@51 13 *
idamnjanovic@51 14 *************************************************************************/
idamnjanovic@51 15
idamnjanovic@51 16
idamnjanovic@51 17 #ifndef __OMP_UTILS_H__
idamnjanovic@51 18 #define __OMP_UTILS_H__
idamnjanovic@51 19
idamnjanovic@51 20 #include "mex.h"
idamnjanovic@51 21
idamnjanovic@51 22
idamnjanovic@51 23 /* constants for the representation mode of gamma */
idamnjanovic@51 24
idamnjanovic@51 25 extern const char FULL_GAMMA_STR[]; /* "full" */
idamnjanovic@51 26 extern const char SPARSE_GAMMA_STR[]; /* "sparse" */
idamnjanovic@51 27
idamnjanovic@51 28
idamnjanovic@51 29 #define FULL_GAMMA 1
idamnjanovic@51 30 #define SPARSE_GAMMA 2
idamnjanovic@51 31 #define INVALID_MODE 3
idamnjanovic@51 32
idamnjanovic@51 33
idamnjanovic@51 34
idamnjanovic@51 35 /**************************************************************************
idamnjanovic@51 36 * Memory management for OMP2.
idamnjanovic@51 37 *
idamnjanovic@51 38 * GAMMA_INC_FACTOR:
idamnjanovic@51 39 * The matrix GAMMA is allocated with sqrt(n)/2 coefficients per signal,
idamnjanovic@51 40 * for a total of nzmax = L*sqrt(n)/2 nonzeros. Whenever GAMMA needs to be
idamnjanovic@51 41 * increased, it is increased by a factor of GAMMA_INC_FACTOR.
idamnjanovic@51 42 *
idamnjanovic@51 43 * MAT_INC_FACTOR:
idamnjanovic@51 44 * The matrices Lchol, Gsub and Dsub are allocated with sqrt(n)/2
idamnjanovic@51 45 * columns each. If additional columns are needed, this number is
idamnjanovic@51 46 * increased by a factor of MAT_INC_FACTOR.
idamnjanovic@51 47 **************************************************************************/
idamnjanovic@51 48
idamnjanovic@51 49 #define GAMMA_INC_FACTOR (1.4)
idamnjanovic@51 50 #define MAT_INC_FACTOR (1.6)
idamnjanovic@51 51
idamnjanovic@51 52
idamnjanovic@51 53
idamnjanovic@51 54 /**************************************************************************
idamnjanovic@51 55 * Convert number of seconds to hour, minute and second representation.
idamnjanovic@51 56 *
idamnjanovic@51 57 * Parameters:
idamnjanovic@51 58 * sectot - total number of seconds
idamnjanovic@51 59 * hrs, mins, secs - output hours (whole) and minutes (whole) and seconds
idamnjanovic@51 60 *
idamnjanovic@51 61 **************************************************************************/
idamnjanovic@51 62 void secs2hms(double sectot, int *hrs, int *mins, double *secs);
idamnjanovic@51 63
idamnjanovic@51 64
idamnjanovic@51 65
idamnjanovic@51 66 /**************************************************************************
idamnjanovic@51 67 * QuickSort - public-domain C implementation by Darel Rex Finley.
idamnjanovic@51 68 *
idamnjanovic@51 69 * Modified to sort both the array vals[] and the array data[] according
idamnjanovic@51 70 * to the values in the array vals[].
idamnjanovic@51 71 *
idamnjanovic@51 72 **************************************************************************/
idamnjanovic@51 73 void quicksort(mwIndex vals[], double data[], mwIndex n);
idamnjanovic@51 74
idamnjanovic@51 75
idamnjanovic@51 76 #endif
idamnjanovic@51 77