comparison DL/RLS-DLA/private/omputils.h @ 60:ad36f80e2ccf

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