rms_error.cc

来自「C++语言写的小波变换和傅立叶变换的源代码」· CC 代码 · 共 27 行

CC
27
字号
//file: rms_error.cc  This returns ||in - out||/||in|| in l^2-norm#include <math.h>#include "rms_error.h"real RMS_error(const Interval &input, const Interval &output ){  assert(input.beg==output.beg && input.end==output.end);  real error = 0, temp = 0;  real temp2;  for(int i=input.beg; i<=input.end; i++)    {      temp2 = input[i]-output[i];      error += temp2*temp2;      temp += input[i]*input[i];    }  error /= temp;  error = sqrt(error);  return error;}

⌨️ 快捷键说明

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