annotate util/ksvd utils/ompbox utils/omputils.h @ 137:9207d56c5547 ivand_dev

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