Programming Reference for VirtualLab Fusion  2022.1
Public Member Functions | Properties | List of all members
ComplexFieldDerivative1D Class Reference

This class is subject to change. Programs using this class may require changes with a new version of VirtualLab.
Class derived from ComplexField, designed especially for one dimensional data. More...

Inheritance diagram for ComplexFieldDerivative1D:
ComplexField CFieldDerivative1DReal

Public Member Functions

override object Clone ()
 Clones this ComplexFieldDerivative1D. More...
 
 ComplexFieldDerivative1D ()
 Creates a ComplexFieldDerivative1D with 1 sampling point. The default precision is used and the internal data presentation is complex.
 
 ComplexFieldDerivative1D (ComplexField cf)
 Constructor that gets an object of type ComplexField. More...
 
 ComplexFieldDerivative1D (ComplexFieldDerivative1D cfd)
 Copy constructor. More...
 
 ComplexFieldDerivative1D (int samplingPoints)
 Creates a ComplexFieldDerivative1D with given number of sampling points. The default precision is used and the internal data representation is complex. More...
 
 ComplexFieldDerivative1D (int samplingPoints, bool isComplex, PrecisionMode precision)
 Creates a ComplexFieldDerivative1D with given number of sampling points using specified precision. The internal data representation can be complex or real. More...
 
 ComplexFieldDerivative1D (int samplingPoints, bool isComplex, PrecisionMode precision, Complex c)
 Creates a ComplexFieldDerivative1D with given number of sampling points using specified precision. The internal data representation can be complex or real. The field will be filled with a given constant value. In case of a real valued complex field only the real part of constant value is stored. More...
 
override void EmbedExtract ()
 Embeds the current ComplexFieldDerivative1D into double side-length field of zero sampling points and places the original in the middle of the new field.
 
override ComplexField EmbedExtract (Rectangle rectangle)
 Extract a region of the current ComplexFieldDerivative1D including the left corner but excluding the right corner. More...
 
override void EmbedExtract (Vector newSize)
 Embeds the current ComplexFieldDerivative1D into field of passed size of zero sampling points and places the original in the middle of the new field. By decreasing size, field can be extracted. More...
 
- Public Member Functions inherited from ComplexField
void AddConjugate ()
 Adds conjugated ComplexField to current one.
 
void AddEqual (Complex c)
 Adds a Complex to current ComplexField. See important note on ComplexField. More...
 
void AddEqual (ComplexField field)
 Adds a ComplexField to current one. Both field must have same number of sampling points. See important note on ComplexField. More...
 
void ClipAmplitude (double clippingLevel)
 Sets all amplitude value greater than clippingLevel to clippingLevel. More...
 
 ComplexField ()
 Creates a ComplexField with 1x1 sampling points. The default precision is used and the internal data presentation is complex.
 
 ComplexField (ComplexField field)
 Copy constructor. More...
 
 ComplexField (Vector samplingPoints)
 Creates a ComplexField with given number of sampling points. The default precision is used and the internal data presentation is complex. More...
 
 ComplexField (Vector samplingPoints, bool isComplex, PrecisionMode precision)
 Creates a ComplexField with given number of sampling points using specified precision. The internal data representation can be complex or real. More...
 
 ComplexField (Vector samplingPoints, bool isComplex, PrecisionMode precision, Complex c)
 Creates a ComplexField with given number of sampling points using specified precision. The internal data representation can be complex or real. Field is filled with constant value. In case of a real valued complex field only the real part of constant value is stored. More...
 
 ComplexField (Vector samplingPoints, bool isComplexFunction, PrecisionMode precision, RealFunction f, ParallelizationType parallelizationType)
 Constructs a ComplexField object with given number of sampling points using a RealFunction. which will be evaluated to fill in the complex amplitudes with the specified precision. The parameters x and y of the real function are measured in pixel coordinates whose origin is the upper left corner of the field. More...
 
 ComplexField (Vector samplingPoints, PrecisionMode precision, ComplexFunction f, ParallelizationType parallelizationType)
 Constructs a ComplexField object with given number of sampling points using a ComplexFunction which will be evaluated to fill in the complex amplitudes with the specified precision. The parameters x and y of the real function are measured in pixel coordinates whose origin is the upper left corner of the field. More...
 
