annotate Problems/private/ompcore.h @ 54:4fef33632323

(none)
author idamnjanovic
date Mon, 14 Mar 2011 16:53:56 +0000
parents 217a33ac374e
children
rev   line source
idamnjanovic@51 1 /**************************************************************************
idamnjanovic@51 2 *
idamnjanovic@51 3 * File name: ompcore.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 * Contains the core implementation of Batch-OMP / OMP-Cholesky.
idamnjanovic@51 13 *
idamnjanovic@51 14 *************************************************************************/
idamnjanovic@51 15
idamnjanovic@51 16
idamnjanovic@51 17 #ifndef __OMP_CORE_H__
idamnjanovic@51 18 #define __OMP_CORE_H__
idamnjanovic@51 19
idamnjanovic@51 20
idamnjanovic@51 21 #include "mex.h"
idamnjanovic@51 22
idamnjanovic@51 23
idamnjanovic@51 24
idamnjanovic@51 25 /**************************************************************************
idamnjanovic@51 26 * Perform Batch-OMP or OMP-Cholesky on a specified set of signals, using
idamnjanovic@51 27 * either a fixed number of atoms or an error bound.
idamnjanovic@51 28 *
idamnjanovic@51 29 * Parameters (not all required):
idamnjanovic@51 30 *
idamnjanovic@51 31 * D - the dictionary, of size n X m
idamnjanovic@51 32 * x - the signals, of size n X L
idamnjanovic@51 33 * DtX - D'*x, of size m X L
idamnjanovic@51 34 * XtX - squared norms of the signals in x, sum(x.*x), of length L
idamnjanovic@51 35 * G - D'*D, of size m X m
idamnjanovic@51 36 * T - target sparsity, or maximal number of atoms for error-based OMP
idamnjanovic@51 37 * eps - target residual norm for error-based OMP
idamnjanovic@51 38 * gamma_mode - one of the constants FULL_GAMMA or SPARSE_GAMMA
idamnjanovic@51 39 * profile - if non-zero, profiling info is printed
idamnjanovic@51 40 * msg_delta - positive: the # of seconds between status prints, otherwise: nothing is printed
idamnjanovic@51 41 * erroromp - if nonzero indicates error-based OMP, otherwise fixed sparsity OMP
idamnjanovic@51 42 *
idamnjanovic@51 43 * Usage:
idamnjanovic@51 44 *
idamnjanovic@51 45 * The function can be called using different parameters, and will have
idamnjanovic@51 46 * different complexity depending on the parameters specified. Arrays which
idamnjanovic@51 47 * are not specified should be passed as null (0). When G is specified,
idamnjanovic@51 48 * Batch-OMP is performed. Otherwise, OMP-Cholesky is performed.
idamnjanovic@51 49 *
idamnjanovic@51 50 * Fixed-sparsity usage:
idamnjanovic@51 51 * ---------------------
idamnjanovic@51 52 * Either DtX, or D and x, must be specified. Specifying DtX is more efficient.
idamnjanovic@51 53 * XtX does not need to be specified.
idamnjanovic@51 54 * When D and x are specified, G is not required. However, not providing G
idamnjanovic@51 55 * will significantly degrade efficiency.
idamnjanovic@51 56 * The number of atoms must be specified in T. The value of eps is ignored.
idamnjanovic@51 57 * Finally, set erroromp to 0.
idamnjanovic@51 58 *
idamnjanovic@51 59 * Error-OMP usage:
idamnjanovic@51 60 * ----------------
idamnjanovic@51 61 * Either DtX and Xtx, or D and x, must be specified. Specifying DtX and XtX
idamnjanovic@51 62 * is more efficient.
idamnjanovic@51 63 * When D and x are specified, G is not required. However, not providing G
idamnjanovic@51 64 * will significantly degrade efficiency.
idamnjanovic@51 65 * The target error must be specified in eps. A hard limit on the number
idamnjanovic@51 66 * of atoms can also be specified via the parameter T. Otherwise, T should
idamnjanovic@51 67 * be negative. Finally, set erroromp to nonzero.
idamnjanovic@51 68 *
idamnjanovic@51 69 *
idamnjanovic@51 70 * Returns:
idamnjanovic@51 71 * An mxArray containing the sparse representations of the signals in x
idamnjanovic@51 72 * (allocated using the appropriate mxCreateXXX() function).
idamnjanovic@51 73 * The array is either full or sparse, depending on gamma_mode.
idamnjanovic@51 74 *
idamnjanovic@51 75 **************************************************************************/
idamnjanovic@51 76 mxArray* ompcore(double D[], double x[], double DtX[], double XtX[], double G[], mwSize n, mwSize m, mwSize L,
idamnjanovic@51 77 int T, double eps, int gamma_mode, int profile, double msg_delta, int erroromp);
idamnjanovic@51 78
idamnjanovic@51 79
idamnjanovic@51 80 #endif