Michael Thomas Flanagan's Java Scientific Library

ArrayMaths Class:      One Dimensional Arrays

     

Last update: 16 March 2015                                                                                                                             PERMISSION TO COPY
Main Page of Michael Thomas Flanagan's Java Scientific Library

This class creates an object representing a one dimensional array which may entered as one of the following types:
  double[],   Double[],   float[],   Float,   long[],   Long[],   int[],   Integer[],   short[],   Short[],   byte[],   Byte[],   BigDecimal[],   BigInteger[],   Complex[],   char[],   Character[],   String[],  Phasor[],   Object[],   Vector<Object>,  ArrayList<Object>   or  Stat.

and contains methods for the following operations:
ArrayMaths is a superclass for the statistical methods class, Stat. The Stat methods are primarily static methods but instance methods are available if the argument to the statistical method is an array. These are listed below.
This class supplements the Java class Arrays (java.util.Arrays).

Arrays may be entered as a range of data types including BigDecimal[] and BigInteger[][. If the array is entered as BigDecimal[] or BigInteger[] and if the called method allows arbitrary precision arithmetic the result will be returned as BigDecimal or BigInteger, if it does not the result BigDecimal and BigInteger will be converted to another data type, typically, double. A list of all the methods, in this library, using arbitrary precision arithmetic may be found on ArbitraryPrecision.

NOTE! This class has just been written and not all of its methods have yet been fully tested. Several classes have been renamed in development. All old named methods have been retained but may not be listed here.

import directive: import flanagan.math.ArrayMaths;

SUMMARY OF METHODS

Constructors for Vector<Object> public ArrayMaths(Vector<Object> vec)
for ArrayList<Object> public ArrayMaths(ArrayList<Object> list)
for double[] array public ArrayMaths(Object[] array)
for double[] array public ArrayMaths(double[] array)
for Double[] array public ArrayMaths(Double[] array)
for float[] array public ArrayMaths(float[] array)
for Float[] array public ArrayMaths(Float[] array)
for long[] array public ArrayMaths(long[] array)
for Long[] array public ArrayMaths(Long[] array)
for int[] array public ArrayMaths(int[] array)
for Integer[] array public ArrayMaths(Integer[] array)
for short[] array public ArrayMaths(short[] array)
for Short[] array public ArrayMaths(Short[] array)
for byte[] array public ArrayMaths(byte[] array)
for Byte[] array public ArrayMaths(Byte[] array)
for BigDecimal[] array public ArrayMaths(BigDecimal[] array)
for BigInteger[] array public ArrayMaths(BigInteger[] array)
for Complex[] array public ArrayMaths(Complex[] array)
for Phasor[] array public ArrayMaths(Phasor[] array)
for char[] array public ArrayMaths(char[] array)
for Character[] array public ArrayMaths(Character[] array)
for String[] array public ArrayMaths(String[] array)
for Stat arrayst public ArrayMaths(Stat arrayst)
Array Type return array type public String arrayType()
return original array types public String originalArrayType()
Array Length return array length public int length()
Deep Copy return a deep copy public ArrayMaths copy()
'Possible loss of precision' messages suppress messages for an instance public void suppressMessages()
restore messages for an instance public void restoreMessages()
suppress messages for an application public static void suppressMessagesTotal()
restore messages for an application public static void restoreMessagesTotal()
Return array as entered or as converted type as double[] public double[] array()
public double[] array_as_double()
as Vector<Object> public Vector<Object> array_as_Vector()
as ArrayList<Object> public ArrayList<Object> array_as_ArrayList()
as a Object[] public Object[] array_as_Object()
as a Row Matrix public Matrix array_as_Matrix_rowMatrix()
as a Column Matrix public Matrix array_as_Matrix_columnMatrix()
as Double[] public Double[] array_as_Double()
as float[] public float[] array_as_float()
as Float[] public Float[] array_as_Float()
as long[] public long[] array_as_long()
as Long[] public long[] array_as_Long()
as int[] public int[] array_as_int()
as Integer[] public Integer[] array_as_Integer()
as short[] public short[] array_as_short()
as Short[] public Short[] array_as_Short()
as byte[] public byte[] array_as_byte()
as Byte[] public Byte[] array_as_Byte()
as BigDecimal[] public BigDecimal[] array_as_BigDecimal()
as BigInteger[] public BigInteger[] array_as_BigInteger()
as char[] public char[] array_as_char()
as Character[] public Character[] array_as_Character()
as String[] public String[] array_as_String()
as Complex[] public Complex[] array_as_Complex()
as the moduli of Complex[] public double[] array_as_modulus_of_Complex()
as the real parts of Complex[] public double[] array_as_real_part_of_Complex()
as the imaginary parts of Complex[] public double[] array_as_imaginary_part_of_Complex()
as a Complex Row Matrix public ComplexMatrix array_as_Complex_rowMatrix()
as a Complex Column Matrix public ComplexMatrix array_as_Complex_columnMatrix()
as Phasor[] public Phasor[] array_as_Phasor()
as the magnitudes of Phasor[] public double[] array_as_magnitude_of_Phasor()
as the phase, in degrees, of Phasor[] public double[] array_as_degrees_phase_of_Phasor()
as the phase, in radians, of Phasor[] public double[] array_as_radians_phase_of_Phasor()
as a Phasor Row Matrix public PhasorMatrix array_as_Phasor_rowMatrix()
as a Phasor Column Matrix public PhasorMatrix array_as_Phasor_columnMatrix()
Return sub-array as double[] public double[] subarray(int start, int end)
public double[] subarray_as_double(int start, int end)
as Vector<Object> public Vector<Object> subarray_as_Vector(int start, int end)
as subarrayList<Object> public subarrayList<Object> subarray_as_subarrayList(int start, int end)
as a Object[] public Object[] subarray_as_Object(int start, int end)
as a Row Matrix public Matrix subarray_as_Matrix_rowMatrix(int start, int end)
as a Column Matrix public Matrix subarray_as_Matrix_columnMatrix(int start, int end)
as Double[] public Double[] subarray_as_Double(int start, int end)
as float[] public float[] subarray_as_float(int start, int end)
as Float[] public Float[] subarray_as_Float(int start, int end)
as long[] public long[] subarray_as_long(int start, int end)
as Long[] public long[] subarray_as_Long(int start, int end)
as int[] public int[] subarray_as_int(int start, int end)
as Integer[] public Integer[] subarray_as_Integer(int start, int end)
as short[] public short[] subarray_as_short(int start, int end)
as Short[] public Short[] subarray_as_Short(int start, int end)
as byte[] public byte[] subarray_as_byte(int start, int end)
as Byte[] public Byte[] subarray_as_Byte(int start, int end)
as BigDecimal[] public BigDecimal[] subarray_as_BigDecimal(int start, int end)
as BigInteger[] public BigInteger[] subarray_as_BigInteger(int start, int end)
as char[] public char[] subarray_as_char(int start, int end)
as Character[] public Character[] subarray_as_Character(int start, int end)
as String[] public String[] subarray_as_String(int start, int end)
as Complex[] public Complex[] subarray_as_Complex(int start, int end)
as the moduli of Complex[] public double[] subarray_as_modulus_of_Complex(int start, int end)
as the real parts of Complex[] public double[] subarray_as_real_part_of_Complex(int start, int end)
as the imaginary parts of Complex[] public double[] subarray_as_imaginary_part_of_Complex(int start, int end)
as a Complex Row Matrix public ComplexMatrix subarray_as_Complex_rowMatrix(int start, int end)
as a Complex Column Matrix public ComplexMatrix subarray_as_Complex_columnMatrix(int start, int end)
as Phasor[] public Phasor[] subarray_as_Phasor(int start, int end)
as the magnitudes of Phasor[] public double[] subarray_as_magnitude_of_Phasor(int start, int end)
as the phase, in degrees, of Phasor[] public double[] subarray_as_degrees_phase_of_Phasor(int start, int end)
as the phase, in radians, of Phasor[] public double[] subarray_as_radians_phase_of_Phasor(int start, int end)
as a Phasor Row Matrix public PhasorMatrix subarray_as_Phasor_rowMatrix(int start, int end)
as a Phasor Column Matrix public PhasorMatrix subarray_as_Phasor_columnMatrix(int start, int end)
Return array maximum as double public double maximum()
public double maximum_as_double()
as Double public Double maximum_as_Double()
as float public float maximum_as_float()
as Float public Float maximum_as_Float()
as long public long maximum_as_long()
as Long public Long maximum_as_Long()
as int public int maximum_as_int()
as Integer public Integer maximum_as_Integer()
as short public short maximum_as_short()
as Short public Short maximum_as_Short()
as byte public byte maximum_as_byte()
as Byte public Byte maximum_as_Byte()
as BigDecimal public BigDecimal maximum_as_BigDecimal()
as BigInteger public BigInteger maximum_as_BigInteger()
as char public char maximum_as_char()
as Character public Character maximum_as_Characterr()
Return index of array maximum   public int maximumIndex()
Return array minimum as double public double minimum()
public double minimum_as_double()
as Double public Double minimum_as_Double()
as float public float minimum_as_float()
as Float public Float minimum_as_Float()
as long public long minimum_as_long()
as Long public Long minimum_as_Long()
as int public int minimum_as_int()
as Integer public Integer minimum_as_Integer()
as short public short minimum_as_short()
as Short public Short minimum_as_Short()
as byte public byte minimum_as_byte()
as Byte public Byte minimum_as_Byte()
as BigDecimal public BigDecimal minimum_as_BigDecimal()
as BigInteger public BigInteger minimum_as_BigInteger()
as char public char minimum_as_char()
as Character public Character minimum_as_Characterr()
Return index of array minimum   public int minimumIndex()
Addition of a constant addition of a double public ArrayMaths plus(double constant)
addition of a Double public ArrayMaths plus(Double constant)
addition of a float public ArrayMaths plus(float constant)
addition of a Float public ArrayMaths plus(Float constant)
addition of a long public ArrayMaths plus(long constant)
addition of a Long public ArrayMaths plus(Long constant)
addition of an int public ArrayMaths plus(int constant)
addition of an Integer public ArrayMaths plus(Integer constant)
addition of a short public ArrayMaths plus(short constant)
addition of a Short public ArrayMaths plus(Short constant)
addition of a byte public ArrayMaths plus(byte constant)
addition of a Byte public ArrayMaths plus(Byte constant)
addition of a BigDecimal public ArrayMaths plus(BigDecimal constant)
addition of a BigInteger public ArrayMaths plus(BigInteger constant)
addition of a Complex public ArrayMaths plus(Complex constant)
addition of a Phasor public ArrayMaths plus(Phasor constant)
addition of a char public ArrayMaths plus(char constant)
addition of a Character public ArrayMaths plus(Characterr constant)
addition of a String public ArrayMaths plus(String constant)
Addition of an array addition of an ArrayMaths public ArrayMaths plus(ArrayMaths arraym)
addition of a Stat public ArrayMaths plus(Stat stat)
addition of a Vector public ArrayMaths plus(Vector<Object> vec)
addition of an ArrayList public ArrayMaths plus(ArrayList<Object> list)
addition of a double[] public ArrayMaths plus(double[] array)
addition of a Double[] public ArrayMaths plus(Double[] array)
addition of a float[] public ArrayMaths plus(float[] array)
addition of a Float[] public ArrayMaths plus(Float[] array)
addition of a long[] public ArrayMaths plus(long[] array)
addition of a Long[] public ArrayMaths plus(Long[] array)
addition of an int[] public ArrayMaths plus(int[] array)
addition of an Integer[] public ArrayMaths plus(Integer[] array)
addition of a short[] public ArrayMaths plus(short[] array)
addition of a Short[] public ArrayMaths plus(Short[] array)
addition of a byte[] public ArrayMaths plus(byte[] array)
addition of a Byte[] public ArrayMaths plus(Byte[] array)
addition of a BigDecimal[] public ArrayMaths plus(BigDecimal[] array)
addition of a BigInteger[] public ArrayMaths plus(BigInteger[] array)
addition of a Complex[] public ArrayMaths plus(Complex[] array)
addition of a Phasor[] public ArrayMaths plus(Phasor[] array)
addition of a char[] public ArrayMaths plus(char[] array)
addition of a Character[] public ArrayMaths plus(Character[] array)
addition of a String[] public ArrayMaths plus(String[] array)
Subtraction of a constant subtraction of a double public ArrayMaths minus(double constant)
subtraction of a Double public ArrayMaths minus(Double constant)
subtraction of a float public ArrayMaths minus(float constant)
subtraction of a Float public ArrayMaths minus(Float constant)
subtraction of a long public ArrayMaths minus(long constant)
subtraction of a Long public ArrayMaths minus(Long constant)
subtraction of an int public ArrayMaths minus(int constant)
subtraction of an Integer public ArrayMaths minus(Integer constant)
subtraction of a short public ArrayMaths minus(short constant)
subtraction of a Short public ArrayMaths minus(Short constant)
subtraction of a byte public ArrayMaths minus(byte constant)
subtraction of a Byte public ArrayMaths minus(Byte constant)
subtraction of a BigDecimal public ArrayMaths minus(BigDecimal constant)
subtraction of a BigInteger public ArrayMaths minus(BigInteger constant)
subtraction of a Complex public ArrayMaths minus(Complex constant)
subtraction of a Phasor public ArrayMaths minus(Phasor constant)
Subtraction of an array subtraction of an ArrayMaths public ArrayMaths minus(ArrayMaths arraym)
subtraction of a Stat public ArrayMaths minus(Stat stat)
subtraction of a Vector public ArrayMaths minus(Vector<Object> vec)
subtraction of an ArrayList public ArrayMaths minus(ArrayList<Object> list)
subtraction of a double[] public ArrayMaths minus(double[] array)
subtraction of a Double[] public ArrayMaths minus(Double[] array)
subtraction of a float[] public ArrayMaths minus(float[] array)
subtraction of a Float[] public ArrayMaths minus(Float[] array)
subtraction of a long[] public ArrayMaths minus(long[] array)
subtraction of a Long[] public ArrayMaths minus(Long[] array)
subtraction of an int[] public ArrayMaths minus(int[] array)
subtraction of an Integer[] public ArrayMaths minus(Integer[] array)
subtraction of a short[] public ArrayMaths minus(short[] array)
subtraction of a Short[] public ArrayMaths minus(Short[] array)
subtraction of a byte[] public ArrayMaths minus(byte[] array)
subtraction of a Byte[] public ArrayMaths minus(Byte[] array)
subtraction of a BigDecimal[] public ArrayMaths minus(BigDecimal[] array)
subtraction of a BigInteger[] public ArrayMaths minus(BigInteger[] array)
subtraction of a Complex[] public ArrayMaths minus(Complex[] array)
subtraction of a Phasor[] public ArrayMaths minus(Phasor[] array)
Multiplication by a constant multiplication by a double public ArrayMaths times(double constant)
multiplication by a Double public ArrayMaths times(Double constant)
multiplication by a float public ArrayMaths times(float constant)
multiplication by a Float public ArrayMaths times(Float constant)
multiplication by a long public ArrayMaths times(long constant)
multiplication by a Long public ArrayMaths times(Long constant)
multiplication by an int public ArrayMaths times(int constant)
multiplication by an Integer public ArrayMaths times(Integer constant)
multiplication by a short public ArrayMaths times(short constant)
multiplication by a Short public ArrayMaths times(Short constant)
multiplication by a byte public ArrayMaths times(byte constant)
multiplication by a Byte public ArrayMaths times(Byte constant)
multiplication by a BigDecimal public ArrayMaths times(BigDecimal constant)
multiplication by a BigInteger public ArrayMaths times(BigInteger constant)
multiplication by a Complex public ArrayMaths times(Complex constant)
multiplication by a Phasor public ArrayMaths times(Phasor constant)
Division by a constant division by a double public ArrayMaths over(double constant)
division by a Double public ArrayMaths over(Double constant)
division by a float public ArrayMaths over(float constant)
division by a Float public ArrayMaths over(Float constant)
division by a long public ArrayMaths over(long constant)
division by a Long public ArrayMaths over(Long constant)
division by an int public ArrayMaths over(int constant)
division by an Integer public ArrayMaths over(Integer constant)
division by a short public ArrayMaths over(short constant)
division by a Short public ArrayMaths over(Short constant)
division by a byte public ArrayMaths over(byte constant)
division by a Byte public ArrayMaths over(Byte constant)
division by a BigDecimal public ArrayMaths over(BigDecimal constant)
division by a BigInteger public ArrayMaths over(BigInteger constant)
division by a Complex public ArrayMaths over(Complex constant)
division by a Phasor public ArrayMaths over(Phasor constant)
Sum of all elements as a double public double sum()
public double sum_as_double()
as a Double public Double sum_as_Double()
as a float public float sum_as_float()
as a Float public Float sum_as_Float()
as a long public long sum_as_long()
as a Long public Long sum_as_Long()
as an int public int sum_as_int()
as an Integer public Integer sum_as_Integer()
as a short public short sum_as_short()
as a Short public Short sum_as_Short()
as a byte public byte sum_as_byte()
as a Byte public Byte sum_as_Byte()
as a BigDecimal public BigDecimal sum_as_BigDecimal()
as a BigInteger public BigInteger sum_as_BigInteger()
as a Complex public Complex sum_as_Complex()
as a Phasor public Phasorsum_as_Phasor()
as a String[] public String sum_as_String()
Product of all elements as a double public double product()
public double product_as_double()
as a Double Double product_as_Double()
as a float public float product_as_float()
as a Float public Float product_as_Float()
as a long public long product_as_long()
as a Long public Long product_as_Long()
as an int public int product_as_int()
as an Integer public Integer product_as_Integer()
as a short public short product_as_short()
as a Short public Short product_as_Short()
as a byte public byte product_as_byte()
as a Byte public Byte product_as_Byte()
as a BigDecimal public BigDecimal product_as_BigDecimal()
as a BigInteger public BigInteger product_as_BigInteger()
as a Complex public Complex product_as_Complex()
as a Phasor public Phasorproduct_as_Phasor()
as a String[] public String product_as_String()
Truncate each array elements   public ArrayMaths truncate(int n)
Round each array elements to nearest integer   public ArrayMaths rint()
Round up each array elements   public ArrayMaths ceil()
Round down each array elements   public ArrayMaths floor()
Raise each array element to a power   public ArrayMaths pow(double n)
public ArrayMaths pow(float n)
public ArrayMaths pow(long n)
public ArrayMaths pow(int n)
public ArrayMaths pow(short n)
public ArrayMaths pow(byte n)
public ArrayMaths pow(Double n)
public ArrayMaths pow(Float n)
public ArrayMaths pow(Long n)
public ArrayMaths pow(Integer n)
public ArrayMaths pow(Short n)
public ArrayMaths pow(Byte n)
public ArrayMaths pow(BigDecimal n)
public ArrayMaths pow(BigInteger n)
Take the square root of each array element   public ArrayMaths sqrt()
Take the inverse of the square root of each array element   public ArrayMaths oneOverSqrt()
Take absolute value of each array element   public ArrayMaths abs()
Logarithms Take the natural log of each array element public ArrayMaths log()
Take the log to base 2 of each array element public ArrayMaths log2()
Take the log to base 10 of each array element public ArrayMaths log10()
Take the antilog to base 10 of each array element public ArrayMaths antilog10()
Take the x.log2(x) of each array element, x public ArrayMaths xLog2x()
Take the x.logE(x) of each array element, x public ArrayMaths xLogEx()
Take the x.log10(x) of each array element, x public ArrayMaths xLog10x()
Take the -x.log2(x) of each array element, x public ArrayMaths minusxLog2x()
Take the -x.logE(x) of each array element, x public ArrayMaths minusxLogEx()
Take the -x.log10(x) of each array element, x public ArrayMaths minusxLog10x()
Take the exponential of each array element   public ArrayMaths exp()
Invert each array element   public ArrayMaths invert()
Negate each array element   public ArrayMaths negate()
Sort the array arrange in ascending order public ArrayMaths sort()
public void sortEquals()
public ArrayMaths ascendingSort()
public void ascendingSortEquals()
arrange in descending order public ArrayMaths descendingSort()
public void descendingSortEquals()
arrange to a given order of indices public ArrayMaths sort(int[] indices)
public void sortEquals(int[] indices)
return original indices public int[] originalIndices()
Randomize the order of the array randomize public ArrayMaths randomize()
return original indices public int[] originalIndices()
Reverse order of elements of the array reverse array public ArrayMaths reverse()
return original indices public int[] originalIndices()
Check if all elements are, arithmetically, integers   public boolean isInteger()
Concatenation   public ArrayMaths concatenate(ArrayMaths xx)
public ArrayMaths concatenate(Stat xx)
public ArrayMaths concatenate(double[] xx)
public ArrayMaths concatenate(float[] xx)
public ArrayMaths concatenate(long[] xx)
public ArrayMaths concatenate(int[] xx)
public ArrayMaths concatenate(short[] xx)
public ArrayMaths concatenate(byte[] xx)
public ArrayMaths concatenate(char[] xx)
public ArrayMaths concatenate(Double[] xx)
public ArrayMaths concatenate(Float[] xx)
public ArrayMaths concatenate(Long[] xx)
public ArrayMaths concatenate(Integer[] xx)
public ArrayMaths concatenate(Short[] xx)
public ArrayMaths concatenate(Byte[] xx)
public ArrayMaths concatenate(Character[] xx)
public ArrayMaths concatenate(String[] xx)
public ArrayMaths concatenate(BigDecimal[] xx)
public ArrayMaths concatenate(BigInteger[] xx)
public ArrayMaths concatenate(Complex[] xx)
public ArrayMaths concatenate(Phasor[] xx)
Find first index of a value within an array   public int indexOf(double value)
public int indexOf(float value)
public int indexOf(long value)
public int indexOf(int value)
public int indexOf(short value)
public int indexOf(byte value)
public int indexOf(char value)
public int indexOf(Double value)
public int indexOf(Float value)
public int indexOf(Long value)
public int indexOf(Integer value)
public int indexOf(Short value)
public int indexOf(Byte value)
public int indexOf(Character value)
public int indexOf(String value)
public int indexOf(BigDecimal value)
public int indexOf(BigInteger value)
public int indexOf(Complex value)
public int indexOf(Phasor value)
Find all indices of a value within an array   public int[] indicesOf(double value)
public int[] indicesOf(float value)
public int[] indicesOf(long value)
public int[] indicesOf(int value)
public int[] indicesOf(short value)
public int[] indicesOf(byte value)
public int[] indicesOf(char value)
public int[] indicesOf(Double value)
public int[] indicesOf(Float value)
public int[] indicesOf(Long value)
public int[] indicesOf(Integer value)
public int[] indicesOf(Short value)
public int[] indicesOf(Byte value)
public int[] indicesOf(Character value)
public int[] indicesOf(String value)
public int[] indicesOf(BigDecimal value)
public int[] indicesOf(BigInteger value)
public int[] indicesOf(Complex value)
public int[] indicesOf(Phasor value)
Find ithe value of the element nearest to a given value   public double nearestValue(double value)
public float nearestValue(float value)
public long nearestValue(long value)
public int nearestValue(int value)
public short nearestValue(short value)
public byte nearestValue(byte value)
public char nearestValue(char value)
public Double nearestValue(Double value)
public Float nearestValue(Float value)
public Long nearestValue(Long value)
public Integer nearestValue(Integer value)
public Short nearestValue(Short value)
public Byte nearestValue(Byte value)
public Character nearestValue(Character value)
public BigDecimal nearestValue(BigDecimal value)
public BigInteger nearestValue(BigInteger value)
Find index of element nearest to a given value   public int nearestIndex(double value)
public int nearestIndex(float value)
public int nearestIndex(long value)
public int nearestIndex(int value)
public int nearestIndex(short value)
public int nearestIndex(byte value)
public int nearestIndex(char value)
public int nearestIndex(Double value)
public int nearestIndex(Float value)
public int nearestIndex(Long value)
public int nearestIndex(Integer value)
public int nearestIndex(Short value)
public int nearestIndex(Byte value)
public int nearestIndex(Character value)
public int nearestIndex(BigDecimal value)
public int nearestIndex(BigInteger value)
Maximum difference between the elelments (array range)   public double maximumDifference()
public double maximumDifference_as_double()
public float maximumDifference_as_float()
public long maximumDifference_as_long()
public int maximumDifference_as_int()
public short maximumDifference_as_short()
public byte maximumDifference_as_byte()
public Double maximumDifference_as_Double()
public Float maximumDifference_as_Float()
public Long maximumDifference_as_Long()
public Integer maximumDifference_as_Integer()
public Short maximumDifference_as_Short()
public Byte maximumDifference_as_Byte()
public BigDecimal maximumDifference_as_BigDecimal()
public BigInteger maximumDifference_as_BigInteger()
Minimum difference between the elelments   public double minimumDifference()
public double minimumDifference_as_double()
public float minimumDifference_as_float()
public long minimumDifference_as_long()
public int minimumDifference_as_int()
public short minimumDifference_as_short()
public byte minimumDifference_as_byte()
public Double minimumDifference_as_Double()
public Float minimumDifference_as_Float()
public Long minimumDifference_as_Long()
public Integer minimumDifference_as_Integer()
public Short minimumDifference_as_Short()
public Byte minimumDifference_as_Byte()
public BigDecimal minimumDifference_as_BigDecimal()
public BigInteger minimumDifference_as_BigInteger()
Print array to screen without line returns public void print()
with line returns public void println()
Plot array   public void plot(int n)




CONSTRUCTORS

public ArrayMaths(Vector<Object> array)
public ArrayMaths(ArrayList<Object> array)
public ArrayMaths(Stat array)
public ArrayMaths(Object[] array)
public ArrayMaths(double[] array)
public ArrayMaths(Double[] array)
public ArrayMaths(float[] array)
public ArrayMaths(Float[] array)
public ArrayMaths(long[] array)
public ArrayMaths(Long[] array)
public ArrayMaths(int[] array)
public ArrayMaths(Integer[] array)
public ArrayMaths(short[] array)
public ArrayMaths(Short[] array)
public ArrayMaths(byte[] array)
public ArrayMaths(Byte[] array)
public ArrayMaths(BigDecimal[] array)
public ArrayMaths(BigInteger[] array)
public ArrayMaths(Complex[] array)
public ArrayMaths(Phasor[] array)
public ArrayMaths(char[] array)
public ArrayMaths(Character[] array)
public ArrayMaths(String[] array)

Usage:                      ArrayMaths am = new ArrayMaths(aa);

ARRAY TYPE

public String arrayType()
Usage:                      String type = am.arrayType();
Returns the array type e.g. double[ ], as a String.

public String[] originalArrayType()
Usage:                      String[] types = am.originalArrayType();
Returns the array types of each element of an entered array in the order present in the entered array. Useful if the entered array was a mixed type Vector or ArrayList.

ARRAY LENGTH

public int length()
Usage:                      length = am.length();
Returns the array length.

DEEP COPY

public ArrayMaths copy()
Usage:                      ArrayMaths amcopy = am.copy();
Returns a deep copy of an instance of ArrayMaths; a deep copy of am, in the above usage example, is returned as amcopy.

CHECK IF THE ELEMENTS OF THE ARRAY ARE ALL, ARITHMETICALLY, INTEGERS

public boolean isInteger()
Usage:                      boolean test = am.isInteger();
Returns true if all elements of the array are, arithmetically, integers. Returns false if one or more element is not an integer. A conversion of String to double is attemped before checking for an integer value. Arrays of char or Character are treated as their Unicode integer equivalents and hence are integer.

'POSSIBLE LOSS OF PRECISION' MESSAGES

Suppress 'possible loss of precision' messages for an instance of ArrayMaths
public void suppressMessages()
Usage:                      am.suppressMessages();
Calling this method suppresses the displaying on screen of the 'possible loss of precision' messages that are normally displayed before a conversion in which such a loss may occur. This instance method applies only to the instance in which it is called (see below for a more global suppression).

Restore 'possible loss of precision' messages for an instance of ArrayMaths
public void restoreMessages()
Usage:                      am.restoreMessages();
Calling this method restores the displaying on screen of the 'possible loss of precision' messages that are normally displayed before a conversion in which such a loss may occur. This restoration applies only to the instance in which it is called and need only be called if the suppressMessages() method (immediately above) has previously been called and restoration is required. The default option of this class is to display such messages.

Suppress 'possible loss of precision' messages for all instances created within an application
public static void suppressMessagesTotal()
Usage:                      ArrayMaths.suppressMessagesTotal();
Calling this method suppresses the displaying on screen of the 'possible loss of precision' messages that are normally displayed before a conversion in which such a loss may occur. This static method suppresses such displays for all instances of ArrayMaths created in the application that calls this method (see immediately above for the corresponding instance method).

Restore 'possible loss of precision' messages for all instances created within an application
public static void restoreMessagesTotal()
Usage:                      ArrayMaths.restoreMessagesTotal();
Calling this method restores the displaying on screen of the 'possible loss of precision' messages that are normally displayed before a conversion in which such a loss may occur. This restoration applies to all instances of ArrayMaths created in the application that calls this method (see immediately above for the corresponding instance method). It need only be called if the suppressMessagesTotal() method (immediately above) has previously been called and restoration is required. The default option of this class is to display such messages.

RETURN THE INTERNAL ARRAY EITHER AS ENTERED OR AS A CONVERTED DATA TYPE

as double[]
public double[] array()
public double[] array_as_double()
as Vector<Object>
public Vector<Object> array_as_Vector()
as ArrayList<Object>
public ArrayList<Object> array_as_ArrayList()
as Object[]
public Object[] array_as_Object()
as a Row Matrix
public Matrix array_as_Matrix_rowMatrix()
as a Column Matrix
public Matrix array_as_Matrix_columnMatrix()
as Double[]
public Double[] array_as_Double()
as float[]
public float[] array_as_float()
as Float[]
public Float[] array_as_Float()
as long[]
public long[] array_as_long()
as Long[]
public long[] array_as_Long()
as int[]
public int[] array_as_int()
as Integer[]
public Integer[] array_as_Integer()
as short[]
public short[] array_as_short()
as Short[]
public Short[] array_as_Short()
as byte[]
public byte[] array_as_byte()
as Byte[]
public Byte[] array_as_Byte()
as BigDecimal[]
public BigDecimal[] array_as_BigDecimal()
as BigInteger[]
public BigInteger[] array_as_BigInteger()
as char[]
public char[] array_as_char()
as Character[]
public Character[] array_as_Character()
as String[]
public String[] array_as_String()
as Complex[]
public Complex[] array_as_Complex()
as the moduli of Complex[]
public double[] array_as_modulus_of_Complex()
as the imaginary parts of Complex[]
public double[] array_as_real_part_of_Complex()
as the imaginary parts of Complex[]
public double[] array_as_imaginary_part_of_Complex()
as a Complex Row Matrix
public ComplexMatrix array_as_Complex_rowMatrix()
as a Complex Column Matrix
public ComplexMatrix array_as_Complex_columnMatrix()
as Phasor[]
public Phasor[] array_as_Phasor()
as the magnitudes of Phasor[]
public double[] array_as_magnitude_of_Phasor()
as the phase, in degrees, of Phasor[]
public double[] array_as_degrees_phase_of_Phasor()
as the phase, in radians, of Phasor[]
public double[] array_as_radians_phase_of_Phasor()
as a Phasor Row Matrix
public PhasorMatrix array_as_Phasor_rowMatrix()
as a Phasor Column Matrix
public PhasorMatrix array_as_Phasor_columnMatrix()

General usage:                      array = am.array();                     [returning array as double[] only]
General usage:                      array = am.array_as_xxxxxx();



RETURN A SUB_ARRAY OF THE INTERNAL ARRAY

as double[]
public double[] subarray(int start, int end)
public double[] subarray_as_double(int start, int end)
as Vector<Object>
public Vector<Object> subarray_as_Vector(int start, int end)
as subarrayList<Object>
public subarrayList<Object> subarray_as_subarrayList(int start, int end)
as a Object[]
public Object[] subarray_as_Object(int start, int end)
as a Row Matrix
public Matrix subarray_as_Matrix_rowMatrix(int start, int end)
as a Column Matrix
public Matrix subarray_as_Matrix_columnMatrix(int start, int end)
as Double[]
public Double[] subarray_as_Double(int start, int end)
as float[]
public float[] subarray_as_float(int start, int end)
as Float[]
public Float[] subarray_as_Float(int start, int end)
as long[]
public long[] subarray_as_long(int start, int end)
as Long[]
public long[] subarray_as_Long(int start, int end)
as int[]
public int[] subarray_as_int(int start, int end)
as Integer[]
public Integer[] subarray_as_Integer(int start, int end)
as short[]
public short[] subarray_as_short(int start, int end)
as Short[]
public Short[] subarray_as_Short(int start, int end)
as byte[]
public byte[] subarray_as_byte(int start, int end)
as Byte[]
public Byte[] subarray_as_Byte(int start, int end)
as BigDecimal[]
public BigDecimal[] subarray_as_BigDecimal(int start, int end)
as BigInteger[]
public BigInteger[] subarray_as_BigInteger(int start, int end)
as char[]
public char[] subarray_as_char(int start, int end)
as Character[]
public Character[] subarray_as_Character(int start, int end)
as String[]
public String[] subarray_as_String(int start, int end)
as Complex[]
public Complex[] subarray_as_Complex(int start, int end)
as the moduli of Complex[]
public double[] subarray_as_modulus_of_Complex(int start, int end)
as the real parts of Complex[]
public double[] subarray_as_real_part_of_Complex(int start, int end)
as the imaginary parts of Complex[]
public double[] subarray_as_imaginary_part_of_Complex(int start, int end)
as a Complex Row Matrix
public ComplexMatrix subarray_as_Complex_rowMatrix(int start, int end)
as a Complex Column Matrix
public ComplexMatrix subarray_as_Complex_columnMatrix(int start, int end)
as Phasor[]
public Phasor[] subarray_as_Phasor(int start, int end)
as the magnitudes of Phasor[]
public double[] subarray_as_magnitude_of_Phasor(int start, int end)
as the phase, in degrees, of Phasor[]
public double[] subarray_as_degrees_phase_of_Phasor(int start, int end)
as the phase, in radians, of Phasor[]
public double[] subarray_as_radians_phase_of_Phasor(int start, int end)
as a Phasor Row Matrix
public PhasorMatrix subarray_as_Phasor_rowMatrix(int start, int end)
as a Phasor Column Matrix
public PhasorMatrix subarray_as_Phasor_columnMatrix(int start, int end)
General usage:                      array = am.subarray(start, end);                     [returning sub-array as double[] only]
General usage:                      array = am.subarray_as_xxxxxx(start, end);



RETURN THE MINIMUM VALUE OF THE ENTERED ARRAY

as double
public double minimum()
public double minimum_as_double()
as Double
public Double minimum_as_Double()
as float
public float minimum_as_float()
as Float
public Float minimum_as_Float()
as long
public long minimum_as_long()
as Long
public Long minimum_as_Long()
as int
public int minimum_as_int()
as Integer
public Integer minimum_as_Integer()
as short
public short minimum_as_short()
as Short
public Short minimum_as_Short()
as byte
public byte minimum_as_byte()
as Byte
public Byte minimum_as_Byte()
as BigDecimal
public BigDecimal minimum_as_BigDecimal()
as BigInteger
public BigInteger minimum_as_BigInteger()
as char
public char minimum_as_char()
as Character
public Character minimum_as_Character()

General usage:                      minimum = am.minimum();                     [returning minimum as double only]
General usage:                      minimum = am.minimum_as_xxxxxx();

RETURN THE INDEX OF THE MINIMUM VALUE OF THE ENTERED ARRAY

public int minimumIndex()
Usage:                      minimumIndex = am.minimumIndex();
Returns the index of the array element corresponding to the minimum value of the array. If more than one element contains this value the index of the first occurence in the array is returned.

RETURN THE MAXIMUM VALUE OF THE ENTERED ARRAY

as double
public double maximum()
public double maximum_as_double()
as Double
public Double maximum_as_Double()
as float
public float maximum_as_float()
as Float
public Float maximum_as_Float()
as long
public long maximum_as_long()
as Long
public Long maximum_as_Long()
as int
public int maximum_as_int()
as Integer
public Integer maximum_as_Integer()
as short
public short maximum_as_short()
as Short
public Short maximum_as_Short()
as byte
public byte maximum_as_byte()
as Byte
public Byte maximum_as_Byte()
as BigDecimal
public BigDecimal maximum_as_BigDecimal()
as BigInteger
public BigInteger maximum_as_BigInteger()
as char
public char maximum_as_char()
as Character
public Character maximum_as_Character()

General usage:                      maximum = am.maximum();                     [returning maximum as double only]
General usage:                      maximum = am.maximum_as_xxxxxx();

RETURN THE INDEX OF THE MAXIMUM VALUE OF THE ENTERED ARRAY

public int maximumIndex()
Usage:                      maximumIndex = am.maximumIndex();
Returns the index of the array element corresponding to the maximum value of the array. If more than one element contains this value the index of the first occurence in the array is returned.


ADDITION

Addition of a constant to each element of the internal array of an arrayMaths
addition of a double
public ArrayMaths plus(double constant)
addition of a Double
public ArrayMaths plus(Double constant)
addition of a float
public ArrayMaths plus(float constant)
addition of a Float
public ArrayMaths plus(Float constant)
addition of a long
public ArrayMaths plus(long constant)
addition of a Long
public ArrayMaths plus(Long constant)
addition of an int
public ArrayMaths plus(int constant)
addition of an Integer
public ArrayMaths plus(Integer constant)
addition of a short
public ArrayMaths plus(short constant)
addition of a Short
public ArrayMaths plus(Short constant)
addition of a byte
public ArrayMaths plus(byte constant)
addition of a Byte
public ArrayMaths plus(Byte constant)
addition of a BigDecimal
public ArrayMaths plus(BigDecimal constant)
addition of a BigInteger
public ArrayMaths plus(BigInteger constant)
addition of a Complex
public ArrayMaths plus(Complex constant)
addition of a Phasor
public ArrayMaths plus(Phasor constant)
addition of a char
public ArrayMaths plus(char constant)
addition of a Character
public ArrayMaths plus(Character constant)
addition of a String[]
public ArrayMaths plus(String array)

Usage:                      ArrayMaths sum = am.plus(constant);
Returns a new instance of ArrayMaths, sum, in which each element of the internal array is the sum of the corresponding element in am and the variable, constant.
The constant may be of the type
  double,   Double,   float,   Float,   long,   Long,   int,   Integer,   short,   Short,   byte,   Byte,   BigDecimal,   BigInteger,   Complex,   Phasor,   char,   Character  or  String.

The following table shows the type to which the two elements are converted before addition is performed and in which the sum is stored in the ArrayMaths internal array. The horizontal axis refers to the type of the argument, constant, and the vertical axis refers to the type of the elements in the instance, sum internal array. If an integer sum exceeeds the maximum value of long both elements are first converted to double. The array may be converted to other data types using the array_as_xxxxx() methods.

 Argument
constant
or array
double Double float Float long Long int Integer short Short byte Byte BigDecimal BigInteger Complex Phasor char Character String
Instance
array
                                       
double  double double double double double double double double double double double double BigDecimal BigDecimal Complex Phasor n/a n/a String
Double  double double double double double double double double double double double double BigDecimal BigDecimal Complex Phasor n/a n/a String
float  double double double double double double double double double double double double BigDecimal BigDecimal Complex Phasor n/a n/a String
Float  double double double double double double double double double double double double BigDecimal BigDecimal Complex Phasor n/a n/a String
long  double double double double long long long long long long long long BigDecimal BigInteger Complex Phasor n/a n/a String
Long  double double double double long long long long long long long long BigDecimal BigInteger Complex Phasor n/a n/a String
int  double double double double long long long long long long long long BigDecimal BigInteger Complex Phasor n/a n/a String
Integer  double double double double long long long long long long long long BigDecimal BigInteger Complex Phasor n/a n/a String
short  double double double double long long long long long long long long BigDecimal BigInteger Complex Phasor n/a n/a String
Short  double double double double long long long long long long long long BigDecimal BigInteger Complex Phasor n/a n/a String
byte  double double double double long long long long long long long long BigDecimal BigInteger Complex Phasor n/a n/a String
Byte  double double double double long long long long long long long long BigDecimal BigInteger Complex Phasor n/a n/a String
BigDecimal  BigDecimal BigDecimal BigDecimal BigDecimal BigDecimal BigDecimal BigDecimal BigDecimal BigDecimal BigDecimal BigDecimal BigDecimal BigDecimal BigDecimal Complex Phasor n/a n/a String
BigInteger  BigDecimal BigDecimal BigDecimal BigDecimal BigInteger BigInteger BigInteger BigInteger BigInteger BigInteger BigInteger BigInteger BigInteger BigInteger Complex Phasor n/a n/a String
Complex  Complex Complex Complex Complex Complex Complex Complex Complex Complex Complex Complex Complex Complex Complex Complex Complex n/a n/a String
Phasor  Phasor Phasor Phasor Phasor Phasor Phasor Phasor Phasor Phasor Phasor Phasor Phasor Phasor Phasor Phasor Phasor n/a n/a String
char  n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a String
Character  n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a String
String  String String String String String String String String String String String String String String String String String String String


Addition of an array to an ArrayMaths
addition of an ArrayMaths
public ArrayMaths plus(ArrayMaths arraym)
addition of a Stat
public ArrayMaths plus(Stat arrayst)
addition of a Vector
public ArrayMaths plus(Vector<Object> vec)
addition of an ArrayList
public ArrayMaths plus(ArrayList<Object> list)
a ddition of a double[]
public ArrayMaths plus(double[] array)
addition of a Double[]
public ArrayMaths plus(Double[] array)
addition of a float[]
public ArrayMaths plus(float[] array)
addition of a Float[]
public ArrayMaths plus(Float[] array)
addition of a long[]
public ArrayMaths plus(long[] array)
addition of a Long[]
public ArrayMaths plus(Long[] array)
addition of an int[]
public ArrayMaths plus(int[] array)
addition of an Integer[]
public ArrayMaths plus(Integer[] array)
addition of a short[]
public ArrayMaths plus(short[] array)
addition of a Short[]
public ArrayMaths plus(Short[] array)
addition of a byte[]
public ArrayMaths plus(byte[] array)
addition of a Byte[]
public ArrayMaths plus(Byte[] array)
addition of a BigDecimal[]
public ArrayMaths plus(BigDecimal[] array)
addition of a BigInteger[]
public ArrayMaths plus(BigInteger[] array)
addition of a Complex[]
public ArrayMaths plus(Complex[] array)
addition of a Phasor[]
public ArrayMaths plus(Phasor[] array)
addition of a char[]
public ArrayMaths plus(char[] array)
addition of a Character[]
public ArrayMaths plus(Character[] array)
addition of a String[]
public ArrayMaths plus(String[] array)

Usage:                      ArrayMaths sum = am.plus(array);
Returns a new instance of ArrayMaths, sum, in which each element of the internal array is the sum of the corresponding element in am and the corresponding element on the argument array, array. The argument array may be of the type
  double[],   Double[],   float[],   Float,   long[],   Long[],   int[],   Integer[],   short[],   Short[],   byte[],   Byte[],   BigDecimal[],   BigInteger[],   Complex[],   Phasor[],   char[],   Character[]   String[],   Vector<Object>,  ArrayList<Object> ,  Stat  or  another ArrayMaths.
Vector<Object>  and  ArrayList<Object> may contain mixed types.

See table in 'addition of a constant' above a list of the data types in which the sum of the idividual elements is returned. The array may be converted to other data types using the array_as_xxxxx() methods.


SUBTRACTION

Subtraction of a constant from each element of the internal array of an arrayMaths
subtraction of a double
public ArrayMaths minus(double constant)
subtraction of a Double
public ArrayMaths minus(Double constant)
subtraction of a float
public ArrayMaths minus(float constant)
subtraction of a Float
public ArrayMaths minus(Float constant)
subtraction of a long
public ArrayMaths minus(long constant)
subtraction of a Long
public ArrayMaths minus(Long constant)
subtraction of an int
public ArrayMaths minus(int constant)
subtraction of an Integer
public ArrayMaths minus(Integer constant)
subtraction of a short
public ArrayMaths minus(short constant)
subtraction of a Short
public ArrayMaths minus(Short constant)
subtraction of a byte
public ArrayMaths minus(byte constant)
subtraction of a Byte
public ArrayMaths minus(Byte constant)
subtraction of a BigDecimal
public ArrayMaths minus(BigDecimal constant)
subtraction of a BigInteger
public ArrayMaths minus(BigInteger constant)
subtraction of a Complex
public ArrayMaths minus(Complex constant)
subtraction of a Phasor
public ArrayMaths minus(Phasor constant)
subtraction of a char
public ArrayMaths minus(char constant)
subtraction of a Character
public ArrayMaths minus(Character constant)
subtraction of a String[]
public ArrayMaths minus(String array)

Usage:                      ArrayMaths difference = am.minus(constant);
Returns a new instance of ArrayMaths, difference, in which each element of the internal array is the corresponding element in am minus the variable, constant.
The constant may be of the type
  double,   Double,   float,   Float,   long,   Long,   int,   Integer,   short,   Short,   byte,   Byte,   BigDecimal,   BigInteger,   Complex  or  Phasor.

The following table shows the type to which the two elements are converted before subtraction, multiplication or division is performed and in which the result is stored in the ArrayMaths internal array. The horizontal axis refers to the type of the argument, constant, and the vertical axis refers to the type of the elements in the instance, sum internal array. If an integer sum exceeeds the maximum value of long both elements are first converted to double. The array may be converted to other data types using the array_as_xxxxx() methods.

 Argument
constant
or array
double Double float Float long Long int Integer short Short byte Byte BigDecimal BigInteger Complex Phasor char Character String
Instance
array
                                       
double  double double double double double double double double double double double double BigDecimal BigDecimal Complex Phasor n/a n/a n/a
Double  double double double double double double double double double double double double BigDecimal BigDecimal Complex Phasor n/a n/a n/a
float  double double double double double double double double double double double double BigDecimal BigDecimal Complex Phasor n/a n/a n/a
Float  double double double double double double double double double double double double BigDecimal BigDecimal Complex Phasor n/a n/a n/a
long  double double double double long long long long long long long long BigDecimal BigInteger Complex Phasor n/a n/a n/a
Long  double double double double long long long long long long long long BigDecimal BigInteger Complex Phasor n/a n/a n/a
int  double double double double long long long long long long long long BigDecimal BigInteger Complex Phasor n/a n/a n/a
Integer  double double double double long long long long long long long long BigDecimal BigInteger Complex Phasor n/a n/a n/a
short  double double double double long long long long long long long long BigDecimal BigInteger Complex Phasor n/a n/a n/a
Short  double double double double long long long long long long long long BigDecimal BigInteger Complex Phasor n/a n/a n/a
byte  double double double double long long long long long long long long BigDecimal BigInteger Complex Phasor n/a n/a n/a
Byte  double double double double long long long long long long long long BigDecimal BigInteger Complex Phasor n/a n/a n/a
BigDecimal  BigDecimal BigDecimal BigDecimal BigDecimal BigDecimal BigDecimal BigDecimal BigDecimal BigDecimal BigDecimal BigDecimal BigDecimal BigDecimal BigDecimal Complex Phasor n/a n/a n/a
BigInteger  BigDecimal BigDecimal BigDecimal BigDecimal BigInteger BigInteger BigInteger BigInteger BigInteger BigInteger BigInteger BigInteger BigInteger BigInteger Complex Phasor n/a n/a n/a
Complex  Complex Complex Complex Complex Complex Complex Complex Complex Complex Complex Complex Complex Complex Complex Complex Complex n/a n/a n/a
Phasor  Phasor Phasor Phasor Phasor Phasor Phasor Phasor Phasor Phasor Phasor Phasor Phasor Phasor Phasor Phasor Phasor n/a n/a n/a
char  n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a
Character  n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a
String  n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a


Subtraction of an array from an ArrayMaths
subtraction of an ArrayMaths
public ArrayMaths minus(ArrayMaths arraym)
subtraction of a Stat
public ArrayMaths minus(Stat arrayst)
subtractionof a Vector
public ArrayMaths minus(Vector<Object> vec)
subtraction of an ArrayList
public ArrayMaths minus(ArrayList<Object> list)
subtraction of a double[]
public ArrayMaths minus(double[] array)
subtraction of a Double[]
public ArrayMaths minus(Double[] array)
subtraction of a float[]
public ArrayMaths minus(float[] array)
subtraction of a Float[]
public ArrayMaths minus(Float[] array)
subtraction of a long[]
public ArrayMaths minus(long[] array)
subtraction of a Long[]
public ArrayMaths minus(Long[] array)
subtraction of an int[]
public ArrayMaths minus(int[] array)
subtraction of an Integer[]
public ArrayMaths minus(Integer[] array)
subtraction of a short[]
public ArrayMaths minus(short[] array)
subtraction of a Short[]
public ArrayMaths minus(Short[] array)
subtraction of a byte[]
public ArrayMaths minus(byte[] array)
subtraction of a Byte[]
public ArrayMaths minus(Byte[] array)
subtraction of a BigDecimal[]
public ArrayMaths minus(BigDecimal[] array)
subtraction of a BigInteger[]
public ArrayMaths minus(BigInteger[] array)
subtraction of a Complex[]
public ArrayMaths minus(Complex[] array)
subtraction of a Phasor[]
public ArrayMaths minus(Phasor[] array)
subtraction of a char[]
public ArrayMaths minus(char[] array)
subtraction of a Character[]
public ArrayMaths minus(Character[] array)
subtraction of a String[]
public ArrayMaths minus(String[] array)

Usage:                      ArrayMaths difference = am.minus(array);
Returns a new instance of ArrayMaths, difference, in which each element of the internal array is the corresponding element in am minus the corresponding element on the argument array, array. The argument array may be of the type
  double[],   Double[],   float[],   Float,   long[],   Long[],   int[],   Integer[],   short[],   Short[],   byte[],   Byte[],   BigDecimal[],   BigInteger[],   Complex[]  or  Phasor[],   char[],   Character[]   String[],   Vector<Object>,   ArrayList<Object>,  Stat  or  another ArrayMaths.
Vector<Object>  and  ArrayList<Object> may contain mixed types.

See table in 'subtraction of a constant' above for a list of the data types to which the variables involved in the subtraction are converted before the subtraction and in which the result is stored in the ArrayMaths internal array. The array may be converted to other data types using the array_as_xxxxx() methods.


MULTIPLICATION

Multiplication of each element of the internal array of an arrayMaths by a constant
multiplication by a double
public ArrayMaths times(double constant)
multiplication by a Double
public ArrayMaths times(Double constant)
multiplication by a float
public ArrayMaths times(float constant)
multiplication by a Float
public ArrayMaths times(Float constant)
multiplication by a long
public ArrayMaths times(long constant)
multiplication by a Long
public ArrayMaths times(Long constant)
multiplication by an int
public ArrayMaths times(int constant)
multiplication by an Integer
public ArrayMaths times(Integer constant)
multiplication by a short
public ArrayMaths times(short constant)
multiplication by a Short
public ArrayMaths times(Short constant)
multiplication by a byte
public ArrayMaths times(byte constant)
multiplication by a Byte
public ArrayMaths times(Byte constant)
multiplication by a BigDecimal
public ArrayMaths times(BigDecimal constant)
multiplication by a BigInteger
public ArrayMaths times(BigInteger constant)
multiplication by a Complex
public ArrayMaths times(Complex constant)
multiplication by a Phasor
public ArrayMaths times(Phasor constant)
multiplication by a char
public ArrayMaths times(char constant)
multiplication by a Character
public ArrayMaths times(Character constant)
multiplication by a String[]
public ArrayMaths times(String array)

Usage:                      ArrayMaths product = am.times(constant);
Returns a new instance of ArrayMaths, product, in which each element of the internal array is the corresponding element in am times the variable, constant.
The constant may be of the type
  double,   Double,   float,   Float,   long,   Long,   int,   Integer,   short,   Short,   byte,   Byte,   BigDecimal,   BigInteger,   Complex  or  Phasor.

See table in 'subtraction of a constant' above for a list of the data types to which the variables involved in the multiplication are converted before the multiplication and in which the result is stored in the ArrayMaths internal array. The array may be converted to other data types using the array_as_xxxxx() methods. The array may be converted to other data types using the array_as_xxxxx() methods.


DIVISION

Division of each element of the internal array of an arrayMaths by a constant
division by a double
public ArrayMaths over(double constant)
division by a Double
public ArrayMaths over(Double constant)
division by a float
public ArrayMaths over(float constant)
division by a Float
public ArrayMaths over(Float constant)
division by a long
public ArrayMaths over(long constant)
division by a Long
public ArrayMaths over(Long constant)
division by an int
public ArrayMaths over(int constant)
division by an Integer
public ArrayMaths over(Integer constant)
division by a short
public ArrayMaths over(short constant)
division by a Short
public ArrayMaths over(Short constant)
division by a byte
public ArrayMaths over(byte constant)
division by a Byte
public ArrayMaths over(Byte constant)
division by a BigDecimal
public ArrayMaths over(BigDecimal constant)
division by a BigInteger
public ArrayMaths over(BigInteger constant)
division by a Complex
public ArrayMaths over(Complex constant)
division by a Phasor
public ArrayMaths over(Phasor constant)
division by a char
public ArrayMaths over(char constant)
division by a Character
public ArrayMaths over(Character constant)
division by a String[]
public ArrayMaths over(String array)

Usage:                      ArrayMaths result = am.over(constant);
Returns a new instance of ArrayMaths, result, in which each element of the internal array is the corresponding element in am divided by the variable, constant.
The constant may be of the type
  double,   Double,   float,   Float,   long,   Long,   int,   Integer,   short,   Short,   byte,   Byte,   BigDecimal,   BigInteger,   Complex  or  Phasor.

See table in 'subtraction of a constant' above for a list of the data types to which the variables involved in the division are converted before the division and in which the result is stored in the ArrayMaths internal array. The array may be converted to other data types using the array_as_xxxxx() methods. The array may be converted to other data types using the array_as_xxxxx() methods.


TRUNCATE EACH ELEMENT IN THE ARRAY

public ArrayMaths truncate(int n)
Usage:                      ArrayMaths truncArray = am.truncate(n);
Returns an ArrayMaths, truncArray, in which each double, Double, float, Float, BigDecimal, Complex and Phasor element of the internal array is the corresponding element in the internal array of ArrayMaths, am, truncated to n decimal places. All other element types are returned unchanged.


ROUND EACH ELEMENT IN THE ARRAY TO THE NEAREST INTEGER

public ArrayMaths rint()
Usage:                      ArrayMaths roundedArray = am.rint();
Returns an ArrayMaths, roundedArray, in which each double, Double, float, Float, BigDecimal, Complex and Phasor element of the internal array is the corresponding element in the internal array of ArrayMaths, am, rounded to the nearest integer. All other element types are returned unchanged.


ROUND DOWN EACH ELEMENT IN THE ARRAY

public ArrayMaths floor()
Usage:                      ArrayMaths roundDownArray = am.floor();
Returns an ArrayMaths, roundDownArray, in which each double, Double, float, Float, BigDecimal, Complex and Phasor element of the internal array is the corresponding element in the internal array of ArrayMaths, am, rounded down to the next lower integer. All other element types are returned unchanged.


ROUND UP EACH ELEMENT IN THE ARRAY

public ArrayMaths ceil()
Usage:                      ArrayMaths roundUpArray = am.ceil();
Returns an ArrayMaths, roundUpArray, in which each double, Double, float, Float, BigDecimal, Complex and Phasor element of the internal array is the corresponding element in the internal array of ArrayMaths, am, rounded up to the next higher integer. All other element types are returned unchanged.


NATURAL LOG OF EACH ELEMENT IN THE ARRAY

public ArrayMaths log()
Usage:                      ArrayMaths arrayln = am.log();
Returns an ArrayMaths, arrayln, in which each element of the internal array is the natural log of the corresponding element in the internal array of ArrayMaths, am BigDecimal, BigInteger and all integer types are first converted to Double before this calculation.


LOG TO BASE 2 OF EACH ELEMENT IN THE ARRAY

public ArrayMaths log2()
Usage:                      ArrayMaths arraylog = am.log2();
Returns an ArrayMaths, arraylog, in which each element of the internal array is the log to base 2 of the corresponding element in the internal array of ArrayMaths, am. BigDecimal, BigInteger and all integer types are first converted to Double before this calculation.


LOG TO BASE 10 OF EACH ELEMENT IN THE ARRAY

public ArrayMaths log10()
Usage:                      ArrayMaths arraylog = am.log10();
Returns an ArrayMaths, arraylog, in which each element of the internal array is the log to base 10 of the corresponding element in the internal array of ArrayMaths, am. BigDecimal, BigInteger and all integer types are first converted to Double before this calculation.


ANTILOG TO BASE 10 OF EACH ELEMENT IN THE ARRAY

public ArrayMaths antilog10()
Usage:                      ArrayMaths arrayal = am.antilog10();
Returns an ArrayMaths, arrayal, in which each element of the internal array is the antilog to base 10 of the corresponding element in the internal array of ArrayMaths, am. BigDecimal, BigInteger and all integer types are first converted to Double before this calculation.


ELEMENT TIMES THE LOG TO BASE 2 OF EACH ELEMENT IN THE ARRAY

public ArrayMaths xLog2x()
Usage:                      ArrayMaths arrayxlogx = am.xLog2x();
Returns an ArrayMaths, arrayxlogx, in which each element of the internal array is the corresponding element multiplied by the log to base 2, i.e. x.log2(x), of the corresponding element, x, in the internal array of ArrayMaths, am. BigDecimal, BigInteger and all integer types are first converted to Double before this calculation.


ELEMENT TIMES THE NATURAL LOG OF EACH ELEMENT IN THE ARRAY

public ArrayMaths xLogEx()
Usage:                      ArrayMaths arrayxlogx = am.xLog2x();
Returns an ArrayMaths, arrayxlogx, in which each element of the internal array is the corresponding element multiplied by the natural log, i.e. x.loge(x), of the corresponding element, x, in the internal array of ArrayMaths, am. BigDecimal, BigInteger and all integer types are first converted to Double before this calculation.


ELEMENT TIMES THE LOG TO BASE 10 OF EACH ELEMENT IN THE ARRAY

public ArrayMaths xLog10x()
Usage:                      ArrayMaths arrayxlogx = am.xLog10x();
Returns an ArrayMaths, arrayxlogx, in which each element of the internal array is the corresponding element multiplied by the log to base 10, i.e. x.log10(x), of the corresponding element, x, in the internal array of ArrayMaths, am. BigDecimal, BigInteger and all integer types are first converted to Double before this calculation.


MINUS EACH ELEMENT TIMES THE LOG TO BASE 2 OF EACH ELEMENT IN THE ARRAY

public ArrayMaths minusxLog2x()
Usage:                      ArrayMaths arraymxlogx = am.minusxLog2x();
Returns an ArrayMaths, arraymxlogx, in which each element of the internal array is the corresponding element multiplied by minus the log to base 2, i.e. -x.log2(x), of the corresponding element, x, in the internal array of ArrayMaths, am. BigDecimal, BigInteger and all integer types are first converted to Double before this calculation.
See Stats for Shannon Entropy method.


MINUS EACH ELEMENT TIMES THE NATURAL LOG OF EACH ELEMENT IN THE ARRAY

public ArrayMaths minusxLogEx()
Usage:                      ArrayMaths arraymxlogx = am.minusxLog2x();
Returns an ArrayMaths, arraymxlogx, in which each element of the internal array is the corresponding element multiplied by minus the natural log, i.e. -x.loge(x), of the corresponding element, x, of the corresponding element in the internal array of ArrayMaths, am. BigDecimal, BigInteger and all integer types are first converted to Double before this calculation.
See Stats for Shannon Entropy method.


MINUS EACH ELEMENT TIMES THE LOG TO BASE 10 OF EACH ELEMENT IN THE ARRAY

public ArrayMaths minusxLog10x()
Usage:                      ArrayMaths arraymxlogx = am.minusxLog10x();
Returns an ArrayMaths, arraymxlogx, in which each element of the internal array is the corresponding element multiplied by minus the log to base 10, i.e. -x.log10(x), of the corresponding element, x, in the internal array of ArrayMaths, am. BigDecimal, BigInteger and all integer types are first converted to Double before this calculation.
See Stats for Shannon Entropy method.


EXPONENTIAL OF EACH ELEMENT IN THE ARRAY

public ArrayMaths exp()
Usage:                      ArrayMaths arrayexp = am.exp();
Returns an ArrayMaths, arrayexp, in which each element of the internal array is the exponential of the corresponding element in the internal array of ArrayMaths, am. BigDecimal, BigInteger and all integer types are first converted to Double before this calculation.


ABSOLUTE VALUE OF EACH ELEMENT IN THE ARRAY

public ArrayMaths abs()
Usage:                      ArrayMaths arrayabs = am.abs();
Returns an ArrayMaths, arrayabs, in which each element of the internal array is the absolute values of the corresponding element in the internal array of ArrayMaths, am.


SQUARE ROOT OF EACH ELEMENT IN THE ARRAY

public ArrayMaths sqrt()
Usage:                      ArrayMaths arraysqrt = am.sqrt();
Returns an ArrayMaths, arraysqrt, in which each element of the internal array is the square root of the corresponding element in the internal array of ArrayMaths, am. BigDecimal, BigInteger and all integer types are first converted to Double before this calculation.


INVERSE OF THE SQUARE ROOT OF EACH ELEMENT IN THE ARRAY

public ArrayMaths oneOverSqrt()
Usage:                      ArrayMaths arrayinversesqrt = am.oneOverSqrt();
Returns an ArrayMaths, arrayinversesqrt, in which each element of the internal array is the inverse of the square root of the corresponding element in the internal array of ArrayMaths, am. BigDecimal, BigInteger and all integer types are first converted to Double before this calculation.


EACH ELEMENT IN THE ARRAY RAISED TO A POWER

public ArrayMaths pow(double n)
public ArrayMaths pow(float n)
public ArrayMaths pow(int n)
public ArrayMaths pow(short n)
public ArrayMaths pow(byte n)
public ArrayMaths pow(Double n)
public ArrayMaths pow(Float n)
public ArrayMaths pow(Integer n)
public ArrayMaths pow(Short n)
public ArrayMaths pow(Byte n)
public ArrayMaths pow(BigDecimal n)
public ArrayMaths pow(BigInteger n)
Usage:                      ArrayMaths arraypow = am.pow(n);
Returns an ArrayMaths, arraypow, in which each element of the internal array is the corresponding element in the internal array of ArrayMaths, am raised to the power n. The power n may be one of the following data types:

  double,   Double,   float,   Float,   long,   Long,   int,   Integer,   short,   Short,   byte,   Byte,   BigDecimal  or  BigInteger.

Data types type, long, int, short, byte or their wrapped equivalents are converted to double before calculation. If the power n is an integet type, i.e. long, int, short, byte, their wrapped equivalents or BigInteger; BigDecimal and BigInteger are not converted to another data type but if n is not an integer; BigDecimal and BigInteger are first converted to double. Complex and Phasor are processed as Complex and Phasor respectively


INVERT EACH ELEMENT IN THE ARRAY

public ArrayMaths invert()
Usage:                      ArrayMaths arrayinv = am.inv();
Returns an ArrayMaths, arrayinv, in which each element of the internal array is the inverse, 1.0/aai, of the corresponding element, aai, in the internal array of ArrayMaths, am. Data types long, int, short, byte or their wrapped equivalents are converted to double before calculation. BigInteger is converted to BigDecimal before calculation.


NEGATE EACH ELEMENT IN THE ARRAY

public ArrayMaths negate()
Usage:                      ArrayMaths arrayneg = am.negate();
Returns an ArrayMaths, arrayneg, in which each element of the internal array is the inverse, -aai, of the corresponding element, aai, in the internal array of ArrayMaths, am.


SORT THE ELEMENT IN THE ARRAY

Sort into ascending order
public ArrayMaths sort()
public void sortEquals()
public ArrayMaths ascendingSort()
public void ascendingSortEquals()
Usage:                      ArrayMaths arraysorted = am.sort();
Returns an ArrayMaths, arraysorted, in which the elements of the internal array of the ArrayMaths, am, are rearranged in ascending order. Phasor and Complex are ordered as their absolute values but retained as their Complex and Phasor forms respectively. Characters and char are ordered as their Unicode integer equivalents. Strings are alphabetically ordered (A to Z).
The method ascendingSort() performs the same function as sort().

Usage:                      am.sortEquals();
Rearranges the elements of the internal array of the ArrayMaths, am, to an array of ascending order. Phasor and Complex are ordered as their absolute values but retained as their Complex and Phasor forms respectively. Characters and char are ordered as their Unicode integer equivalents. Strings are alphabetically ordered (A to Z).
The method ascendingSortEquals() performs the same function as sortEquals().

Sort into descending order
public ArrayMaths descendingSort()
public void descendingSortEquals()
Usage:                      ArrayMaths arraysorted = am.descendingSort();
Returns an ArrayMaths, arraysorted, in which the elements of the internal array of the ArrayMaths, am, are rearranged in descending order. Phasor and Complex are ordered as their absolute values but retained as their Complex and Phasor forms respectively. Characters and char are ordered as their Unicode integer equivalents. Strings are alphabetically ordered (Z to A).

Usage:                      am.descendingSortEquals();
Rearranges the elements of the internal array of the ArrayMaths, am, to an array of descending order. Phasor and Complex are ordered as their absolute values but retained as their Complex and Phasor forms respectively. Characters and char are ordered as their Unicode integer equivalents. Strings are alphabetically ordered (Z to A).

Sort to a given order of indices
public ArrayMaths sort(int[] indices)
public void sortEquals(int[] indices)
Usage:                      ArrayMaths arraysorted = am.sort(indices);
Returns an ArrayMaths, arraysorted, in which the elements of the internal array of the ArrayMaths, am, are rearranged to match the order of indices supplied as the int array argument indices.

Usage:                      am.sortEquals(indices);
Rearranges the elements of the internal array of the ArrayMaths, am, to match the order of indices supplied as the int array argument indices.

Return the original indices of the sorted array
public int[] originalIndices()
Usage:                      int[] indices = arraysorted.originalIndices();
Returns an int array, indices, of the original indices, i.e. the unsorted array indices, of the elements now in the internal sorted array in the ArrayMaths, arraysorted.


RANDOMIZE THE ELEMENT IN THE ARRAY

Randomize the order of the elements in the array
public ArrayMaths randomize()
Usage:                      ArrayMaths arrayrandomized = am.randomize();
Returns an ArrayMaths, arrayrandomized, in which the elements of the internal array of the ArrayMaths, am, are randomized. Uses PsRandom uniqueIntegerArray method to obtain a random sequence of array indices.
The method randomise() performs the same function as the method randomize().

Return the original indices of the randomized array
public int[] originalIndices()
Usage:                      int[] indices = arrayrandomized.originalIndices();
Returns an int array, indices, of the original indices, i.e. the unrandomized array indices, of the elements now in the internal randomized array in the ArrayMaths, arrayrandomized.


REVERSE THE ORDER OF THE ELEMENT IN THE ARRAY

public ArrayMaths reverse()
Usage:                      ArrayMaths arrayrev = am.reverse();
Returns an ArrayMaths, arrayrev, in which the order of the elements of the internal array is the reverse of the corresponding internal array of ArrayMaths, am.

Return the original indices of the reversed array
public int[] originalIndices()
Usage:                      int[] indices = arrayrev.originalIndices();
Returns an int array, indices, of the original indices, i.e. the unreversed array indices, of the elements now in the internal reversed array in the ArrayMaths, arrayrev.


SUM OF ALL THE ELEMENTS IN THE ARRAY

as a double
public double sum()
public double sum_as_double()
as a Double
Double sum_as_Double()
as a float
public float sum_as_float()
as a Float
public Float sum_as_Float()
as a long
public long sum_as_long()
as a Long
public Long sum_as_Long()
as an int
public int sum_as_int()
as an Integer
public Integer sum_as_Integer()
as a short
public short sum_as_short()
as a Short
public Short sum_as_Short()
as a byte
public byte sum_as_byte()
as a Byte
public Byte sum_as_Byte()
as a BigDecimal
public BigDecimal sum_as_BigDecimal()
as a BigInteger
public BigInteger sum_as_BigInteger()
as a Complex
public Complex sum_as_Complex()
as a Phasor
public Phasorsum_as_Phasor()
as a String[]
public String sum_as_String()

General usage:                      sum = am.sum();                     [returning sum as double only]
General usage:                      sum = am.sum_as_xxxxxx();

Returns as sum, the sum of all the elements in the internal array of the ArrayMaths, am.
.
where aai are the elements of the internal array of am. The sum is returned either as the data type in which it was entered, or if the _xxxxxx part of the method name does not correspond to the entered data type, it is returned as the data type corresponding to xxxxxx. See Return array, above, for comments on such conversions. The sum may be returned as one of the following types:

  double,   Double,   float,   Float,   long,   Long,   int,   Integer,   short,   Short,   byte,   Byte,   BigDecimal,   BigInteger,   Complex,   Phasor  or  String.

An exception will be thrown if the sum is too large to be returned as the type chosen, with the exception of BigInteger. On summation array types, with the exception of BigInteger, are converted to one of greater range if the sum is about to exceed the maximum value of the data type.


PRODUCT OF ALL THE ELEMENTS IN THE ARRAY

as a double
public double product()
public double product_as_double()
as a Double
Double product_as_Double()
as a float
public float product_as_float()
as a Float
public Float product_as_Float()
as a long
public long product_as_long()
as a Long
public Long product_as_Long()
as an int
public int product_as_int()
as an Integer
public Integer product_as_Integer()
as a short
public short product_as_short()
as a Short
public Short product_as_Short()
as a byte
public byte product_as_byte()
as a Byte
public Byte product_as_Byte()
as a BigDecimal
public BigDecimal product_as_BigDecimal()
as a BigInteger
public BigInteger product_as_BigInteger()
as a Complex
public Complex product_as_Complex()
as a Phasor
public Phasorproduct_as_Phasor()
as a String[]
public String product_as_String()

General usage:                      product = am.product();                     [returning product as double only]
General usage:                      product = am.product_as_xxxxxx();

Returns as product, the product of all the elements in the internal array of the ArrayMaths, am.
.
where aai are the elements of the internal array of am. The product is returned either as the data type in which it was entered, or if the _xxxxxx part of the method name does not correspond to the entered data type, it is returned as the data type corresponding to xxxxxx. See Return array, above, for comments on such conversions. The product may be returned as one of the following types:

  double,   Double,   float,   Float,   long,   Long,   int,   Integer,   short,   Short,   byte,   Byte,   BigDecimal,   BigInteger,   Complex,   Phasor  or  String.

An exception will be thrown if the product is too large to be returned as the type chosen, with the exception of BigInteger. On multiplication array types, with the exception of BigInteger, are converted to one of greater range if the sum is about to exceed the maximum value of the data type.


CONCATENATION

public ArrayMaths concatenate(ArrayMaths xx)
public ArrayMaths concatenate(Stat xx)
public ArrayMaths concatenate(double[] xx)
public ArrayMaths concatenate(float[] xx)
public ArrayMaths concatenate(long[] xx)
public ArrayMaths concatenate(int[] xx)
public ArrayMaths concatenate(short[] xx)
public ArrayMaths concatenate(byte[] xx)
public ArrayMaths concatenate(char[] xx)
public ArrayMaths concatenate(Double[] xx)
public ArrayMaths concatenate(Float[] xx)
public ArrayMaths concatenate(Long[] xx)
public ArrayMaths concatenate(Integer[] xx)
public ArrayMaths concatenate(Short[] xx)
public ArrayMaths concatenate(Byte[] xx)
public ArrayMaths concatenate(Character[] xx)
public ArrayMaths concatenate(String[] xx)
public ArrayMaths concatenate(BigDecimal[] xx)
public ArrayMaths concatenate(BigInteger[] xx)
public ArrayMaths concatenate(Complex[] xx)
public ArrayMaths concatenate(Phasor[] xx)
Usage:                      ArrayMaths arrayconc = am.concatenate(xx);
Returns an ArrayMaths, arrayconc, whose internal array is the concatenation of the internal array of the ArrayMaths, am and the array xx or the internal array of xx if xx is an ArrayMaths. The arrays are concatenated with the am array first and the xx array last. On concatenation of arrays of different types a data type conversion is made that ensures all elements are within range and which either ensures no loss of precision or minimises any loss of precision if a no loss conversion is not possible. Use arrayType to check the type of the concatenated array.
The argument xx may be one of the following types:
  ArrayMaths,   Stat,   double[],   Double[],   float[],   Float[],   long[],   Long[],   int[],   Integer[],   short[],   Short[],   byte[],   Byte, [],   char[],   Character[],   String[],   Complex[],   Phasor[],   BigDecimal[]  or  BigInteger[].




FIND THE FIRST INDEX OF A VALUE WITHIN AN ARRAY

public int indexOf(double value)
public int indexOf(float value)
public int indexOf(long value)
public int indexOf(int value)
public int indexOf(short value)
public int indexOf(byte value)
public int indexOf(char value)
public int indexOf(Double value)
public int indexOf(Float value)
public int indexOf(Long value)
public int indexOf(Integer value)
public int indexOf(Short value)
public int indexOf(Byte value)
public int indexOf(Character value)
public int indexOf(String value)
public int indexOf(BigDecimal value)
public int indexOf(BigInteger value)
public int indexOf(Complex value)
public int indexOf(Phasor value)
Usage:                      int index = am.indexOf(value);
Returns the index of the first element in the internal array of the ArrayMaths, am, that is equal to the value value. -1 is returned if no element equal to value is found. The elements of array within am and the value, value, must be of the same type which may be any of the following:
  double,   Double,   float,   Float,   long,   Long,   int,   Integer,   short,   Short,   byte,   Byte, ,   char,   Character,   String,   Complex,   Phasor,   BigDecimal  or  BigInteger.




FIND THE ALL INDICES OF A VALUE WITHIN AN ARRAY

public int[] indicesOf(double value)
public int[] indicesOf(float value)
public int[] indicesOf(long value)
public int[] indicesOf(int value)
public int[] indicesOf(short value)
public int[] indicesOf(byte value)
public int[] indicesOf(char value)
public int[] indicesOf(Double value)
public int[] indicesOf(Float value)
public int[] indicesOf(Long value)
public int[] indicesOf(Integer value)
public int[] indicesOf(Short value)
public int[] indicesOf(Byte value)
public int[] indicesOf(Character value)
public int[] indicesOf(String value)
public int[] indicesOf(BigDecimal value)
public int[] indicesOf(BigInteger value)
public int[] indicesOf(Complex value)
public int[] indicesOf(Phasor value)
Usage:                      int[] indices = am.indicesOf(value);
Returns the indices of all of the elements in the internal array of the ArrayMaths, am, that are equal to the value value. null is returned if no element equal to value is found. The elements of array within am and the value, value, must be of the same type which may be any of the following:
  double,   Double,   float,   Float,   long,   Long,   int,   Integer,   short,   Short,   byte,   Byte, ,   char,   Character,   String,   Complex,   Phasor,   BigDecimal  or  BigInteger.


FIND THE INDEX OF THE FIRST OCCURENCE OF THE ELEMENT NEAREST A GIVEN VALUE

public int nearestIndex(double value)
public int nearestIndex(float value)
public int nearestIndex(long value)
public int nearestIndex(int value)
public int nearestIndex(short value)
public int nearestIndex(byte value)
public int nearestIndex(char value)
public int nearestIndex(Double value)
public int nearestIndex(Float value)
public int nearestIndex(Long value)
public int nearestIndex(Integer value)
public int nearestIndex(Short value)
public int nearestIndex(Byte value)
public int nearestIndex(Character value)
public int nearestIndex(BigDecimal value)
public int nearestIndex(BigInteger value)
Usage:                      int index = am.nearestIndex(value);
Returns the index of the first element in the internal array of the ArrayMaths, am, that is nearest to the value value. The index of an identical value is returned if an identical value is found. The elements of array within am and the value, value, must be of the same type which may be any of the following:
  double,   Double,   float,   Float,   long,   Long,   int,   Integer,   short,   Short,   byte,   Byte, ,   char,   Character,   BigDecimal  or  BigInteger.
Character and char are treated as their Unicode integer equivalent.


FIND THE VALUE OF THE ELEMENT NEAREST A GIVEN VALUE

public double nearestValue(double value)
public float nearestValue(float value)
public long nearestValue(long value)
public int nearestValue(int value)
public short nearestValue(short value)
public byte nearestValue(byte value)
public char nearestValue(char value)
public Double nearestValue(Double value)
public Float nearestValue(Float value)
public Long nearestValue(Long value)
public Integer nearestValue(Integer value)
public Short nearestValue(Short value)
public Byte nearestValue(Byte value)
public Character nearestValue(Character value)
public BigDecimal nearestValue(BigDecimal value)
public BigInteger nearestValue(BigInteger value)
Usage:                      int index = am.nearestValue(value);
Returns the value of the element in the internal array of the ArrayMaths, am, that is nearest to the value value. The value of an identical element is returned if an identical element is found. The elements of array within am and the value, value, must be of the same type which may be any of the following:
  double,   Double,   float,   Float,   long,   Long,   int,   Integer,   short,   Short,   byte,   Byte,   char,   Character,   BigDecimal  or  BigInteger.
Character and char are treated as their Unicode integer equivalent, though the Character or char value is returned.


FIND THE MAXIMUM DIFFERENCE BETWEEN THE ELEMENTS (THE RANGE)

public double maximumDifference()
public double maximumDifference_as_double()
public float maximumDifference_as_float()
public long maximumDifference_as_long()
public int maximumDifference_as_int()
public short maximumDifference_as_short()
public byte maximumDifference_as_byte()
public Double maximumDifference_as_Double()
public Float maximumDifference_as_Float()
public Long maximumDifference_as_Long()
public Integer maximumDifference_as_Integer()
public Short maximumDifference_as_Short()
public Byte maximumDifference_as_Byte()
public BigDecimal maximumDifference_as_BigDecimal()
public BigInteger maximumDifference_as_BigInteger()
Usage:                      maxDiff = am.maximumDifference();                     [returning maximum difference as double only]
Usage:                      maxDiff = am.maximumDifference_as_xxxx();
Returns the maximum difference between the elements of the internal array of the ArrayMaths, am, i.e. the range of the array. The maximum difference may be obtained as one of the following types where _xxxx indicates the matching type:   double,   Double,   float,   Float,   long,   Long,   int,   Integer,   short,   Short,   byte,   Byte,   BigDecimal  or  BigInteger.


FIND THE MINIMUM DIFFERENCE BETWEEN THE ELEMENTS

public double minimumDifference()
public double minimumDifference_as_double()
public float minimumDifference_as_float()
public long minimumDifference_as_long()
public int minimumDifference_as_int()
public short minimumDifference_as_short()
public byte minimumDifference_as_byte()
public Double minimumDifference_as_Double()
public Float minimumDifference_as_Float()
public Long minimumDifference_as_Long()
public Integer minimumDifference_as_Integer()
public Short minimumDifference_as_Short()
public Byte minimumDifference_as_Byte()
public BigDecimal minimumDifference_as_BigDecimal()
public BigInteger minimumDifference_as_BigInteger()
Usage:                      minDiff = am.minimumDifference();                     [returning minimum difference as double only]
Usage:                      minDiff = am.minimumDifference_as_xxxx();
Returns the minimum difference between the elements of the internal array of the ArrayMaths, am. The minimum difference may be obtained as one of the following types where _xxxx indicates the matching type:   double,   Double,   float,   Float,   long,   Long,   int,   Integer,   short,   Short,   byte,   Byte,   BigDecimal  or  BigInteger.


PRINT THE ARRAY TO SCREEN

Print without line returns
public void print()
Usage:                      am.print();
Prints the the internal array of the ArrayMaths, am to the screen. Each element of the array is followed by a space. The last element to be written is followed by a line return.

Print with line returns
public void println()
Usage:                      am.println();
Prints the the internal array of the ArrayMaths, am to the screen. Each element of the array is followed by a line return.


PLOT THE ARRAY

public void plot(int n)
Usage:                      am.plot(n);
Plots the values of the elements of the internal array in am against their indices. The plot is displayed in a window. The value of the argument n determines the way the points are linked:
See PlotGraph for a plotting methods allowing much greater control over the graph.


STATISTIC ANALYSIS OF THE ARRAY

ArrayMaths is a superclass for the statistical methods class, Stat.
Stat instance methods are available for the following:
  • Fit array to one of several statistical distributions:
    • Gaussian Distribution
    • Log-normal Distribution (two parameter statistic)
    • Log-normal Distribution (three parameter statistic)
    • Logistic Distribution
    • Lorentzian Distribution
    • Type 1 Extreme Distribution - Two Parameter Gumbel minimum order statistic
    • Type 1 Extreme Distribution - Two Parameter Gumbel maximum order statistic
    • Type 2 Extreme Distribution - Three Parameter Frechet
    • Type 3 Extreme Distribution - Three Parameter Weibull
    • Type 3 Extreme Distribution - Two Parameter Exponential Distribution
    • Type 3 Extreme Distribution - Rayleigh Distribution
    • Three Parameter Pareto Distribution
    • Beta Distribution on the interval [min, max]
    • Three Parameter Gamma Distribution
    • Erlang Distribution
See also Regression for a more comprehensive list of disrtibution fitting methods.



OTHER CLASSES USED BY THIS CLASS

This class uses the following classes in this library:


PERMISSION TO USE

Permission to use, copy and modify this software and its documentation for NON-COMMERCIAL purposes is granted, without fee, provided that an acknowledgement to the author, Dr Michael Thomas Flanagan at www.ee.ucl.ac.uk/~mflanaga, appears in all copies and associated documentation or publications.

Public listing of the source codes on the internet is not permitted.

Redistribution of the source codes or of the flanagan.jar file is not permitted.

Redistribution in binary form of all or parts of these classes is not permitted.

Dr Michael Thomas Flanagan makes no representations about the suitability or fitness of the software for any or for a particular purpose. Dr Michael Thomas Flanagan shall not be liable for any damages suffered as a result of using, modifying or distributing this software or its derivatives.



This page was prepared by Dr Michael Thomas Flanagan