void Conjugate ()
 Conjugates current ComplexField.
 
void ConvertTo2DDoubleArray (out double[,] doubleArrayReal, out double[,] doubleArrayImaginary)
 Public support method to convert the complex field into two double arrays. (real and imaginary part will be output separately) Remark: This function was implemented to realize compatibility to Python. More...
 
void DivEqual (Complex c)
 Divides the present ComplexField by complex number. See important note on ComplexField. More...
 
void DivEqual (ComplexField field)
 Divides the present ComplexField by passed one. Both field must have same number of sampling points. See important note on ComplexField. More...
 
void EmbedCorner (Vector newSize)
 Embeds the current ComplexField into double side-length field of zero sampling points and places the original in bottom left corner of the new field. If the ComplexField is one-dimensional, only longer side of field is doubled. More...
 
virtual void EmbedExtract ()
 Embeds the current ComplexField into double side-length field of zero sampling points and places the original in the middle of the new field. If the ComplexField is one-dimensional, only longer side of field is doubled.
 
virtual ComplexField EmbedExtract (Rectangle rectangle)
 Extract a region of the current ComplexField including the bottom left corner but excluding the top right corner. More...
 
virtual void EmbedExtract (Vector newSize)
 Embeds the current ComplexField into field of passed size of zero sampling points and places the original in the middle of the new field. By decreasing size, field can be extracted. More...
 
override bool Equals (Object obj)
 Checks whether two complex fields represent the same values. More...
 
ComplexField Extract (Vector size, VectorL position)
 Extracts the given region at given position out of the current field. Points exceeding boundaries of current field will be ignored. More...
 
ComplexField ExtractColumn (int colIndex)
 Extracts a column out of the current field. Points exceeding boundaries of current field will be set to zero. More...
 
ComplexField ExtractRow (int rowIndex)
 Extracts a row out of the current field. Points exceeding boundaries of current field will be set to zero. More...
 
void Fill (Complex c)
 Fills whole current ComplexField with the specified complex value. More...
 
void Fill (Complex c, Rectangle marker, bool inside)
 Fills whole ComplexField inside marker with the specified complex value. If inside is set to false, field outside marker will be filled. More...
 
void GetAmplitude ()
 Returns ComplexField with zero phase and a magnitude equal to that of current ComplexField.
 
void GetImaginaryPart ()
 Extracts the imaginary part of current ComplexField. The real part is set to zero.
 
void GetIntensity ()
 Extracts the intensity of ComplexField and shifts to the real part of current ComplexField. The imaginary part is set to zero.
 
void GetPhase ()
 Returns ComplexField with unit magnitude and a phase equal to that of current ComplexField.
 
void GetRealPart ()
 Extracts the real part of current ComplexField. The imaginary part is set to zero.
 
void HorizontalMirror ()
 Performs a horizontal mirroring of current ComplexField. [SamplingPoints.X - x - 1, y] = [x, y]
 
void Insert (ComplexField field, VectorL position)
 Inserts the given ComplexField into current field at given position. Points exceeding boundaries of current field will be ignored. More...
 
void InsertColumn (int colIndex)
 Inserts or appends empty column. More...
 
void InsertRow (int rowIndex)
 Inserts or appends empty row. More...
 
void LiftPositive ()
 Lifts real part of current ComplexField to positive numbers. Function detects the minimum real number. If this number is smaller than zero it adds the absolute value of the minimum. If the minimum real number is larger than zero the present object is returned without changes.
 
double[] LinearFit (VectorD samplDist)
 Linear regression on a real valued Complex Field (phase derivative of a CA in x resp. y) Excluded points are assumed to be marked by float.Epsilon More...
 
void ModifyComplexPart (ComplexPart complexPart, bool makeRealValuedIfSuitable=false)
 Extract, shifts or swaps complex parts of the complex field. More...
 
void MultEqual (Complex c)
 Multiplies a Complex number to current ComplexField. See important note on ComplexField. More...
 
void MultEqual (ComplexField field)
 Multiplies a ComplexField with current one. Both field must have same number of sampling points. See important note on ComplexField. More...
 
