lifttest.cpp

来自「小波提升格式的源代码」· C++ 代码 · 共 42 行

CPP
42
字号


#include <stdio.h>

#include <vector>
using namespace std;

typedef vector<double> DoubleVec;

#include "C++\lifting.h"


double data[] = { 32.0, 10.0, 20.0, 38.0, 37.0, 28.0, 38.0, 34.0,
		  18.0, 24.0, 18.0, 9.0, 23.0, 24.0, 28.0, 34.0 };


void main()
{
  debug dbg;
  liftingScheme poly;

  int N = sizeof( data ) / sizeof( double );
  DoubleVec ts;

  int i;
  for (i = 0; i < N; i++) {
    ts.push_back( data[i] );
  }

  printf("data: ");
  dbg.pr_vector( ts );
  printf("\n");

  poly.transform( ts );
  dbg.pr_ordered( ts );
  printf("\n");

  poly.invTransform( ts );
  dbg.pr_vector( ts );
  printf("\n");
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?