quick start:g++ [flags ...] file ... -l /isip/tools/lib/$ISIP_BINARY/lib_math_scalar.a #include <ComplexFloat.h> ComplexFloat(complexfloat arg = DEF_VALUE); ComplexFloat(const ComplexFloat& arg); ComplexFloat& operator= (const ComplexFloat& arg);
description:ComplexFloat val0; val0 = 10.0; ComplexFloat val1(2.3, 3.4); ComplexFloat val2(L"-2.9-4.1j"); val0 = val1; ComplexFloat val3; val3 = val2.log()/val1.log(); val3.pow(val0, val3);
static const String CLASS_NAME = L"ComplexFloat";
static const long ERR = 21300;
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;
~ComplexFloat();
ComplexFloat(complexfloat arg = DEF_VALUE);
ComplexFloat(const ComplexFloat& arg);
assign methods are inherited from the MComplexScalar template class
ComplexFloat& operator= (const ComplexFloat& 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
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 the MScalar template class
operator complexdouble() const;
operator complexlong() const;
using MScalar<complexfloat, float32>::bor;
using MScalar<complexfloat, float32>::band;
using MScalar<complexfloat, float32>::bxor;
using MScalar<complexfloat, float32>::brs;
using MScalar<complexfloat, float32>::bls;
using MScalar<complexfloat, float32>::bcmpl;
using MScalar<complexfloat, float32>::operator%=;
using MScalar<complexfloat, float32>::operator%;
using MScalar<complexfloat, float32>::mod;
using MScalar<complexfloat, float32>::centerClip;
using MScalar<complexfloat, float32>::fraction;
using MScalar<complexfloat, float32>::limit;
using MScalar<complexfloat, float32>::limitmag;
ComplexFloat 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.
ComplexFloat 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();
ComplexFloat rand_num; ComplexFloat value; ComplexFloat value1; // using default seed // value = rand_num.rand(); // Gaussian random number generation // ComplexFloat mean(5.2, 0.2); ComplexFloat std_dev(3.2, 0.7); value1 = rand_num.grand(mean, std_dev);