void MultEqual (IRegion1D2D region, SamplingParameters samplingParameters)
 Multiplies a IRegion1D2D with this ComplexField. More...
 
void Normalize (System.Drawing.Rectangle? rectangle=null)
 Normalizes ComplexField so that maximal amplitude inside rectangle is one. More...
 
void PowerEqual (Complex c)
 Raises every element of current ComplexField to the power of passed complex number. See important note on ComplexField. More...
 
double RadiusError (double constPart, double radius, double k, VectorD dist, bool computeInX)
 compute the fit measure of the spherical phase dependent on radius in partial phase derivative More...
 
void Replicate (Vector newSize, VectorL shift)
 Replicates current ComplexField periodically. Needs new size. More...
 
void Replicate_Periodic (Vector newSize)
 Replicates current ComplexField periodically, old field is at (0,0). Needs new size. More...
 
void Rotate180 ()
 Rotates this ComplexField through 180° about the field center.
 
void Shift (Vector shift)
 Shifts current ComplexField by a specified distance. Size is not modified, so sampling points can get lost. More...
 
void SubEqual (Complex c)
 Subtracts a Complex from current ComplexField. See important note on ComplexField. More...
 
void SubEqual (ComplexField field)
 Subtracts a ComplexField from current one. Both field must have same number of sampling points. See important note on ComplexField. More...
 
void Transpose ()
 Transposes current ComplexField. This means [x, y] = [y, x].
 
void VerticalMirror ()
 Performs a vertical mirroring of current ComplexField. [x, SamplingPoints.Y - y - 1] = [x, y]
 

Properties

override bool IsOneD [get]
 Overrides a property in base class ComplexField. This will return always TRUE for objects of type ComplexFieldDerivative1D.
 
override Vector SamplingPoints [get, set]
 Gets or sets the number of sampling points. Setting a new number of sampling points will embed the sampling points in zero samples or extract the central sampling points. See also EmbedExtract.
 
override Complex this[int x, int y] [get, set]
 Overriden 2D indexer. Uses 1D indexer, ignoring y! More...
 
Complex this[int x] [get, set]
 Indexer to access complex values of complex field. Property performs a range checking before every access. If you try to read a complex value and index is out of range Complex(0) is returned. If you try to set a complex value and index is out of range nothing will happen. Indexer returns always a complex number in double precision independent on the internal complex number representation. During the setting of a complex value the indexer converts the complex number from double precision to the internal data representation. If internal precision is less accurate double precision information will be lost. Conversion to the less accurate precision is done by truncating the numbers after the last digit of the new precision. If IsComplex = false only the real part is stored. More...
 
Complex this[long x] [get, set]
 Indexer to access complex values of complex field. Property performs a range checking before every access. If you try to read a complex value and index is out of range Complex(0) is returned. If you try to set a complex value and index is out of range nothing will happen. Indexer returns always a complex number in double precision independent on the internal complex number representation. During the setting of a complex value the indexer converts the complex number from double precision to the internal data representation. If internal precision is less accurate double precision information will be lost. Conversion to the less accurate precision is done by truncating the numbers after the last digit of the new precision. If IsComplex = false only the real part is stored. More...
 
- Properties inherited from ComplexField
virtual bool IsComplex [get, set]
 Gets or sets the internal representation of the values of ComplexField. If IsComplex = true the real and imaginary part is stored. Is IsComplex = false only the real part is stored. It is assumed that the imagary part is zero. Setting the IsComplex property will convert the ComplexField from present representation to new one. Information can be lost during this conversion.
 
virtual bool IsOneD [get]
 Indicates whether field is one-dimensional or not.
 
PrecisionMode Precision [get, set]
 Changes the precision of the internal number representation. It is possible to switch between double (64 bit), single (32 bit) and integer precision (16bit). The different precisions are realized by using 3 different arrays of numbers. Only the array that corresponds to the selected precision is used and contains the values of the ComplexField. All other arrays are empty. Setting a different precision than the present will start a conversion of the ComplexField data to the new precision format. Information can be lost in case of a conversions to a lower accuracy.
 
virtual Vector SamplingPoints [get, set]
 Gets or sets number of sampling points of ComplexField. Setting a new number of sampling points will embed the sampling points in zero samples or extract the central sampling points. See also EmbedExtract.
 
int SamplingPointsOneD [get]
 Number of sampling points of one-dimensional field. An exception will be thrown, if field is two-dimensional.
 
virtual Complex this[int x, int y] [get, set]
 Indexer to access complex values of complex field. Property performs a range checking before every access. If you try to read a complex value and index is out of range Complex(0) is returned. If you try to set a complex value and index is out of range nothing will happen. Indexer returns always a complex number in double precision independent on the internal complex number representation. During the setting of a complex value the indexer converts the complex number from double precision to the internal data representation. If internal precision is less accurate double precision information will be lost. Conversion to the less accurate precision is done by truncating the numbers after the last digit of the new precision. If IsComplex = false only the real part is stored. More...
 
Complex this[long x, long y] [get, set]
 Indexer to access complex values of complex field. Property performs a range checking before every access. If you try to read a complex value and index is out of range Complex(0) is returned. If you try to set a complex value and index is out of range nothing will happen. Indexer returns always a complex number in double precision independent on the internal complex number representation. During the setting of a complex value the indexer converts the complex number from double precision to the internal data representation. If internal precision is less accurate double precision information will be lost. Conversion to the less accurate precision is done by truncating the numbers after the last digit of the new precision. If IsComplex = false only the real part is stored. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ComplexField
static ComplexField ConvertFrom2_1D_DoubleArrays (double[] doubleArray1, double[] doubleArray2)
 Converts two one-dimensional double arrays to a two dimensional complex field of dimensions 2 x doubleArray1.Length More...
 
static ComplexField ConvertFrom2D_DoubleArray (double[,] doubleArray)
 Converts a two dimensional double array to a two dimensional complex field More...
 
static ComplexFieldDerivative1D ConvertFrom_1D_ComplexArray (Complex[] complexArray)
 Converts one one-dimensional complex array to a one-dimensional complex field More...
 
static CFieldDerivative1DReal ConvertFrom_1D_DoubleArray (double[] doubleArray)
 Converts one one-dimensional double array to a one-dimensional complex field More...
 
static double[] ConvertTo1D_DoubleArray (ComplexField complexField, bool errorWhenComplex)
 Converts a one dimensional complex field to a one dimensional double array More...
 
static double[,] ConvertTo2D_DoubleArray (ComplexField complexField, bool errorWhenComplex)
 Converts a two dimensional complex field to a two dimensional double array More...
 
static bool operator!= (ComplexField field1, ComplexField field2)
 Compares two complex fields for equality More...
 
static ComplexField operator* (Complex c, ComplexField field)
 Multiplies a complex value to a complex field. More...
 
static ComplexField operator* (ComplexField field, Complex c)
 Multiplies a complex value to a complex field. More...
 
static ComplexField operator* (ComplexField field1, ComplexField field2)
 Multiplies two complex fields. More...
 
static ComplexField operator+ (ComplexField field, Complex c)
 Adds a complex value to a complex field. More...
 
static ComplexField operator+ (ComplexField field1, ComplexField field2)
 Adds two complex fields. More...
 
static ComplexField operator- (Complex c, ComplexField field)
 Subtracts a complex number and a complex field. More...
 
static ComplexField operator- (ComplexField field, Complex c)
 Subtracts a complex field and a complex number. More...
 
static ComplexField operator- (ComplexField field1, ComplexField field2)
 Subtracts two complex fields. More...
 
static ComplexField operator/ (ComplexField field, Complex c)
 Divides a complex field by a complex number More...
 
static ComplexField operator/ (ComplexField field1, ComplexField field2)
 Divide two complex fields More...
 
static bool operator== (ComplexField field1, ComplexField field2)
 Compares two complex fields for equality More...
 
static Complex operator| (ComplexField field1, ComplexField field2)
 Computes the inner (or scalar) product of two complex fields as defined by (u|v) := Integrate[u(x) * v^(x), {x, -Infinity, Infinity}]. More...
 

Detailed Description

This class is subject to change. Programs using this class may require changes with a new version of VirtualLab.
Class derived from ComplexField, designed especially for one dimensional data.

Constructor & Destructor Documentation

◆ ComplexFieldDerivative1D() [1/5]

Copy constructor.

Parameters
cfdField to copy.

◆ ComplexFieldDerivative1D() [2/5]

ComplexFieldDerivative1D ( int  samplingPoints)

Creates a ComplexFieldDerivative1D with given number of sampling points. The default precision is used and the internal data representation is complex.

Parameters
samplingPointsNumber of points.

◆ ComplexFieldDerivative1D() [3/5]

ComplexFieldDerivative1D ( int  samplingPoints,
bool  isComplex,
PrecisionMode  precision 
)

Creates a ComplexFieldDerivative1D with given number of sampling points using specified precision. The internal data representation can be complex or real.

Parameters
samplingPointsNumber of values.
precisionDesired PrecisionMode.
isComplexIndicates, whether the new ComplexFieldDerivative1D should internaly store real + imaginary part (TRUE) or the real part only (FALSE), where the imaginary part is zero.

◆ ComplexFieldDerivative1D() [4/5]

ComplexFieldDerivative1D ( int  samplingPoints,
bool  isComplex,
PrecisionMode  precision,
Complex  c 
)

Creates a ComplexFieldDerivative1D with given number of sampling points using specified precision. The internal data representation can be complex or real. The field will be filled with a given constant value. In case of a real valued complex field only the real part of constant value is stored.

Parameters
samplingPointsNumber of values.
precisionDesired PrecisionMode.
isComplexIndicates, whether the new ComplexFieldDerivative1D should internaly store real + imaginary part (TRUE) or the real part only (FALSE), where the imaginary part is zero.
cComplex number to initialize the field with.

◆ ComplexFieldDerivative1D() [5/5]

Constructor that gets an object of type ComplexField.

Parameters
cfComplexField to be converted

Member Function Documentation

◆ Clone()

override object Clone ( )

Clones this ComplexFieldDerivative1D.

Returns
The cloned object.

◆ EmbedExtract() [1/2]

override ComplexField EmbedExtract ( Rectangle  rectangle)
virtual

Extract a region of the current ComplexFieldDerivative1D including the left corner but excluding the right corner.

Note that "new Rectangle(Vector, Vector)" works due to implicit casts.

Parameters
rectangleRegion to extract.
Returns
Result of Operation.

Reimplemented from ComplexField.

◆ EmbedExtract() [2/2]

override void EmbedExtract ( Vector  newSize)
virtual

Embeds the current ComplexFieldDerivative1D into field of passed size of zero sampling points and places the original in the middle of the new field. By decreasing size, field can be extracted.

Parameters
newSizeNew Size in pixel. The y value will be ignored and considered to be 1.

Reimplemented from ComplexField.

Property Documentation

◆ this[int x, int y]

override Complex this[int x, int y]
getset

Overriden 2D indexer. Uses 1D indexer, ignoring y!

Parameters
xIndex for x coordinate
yIndex for y coordinate
Returns

◆ this[int x]

Complex this[int x]
getset

Indexer to access complex values of complex field. Property performs a range checking before every access. If you try to read a complex value and index is out of range Complex(0) is returned. If you try to set a complex value and index is out of range nothing will happen. Indexer returns always a complex number in double precision independent on the internal complex number representation. During the setting of a complex value the indexer converts the complex number from double precision to the internal data representation. If internal precision is less accurate double precision information will be lost. Conversion to the less accurate precision is done by truncating the numbers after the last digit of the new precision. If IsComplex = false only the real part is stored.

Parameters
xIndex for x-coordinate

◆ this[long x]

Complex this[long x]
getset

Indexer to access complex values of complex field. Property performs a range checking before every access. If you try to read a complex value and index is out of range Complex(0) is returned. If you try to set a complex value and index is out of range nothing will happen. Indexer returns always a complex number in double precision independent on the internal complex number representation. During the setting of a complex value the indexer converts the complex number from double precision to the internal data representation. If internal precision is less accurate double precision information will be lost. Conversion to the less accurate precision is done by truncating the numbers after the last digit of the new precision. If IsComplex = false only the real part is stored.

Parameters
xIndex for x-coordinate