quick start:g++ [flags ...] file ... -l /isip/tools/lib/$ISIP_BINARY/lib_math_scalar.a #include <ComplexDouble.h> ComplexDouble(complexdouble arg = DEF_VALUE); ComplexDouble(const ComplexDouble& arg); ComplexDouble& operator= (const ComplexDouble& arg);
description:ComplexDouble val0; val0 = 10.0; ComplexDouble val1(2.3, 3.4); ComplexDouble val2(L"-2.9-4.1j"); val0 = val1; ComplexDouble val3; val3 = val2.log()/val1.log(); val3.pow(val0, val3);
static const String CLASS_NAME = L"ComplexDouble";
static const long ERR = 21400;
static MemoryManager mgr_d;
static const String& name();
static boolean diagnose(Integral::DEBUG debug_level);
setDebug method is inherited from base class
boolean debug(const unichar* message) const;
~ComplexDouble();
ComplexDouble(complexdouble arg = DEF_VALUE);
ComplexDouble(const ComplexDouble& arg);
assign methods are inherited from the MComplexScalar template class
ComplexDouble& operator= (const ComplexDouble& arg);
boolean read(Sof& sof, long tag, const String& name = CLASS_NAME);
boolean write(Sof& sof, long tag, const String& name = CLASS_NAME) const;
equality methods are inherited from the MComplexScalar template class
memory management methods: clear method is inherited from the MComplexScalar template class
static void* operator new(size_t size);
static void* operator new[](size_t size);
static void operator delete(void* ptr);
static void operator delete[](void* ptr);
static boolean setGrowSize(long grow_size);
other memory management methods are inherited from MScalar template class.
operator complexfloat() const;
operator complexlong() const;
using MScalar<complexdouble, float64>::bor;
using MScalar<complexdouble, float64>::band;
using MScalar<complexdouble, float64>::bxor;
using MScalar<complexdouble, float64>::brs;
using MScalar<complexdouble, float64>::bls;
using MScalar<complexdouble, float64>::bcmpl;
using MScalar<complexdouble, float64>::operator%=;
using MScalar<complexdouble, float64>::operator%;
using MScalar<complexdouble, float64>::mod;
using MScalar<complexdouble, float64>::centerClip;
using MScalar<complexdouble, float64>::fraction;
using MScalar<complexdouble, float64>::limit;
using MScalar<complexdouble, float64>::limitmag;
ComplexDouble x(L"1+1j"), y(L"2+3j"), z(L"3+4j"), ans; ans = (x * y + z) / (x + y);Basic math is fairly straightforward though casting is sometimes required for mixed types.
ComplexDouble val0(5.0, 0); String tmp_filename(L"foo"); Sof tmp_file; tmp_file.open(tmp_filename, File::WRITE_ONLY, File::TEXT); val0.write(tmp_file, (long)0); tmp_file.close();
ComplexDouble rand_num; ComplexDouble value; ComplexDouble value1; // using default seed // value = rand_num.rand(); // Gaussian random number generation // ComplexDouble mean(5.2, 0.2); ComplexDouble std_dev(3.2, 0.7); value1 = rand_num.grand(mean, std_dev);