00001
00002 #ifndef _WAVELETDEBUG_H_
00003 #define _WAVELETDEBUG_H_
00004
00005 #include <stdio.h>
00006
00011 class waveletDebug {
00012 public:
00013
00019 void pr_ordered( const double *coef, const size_t len)
00020 {
00021 const char *format = "%7.4f ";
00022 printf("{");
00023 int cnt = 0;
00024 int num_in_freq = 0;
00025 for (int i = 0; i < len; i++) {
00026 printf(format, coef[i]);
00027 cnt++;
00028 if (num_in_freq == 0) {
00029 printf("\n");
00030 cnt = 0;
00031 num_in_freq = 1;
00032 }
00033 else if (cnt == num_in_freq) {
00034 printf("\n");
00035 cnt = 0;
00036 num_in_freq = num_in_freq * 2;
00037 }
00038 }
00039 printf("}\n");
00040 }
00041
00059 void pr_intermediate( const double *vec, int N)
00060 {
00061 const char* fmt = "%7.4f ";
00062 int i;
00063 int half = N >> 1;
00064
00065 printf(" ave = ");
00066 for (i = 0; i < half; i++) {
00067 printf(fmt, vec[i] );
00068 }
00069 printf("\n");
00070 printf("coef = ");
00071 for (i = half; i < N; i++) {
00072 printf(fmt, vec[i] );
00073 }
00074 printf("\n");
00075 }
00076
00077
00086 void pr_vector( const double *vec, const size_t N, const size_t len)
00087 {
00088 const char* fmt = "%7.4f ";
00089
00090 int i;
00091 for (i = 0; i < N; i++) {
00092 printf(fmt, vec[i] );
00093 }
00094
00095 if (len != N) {
00096 printf(" | ");
00097
00098 for (i = N; i < len; i++) {
00099 printf(fmt, vec[i] );
00100 }
00101 }
00102 printf("\n");
00103 }
00104
00105 };
00106
00107
00108 #endif