?? code1.txt
字號(hào):
// testdll.cpp : Defines the entry point for the DLL application.
//
int __stdcall DllMain( long hModule, int ul_reason_for_call, void* lpReserved){return 1;}
// This is an example of an exported variable
//TESTDLL_API int nTestdll=0;
#define datetype double
#define Z(A, B) CComplex(A, B)
struct PixelInfo
{
datetype a,b;
int lvl;
bool out;//計(jì)算完畢
};
struct FractalData
{
char* expression, *origin, *name;
bool tempor;
};
struct CComplex
{
datetype x,y;
CComplex() {};
CComplex(datetype sx, datetype sy):x(sx),y(sy){};
CComplex(const CComplex& cmp):x(cmp.x),y(cmp.y){};
CComplex(double d):x(d),y(0){};
CComplex operator=(const CComplex& cmp) {x=cmp.x; y=cmp.y;return *this;};
CComplex operator+=(const CComplex& cmp) {x+=cmp.x; y+=cmp.y;};
CComplex operator-=(const CComplex& cmp) {x-=cmp.x; y-=cmp.y;};
CComplex operator*=(const CComplex& cmp)
{double temp=x; x=x*cmp.x-y*cmp.y; y=temp*cmp.y+cmp.x*y;};
friend CComplex operator+(datetype,CComplex& cmp);
friend CComplex operator-(datetype,CComplex& cmp);
friend CComplex operator*(datetype,CComplex& cmp);
friend CComplex operator/(datetype,CComplex& cmp);
CComplex operator+(CComplex& cmp) const;
CComplex operator-(CComplex& cmp) const;
CComplex operator*(CComplex& cmp) const;
CComplex operator/(CComplex& cmp) const;
CComplex operator+(datetype dx) const;
CComplex operator-(datetype dx) const;
CComplex operator*(datetype dx) const;
CComplex operator/(datetype dx) const;
CComplex operator^(int n) const;
};
inline CComplex CComplex::operator+(CComplex& cmp2) const
{ CComplex cmp(*this); cmp.x+=cmp2.x; cmp.y+=cmp2.y; return cmp; }
inline CComplex CComplex::operator-(CComplex& cmp2) const
{ CComplex cmp(*this); cmp.x-=cmp2.x; cmp.y-=cmp2.y; return cmp; }
inline CComplex CComplex::operator*(CComplex& cmp2) const
{ CComplex cmp(x*cmp2.x-y*cmp2.y, x*cmp2.y+cmp2.x*y); return cmp; }
inline CComplex CComplex::operator/(CComplex& cmp2) const
{ datetype temp=cmp2.x*cmp2.x+cmp2.y*cmp2.y;
if(temp<1e-14) return 0;
CComplex cmp((x*cmp2.x+y*cmp2.y)/temp, (-x*cmp2.y+cmp2.x*y)/temp); return cmp; }
inline CComplex operator+(datetype dx,CComplex&cmp)
{ return CComplex(dx+cmp.x,cmp.y);}
inline CComplex operator-(datetype dx,CComplex&cmp)
{ return CComplex(dx-cmp.x,-cmp.y);}
inline CComplex operator*(datetype dx,CComplex&cmp)
{ return CComplex(dx*cmp.x,dx*cmp.y);}
inline CComplex operator/(datetype dx,CComplex&cmp)
{ datetype temp=cmp.x*cmp.x+cmp.y*cmp.y;
return CComplex(dx*cmp.x/temp,-dx*cmp.y/temp); }
inline CComplex CComplex::operator+(datetype dx) const
{ CComplex cmp(*this); cmp.x+=dx; return cmp; }
inline CComplex CComplex::operator-(datetype dx) const
{ CComplex cmp(*this); cmp.x-=dx; return cmp; }
inline CComplex CComplex::operator*(datetype dx) const
{ CComplex cmp(*this); cmp.x*=dx; cmp.y*=dx; return cmp; }
inline CComplex CComplex::operator/(datetype dx) const
{ CComplex cmp(*this); cmp.x/=dx; cmp.y/=dx; return cmp; }
inline CComplex CComplex::operator^(int n) const
{ CComplex cmp(*this); for(int i=0;i<n-1;i++) cmp*=(*this); return cmp; }
extern "C"{
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -