Class ComplexField1DArray
- Namespace
- VirtualLabAPI.Core.Numerics
- Assembly
- VirtualLabAPI.dll
Class to encapsulate an array of objects of type ComplexFieldDerivative1D. It also ensures that all entries are either complex or real valued.
[Serializable]
public class ComplexField1DArray : ComplexFieldArrayBase<ComplexFieldDerivative1D>, IEquatable<IObjectBase>, ICloneable, IDisposable
- Inheritance
-
ObjectBaseSerializableObjectBaseComplexField1DArray
- Implements
-
IEquatable<IObjectBase>
- Inherited Members
Constructors
ComplexField1DArray()
Default constructor. Creates an empty array of length 1.
public ComplexField1DArray()
ComplexField1DArray(long)
Constructor that creates an empty array of a given length.
public ComplexField1DArray(long length)
Parameters
lengthlongLength of the array to create.
ComplexField1DArray(long, long, bool)
Initializes a new instance of the ComplexField1DArray class.
public ComplexField1DArray(long length, long lengthOfComplexFields, bool isComplex)
Parameters
lengthlongThe number of entries in the array.
lengthOfComplexFieldslongThe number of sampling points in one member field.
isComplexboolif set to
truethe member fields are used to store complex numbers.
ComplexField1DArray(ComplexField1DArray)
Copy constructor.
public ComplexField1DArray(ComplexField1DArray array)
Parameters
arrayComplexField1DArrayComplexField1DArray to copy
ComplexField1DArray(params ComplexFieldDerivative1D[])
Constructor that gets an array of equally sized ComplexFieldDerivative1D objects
public ComplexField1DArray(params ComplexFieldDerivative1D[] array)
Parameters
arrayComplexFieldDerivative1D[]One or more ComplexFieldDerivative1D objects or an array of ComplexFieldDerivative1D objects.
ComplexField1DArray(params ComplexField[])
Constructor that gets an array of equally sized ComplexFieldDerivative1D objects.
public ComplexField1DArray(params ComplexField[] array)
Parameters
arrayComplexField[]One or more ComplexField objects or an array of ComplexField objects.
Properties
ArrayOfComplexFields
Gets the array of complex fields.
protected override ComplexFieldDerivative1D[] ArrayOfComplexFields { get; }
Property Value
this[long]
Indexer to get or set a contained ComplexFieldDerivative1D object.
public ComplexFieldDerivative1D this[long index] { get; set; }
Parameters
indexlongIndex to access
Property Value
- ComplexFieldDerivative1D
ComplexFieldDerivative1D at given index.
Length
Gets the length of the array
public int Length { get; }
Property Value
SamplingPoints
Gets the number of SamplingPoints. Returns “0” for an empty array.
public int SamplingPoints { get; }
Property Value
Methods
AddRange(ComplexField1DArray)
Adds a range of complex fields, provided by another ComplexField1DArray, to this.
public void AddRange(ComplexField1DArray arrayToAdd)
Parameters
arrayToAddComplexField1DArrayComplexField1DArray to get the complex fields to add from.
Clone()
Creates a deep copy of this ComplexField1DArray object.
public override object Clone()
Returns
- object
Deep copy of this
Equals(object, EqualityIntent)
Determines whether the specified object is equal to this instance.
public override bool Equals(object otherObject, EqualityIntent equalityIntent)
Parameters
otherObjectobjectThe object to compare with this instance.
equalityIntentEqualityIntentDefines what kind of equality you want to check when comparing two objects, for example all values or physical equality.
Returns
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
ToArray(bool)
Returns this class as array of ComplexFieldDerivative1D.
public ComplexFieldDerivative1D[] ToArray(bool cloneFields = true)
Parameters
cloneFieldsboolIf this optional parameter is set to
false, references to the original fields are returned instead of copies.
Returns
- ComplexFieldDerivative1D[]
An array of ComplexFieldDerivative1D.
Operators
operator ==(ComplexField1DArray, ComplexField1DArray)
Checks whether two ComplexField1DArray objects are equal.
public static bool operator ==(ComplexField1DArray cf1, ComplexField1DArray cf2)
Parameters
cf1ComplexField1DArrayThe first ComplexField1DArray.
cf2ComplexField1DArrayThe second ComplexField1DArray.
Returns
- bool
The result of the operator.
operator !=(ComplexField1DArray, ComplexField1DArray)
Checks whether two ComplexField1DArray objects are unequal.
public static bool operator !=(ComplexField1DArray cf1, ComplexField1DArray cf2)
Parameters
cf1ComplexField1DArrayThe first ComplexField1DArray.
cf2ComplexField1DArrayThe second ComplexField1DArray.
Returns
- bool
The result of the operator.