You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
877 B
C++
51 lines
877 B
C++
#include "FITKNumberComplex.h"
|
|
#include <cmath>
|
|
|
|
namespace Core
|
|
{
|
|
FITKNumberComplex::FITKNumberComplex(const double& R, const double & I)
|
|
:_real(R),_imaginary(I)
|
|
{
|
|
}
|
|
|
|
FITKNumberComplex::FITKNumberComplex(const FITKNumberComplex& number)
|
|
{
|
|
//拷贝对象
|
|
_real = number.getReal();
|
|
_imaginary = number.getImaginary();
|
|
}
|
|
|
|
|
|
double FITKNumberComplex::getReal() const
|
|
{
|
|
return _real;
|
|
}
|
|
|
|
void FITKNumberComplex::setReal(const double& r)
|
|
{
|
|
_real = r;
|
|
}
|
|
|
|
|
|
double FITKNumberComplex::getImaginary() const
|
|
{
|
|
return _imaginary;
|
|
}
|
|
|
|
void FITKNumberComplex::setImaginary(const double& i)
|
|
{
|
|
_imaginary = i;
|
|
}
|
|
|
|
|
|
double FITKNumberComplex::getNorm() const
|
|
{
|
|
//模大小
|
|
return sqrt(_real*_real + _imaginary * _imaginary);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|