6 std::cout <<
"WaveletBase constructor with size_in " << size_in << std::endl;
7 std::cout <<
"values_in[0]= " << values_in[0] <<
" " << values_in[size_in-1] << std::endl;
10 std::cout <<
" size " <<
size <<
" max_level " <<
max_level << std::endl;
12 unsigned int discard_data = size_in -
size;
16 for (
unsigned int i=0; i<
size; i++) {
19 values[i] = values_in [ i + discard_data ];
27 unsigned int max_size = 0;
35 std::cout <<
"size_in is not a power of 2!" << std::endl;
39 std::cout <<
" ok power of 2 " << std::endl;
59 std::cout <<
" size_in " << size_in <<
" v " << v <<
" " << v / 2 << std::endl;
63 for(
unsigned int i = 0; i < 20; ++i) {
64 if( max_size == (1 << i)) {
70 std::cout <<
"getLvels return max_size " << max_size <<
" max_level " <<
max_level << std::endl;
76 std::cout <<
"WaveletBase::print_values option " << only_first_last << std::endl;
78 if ( only_first_last ) {
79 std::cout <<
"first i=0 " <<
values[0] << std::endl;
80 std::cout <<
"first i=1 " <<
values[1] << std::endl;
84 for (
unsigned int i = 0; i <
size; i ++ )
85 std::cout <<
" i= " << i <<
values[i] << std::endl;
87 std::cout <<
"end print_values \n" << std::endl;
93 std::cout <<
"\n\t Haar Transform" << std::endl;
99 std::cout <<
"End Haar Transform nb_level " <<
nb_level << std::endl;
118 std::cout <<
"\n\t Haar Inverse Transform" << std::endl;
122 std::cout <<
"default coeff use all" << std::endl;
125 std::cout <<
"use modified coefficient " << std::endl;
142 std::cout <<
"End Haar InvTransform " <<
nb_level << std::endl;
152 std::cout <<
"HaarCalc size " <<
size <<
" tmp_size " << tmp_size <<
" tmp_level " << tmp_level << std::endl;
160 for (
unsigned int i = 0, j = 0; i < tmp_size*2; i += 2, j++) {
161 a[j] = (tmp_values[i] + tmp_values[i+1])/2.;
162 c[j] = (tmp_values[i] - tmp_values[i+1])/2.;
166 std::vector<double> tmp_coeff, tmp_average;
167 tmp_coeff.reserve(tmp_size);
168 tmp_average.reserve(tmp_size);
170 for (
unsigned int j = 0; j < tmp_size; j++ ) {
171 std::cout << c[j] <<
" ";
172 tmp_coeff.push_back( c[j] );
173 tmp_average.push_back( a[j] );
175 std::cout <<
" " << std::endl;
181 if ( tmp_size == 1 ) {
197 std::cout <<
"HaarInvTransform tmp_size:" << tmp_size <<
" tmp_level:" << tmp_level << std::endl;
199 double new_values[tmp_size];
201 for (
unsigned int i = 0, j = 0; i < tmp_size/2; i++, j= j+2 ) {
205 new_values[j+1] = tmp_values[i] - map_coeff_filt[tmp_level+1][i];
208 for (
unsigned int i = 0; i < tmp_size; i++ ) {
209 std::cout << new_values[i] <<
" ";
211 std::cout <<
" " << std::endl;
213 if ( tmp_level == 0 ) {
214 std::cout <<
"return recursion " << std::endl;
215 retValue =
new double[tmp_size];
217 for (
unsigned int i=0; i< tmp_size; i++ )
218 retValue[i] = new_values[i];
238 std::cout <<
"\nEntry Filter nb1:" << numb1 <<
" nb2:" << numb2 << std::endl;
239 std::cout <<
"mode " << mode <<
" strcmp " << strcmp( mode,
"DEL LEVEL") << std::endl;
245 if ( strcmp( mode,
"DEL LEVEL")==0 ) {
246 std::cout <<
"delete level from " << numb1 <<
" to " << numb2 << std::endl;
247 for (
unsigned int i = (
unsigned int)numb1; i<= (
unsigned int)numb2; i++ ) {
249 std::cout <<
"tmp " << tmp << std::endl;
250 for (
unsigned int j = 0; j<tmp; j++ )
260 std::cout <<
"Print Coefficient size " <<
size << std::endl;
261 std::cout <<
"Haar value " <<
haar_value << std::endl;
262 std::cout <<
"max_level " <<
max_level << std::endl;
263 std::cout <<
"nb_level " <<
nb_level <<
"\n" << std::endl;
266 for (
unsigned int i=1; i <=
nb_level; i ++ ) {
267 std::cout <<
"Level " << i << std::endl;
268 std::cout <<
"nb_coeff " <<
map_coeff[i].size() << std::endl;
269 std::cout <<
"nb_average " <<
map_average[i].size() << std::endl;
270 std::cout <<
"coeff :";
271 for (
unsigned int j=0; j <
map_coeff[i].size(); j++ ) {
274 std::cout <<
"\naverage :";
275 for (
unsigned int j=0; j <
map_average[i].size(); j++ ) {
278 std::cout <<
" " << std::endl;
285 std::cout <<
"Entry Haar::Draw " << std::endl;
int Transform()
entry for haar transformation, will call CalcTransform
double * CalcInvTransform(double *values, unsigned int size, unsigned int level)
unsigned int nb_level
nb_level computed <= max_lvel
unsigned int size
initial size
std::map< unsigned int, std::vector< double > > map_average
save also intermediate average
virtual void print_values(bool only_first_last=false)
std::map< unsigned int, std::vector< double > > map_coeff_filt
double * values
initial values
double CalcTransform(double *values, unsigned int size, unsigned int level)
recursive function, need tmp argument, but tmp_values not modified (const ??)
unsigned int max_level
maximum nb_level: 2^0=1 (initial) to 2^nb_level-1 ?? loaded in derivative
unsigned int getLevels(unsigned int size_in)
given a size ( max_level ?? ) set the number maximum of level,and return maximim size ...
double * InvTransform()
entry for inverse transformation.
int isPowerOfTwo(unsigned int x)
virtual void print_coeff()
std::map< unsigned int, std::vector< double > > map_coeff
assigned last loop, should be the average
void Filter(const char *mode, int numb1, int numb2)