Class Complex.Array
java.lang.Object
smile.math.Complex.Array
- Enclosing class:
Complex
Packed array of complex numbers for better memory efficiency.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapply(int i) Returns the i-th element.get(int i) Returns the i-th element.static Complex.ArrayCreates a packed array of complex values.voidset(int i, double re) Sets the i-th element with a real value.voidSets the i-th element.voidupdate(int i, double re) Sets the i-th element with a real value.voidSets the i-th element.
-
Field Details
-
length
public final int lengthThe length of array.
-
-
Constructor Details
-
Array
public Array(int length) Constructor.- Parameters:
length- the length of array.
-
-
Method Details
-
get
Returns the i-th element.- Parameters:
i- the index.- Returns:
- the i-th element.
-
apply
Returns the i-th element. For Scala convenience.- Parameters:
i- the index.- Returns:
- the i-th element.
-
set
Sets the i-th element.- Parameters:
i- the index.c- the new value.
-
set
public void set(int i, double re) Sets the i-th element with a real value.- Parameters:
i- the index.re- the new value.
-
update
Sets the i-th element. For Scala convenience.- Parameters:
i- the index.c- the new value.
-
update
public void update(int i, double re) Sets the i-th element with a real value. For Scala convenience.- Parameters:
i- the index.re- the new value.
-
of
Creates a packed array of complex values.- Parameters:
x- the complex values.- Returns:
- the packed array of complex values.
-