算法流程(以8点为例)
蝶形运算单元及参数确定
运行环境:
vs2015及Python3.5
#Complex.h
#pragma once
#include "iostream"
#include <string>
using namespace std;
class Complex
{
public:
Complex(double real,double img); //构造函数
Complex(Complex &c); //拷贝函数
Complex(); //默认构造函数
Complex operator=(const Complex &c) //赋值运算符重载
{
this->real = c.real;
this->img = c.img;
return *this;
}
Complex operator*(const Complex &c) //乘法运算符
{
Complex temp;
temp.real = this->real * c.real - this->img * c.img;
temp.img = this->real * c.img + this->img * c.real;
return temp;
}
Complex operator+(const Complex &c) //加法运算符重载
{
Complex temp;
temp.real = this->real + c.real;
temp.img = this->img + c.img;
return temp;
}
Complex operator-(const Complex &c) //减法云算法重载
{
Complex temp;
temp.real = this->real - c.real;
temp.img = this->img - c.img;
return temp;
}
string getComplex(); //输出复数
void setComplex(double &real,double &img); //设置复数
void setReal(double real); //设置实数
void setImg(double img); //设置虚部
double getRea