MWComplex class passes or receives a
complex numeric array into or from a compiled class method. This class
contains four properties/methods:
Stores the real part of a complex array (read/write). The
is the default property of the
The value of this property can be any type coercible to a
as well as object types, with the restriction that the underlying
array must resolve to a numeric matrix (no cell data allowed). Valid Visual Basic® numeric
types for complex arrays include
Stores the imaginary part of a complex array (read/write). The
is optional and can be
Empty for a pure real array.
Imag property is not empty and the size
and type of the underlying array do not match the size and type of
Real property's array, an error results when
the object is used in a method call.
The following Visual Basic code creates a complex array with the following entries:
x = [ 1+i 1+2i 2+i 2+2i ] Sub foo() Dim x As MWComplex Dim rval(1 To 2, 1 To 2) As Double Dim ival(1 To 2, 1 To 2) As Double On Error Goto Handle_Error For I = 1 To 2 For J = 1 To 2 rval(I,J) = I ival(I,J) = J Next Next Set x = new MWComplex x.Real = rval x.Imag = ival . . . Exit Sub Handle_Error: MsgBox(Err.Description) End Sub
Stores a reference to an
This property sets or gets the array formatting and data conversion
flags for a particular complex array. Each
has its own
MWFlags property. This property overrides
the value of any flags set on the object whose methods are called.
Creates a copy of an
Reference to an uninitialized
Clone allocates a new
and creates a deep copy of the object's contents. Call this function
when a separate object is required instead of a shared copy of an
existing object reference.