Class JxnRealArrayAlgebra
- java.lang.Object
-
- JxnRealArrayAlgebra
-
- All Implemented Interfaces:
JxnCloneableAlgebra
public class JxnRealArrayAlgebra extends Object implements JxnCloneableAlgebra
Implementation of an algebra based on an internal arraydouble[] value. Most of the methods perform element-wise operations on the array elements. Supports mixed operations withdoubleandJxnComplexAlgebra.
Call one of theplotmethods to visualize the array values as acurvein aPlotFrame.
Use classJxnRealArrayTextFileDataSourceto read data values from text files.
-
-
Field Summary
Fields Modifier and Type Field Description protected static doubleequalityToleranceTolerance forequalsmethod.protected static booleanignoreSurplusdouble[]valueInternal storage.
-
Constructor Summary
Constructors Modifier Constructor Description protectedJxnRealArrayAlgebra()JxnRealArrayAlgebra(double[] value)Creates aJxnRealArrayAlgebrainstance from the arrayvalue.JxnRealArrayAlgebra(double[] value, boolean copyInput)Creates aJxnRealArrayAlgebrainstance from the arraydouble [] value.JxnRealArrayAlgebra(double start, double end, double step)Creates an instance from the given parameters.JxnRealArrayAlgebra(double start, double step, int length)Creates an instance from the given parameters.JxnRealArrayAlgebra(double uvmin, double uvStep, int nuvSteps, int nvuSteps, int ni)Deprecated.replaced by classJxnUVGrid.protectedJxnRealArrayAlgebra(int length)JxnRealArrayAlgebra(int[] value)Creates aJxnRealArrayAlgebrainstance from the arrayint[] value.JxnRealArrayAlgebra(JxnRealArrayAlgebra ra)Creates a copy ofra.JxnRealArrayAlgebra(JxnRealArrayAlgebra ra, boolean transfer)Creates a copy ofra.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static JxnRealArrayAlgebraabs(JxnRealArrayAlgebra ra)CallsMath.abs(double)for each element of the internal array ofra.static JxnRealArrayAlgebraabs(JxnRealArrayAlgebra x, JxnRealArrayAlgebra y)static JxnRealArrayAlgebraacos(JxnRealArrayAlgebra ra)CallsMath.acos(double)for each element of the internal array ofra.static JxnRealArrayAlgebraacosD(JxnRealArrayAlgebra ra)CallsMath.acos(double)and converts the result from radians to degrees for each element of the internal array ofra.static JxnRealArrayAlgebraacosh(JxnRealArrayAlgebra ra)CallsJxnUtilities.acosh(double)for each element of the internal array ofra.JxnRealArrayAlgebraadd(double d)Addsdto this.static JxnRealArrayAlgebraadd(double d, JxnRealArrayAlgebra ra)Returnsd + ra.JxnComplexArrayAlgebraadd(JxnComplexAlgebra cx)Addscxto this.JxnRealArrayAlgebraadd(JxnRealArrayAlgebra ra)Addsrato this.static JxnRealArrayAlgebraasin(JxnRealArrayAlgebra ra)CallsMath.asin(double)for each element of the internal array ofra.static JxnRealArrayAlgebraasinD(JxnRealArrayAlgebra ra)CallsMath.asin(double)and converts the result from radians to degrees for each element of the internal array ofra.static JxnRealArrayAlgebraasinh(JxnRealArrayAlgebra ra)CallsJxnUtilities.asinh(double)for each element of the internal array ofra.static JxnRealArrayAlgebraatan(JxnRealArrayAlgebra ra)CallsMath.atan(double)for each element of the internal array ofra.static JxnRealArrayAlgebraatan2(JxnRealArrayAlgebra y, JxnRealArrayAlgebra x)static JxnRealArrayAlgebraatan2D(JxnRealArrayAlgebra y, JxnRealArrayAlgebra x)CallsMath.atan2(yi,xi)and converts the result from radians to degrees for each pair of elements of the internal arrays ofyandx.static JxnRealArrayAlgebraatanD(JxnRealArrayAlgebra ra)CallsMath.atan(double)and converts the result from radians to degrees for each element of the internal array ofra.static JxnRealArrayAlgebraatanh(JxnRealArrayAlgebra ra)CallsJxnUtilities.atanh(double)for each element of the internal array ofra.JxnRealArrayAlgebraby(int[] index)Same asbyIndex(int[]).JxnRealArrayAlgebrabyIndex(int[] index)Returns a newJxnRealArrayAlgebracontaining the values of this instance at the positions given inindex.static JxnRealArrayAlgebracbrt(JxnRealArrayAlgebra ra)CallsMath.cbrt(double)for each element of the internal array ofra.static JxnRealArrayAlgebraceil(JxnRealArrayAlgebra ra)CallsMath.ceil(double)for each element of the internal array ofra.static JxnRealArrayAlgebraclip(JxnRealArrayAlgebra ra, double lower, double upper)Returns a newJxnRealArrayAlgebracontaining the elements of the internal array ofralimitted tolowerandupper.static JxnRealArrayAlgebraclip(JxnRealArrayAlgebra ra, int[] iClip)static JxnRealArrayAlgebraclip(JxnRealArrayAlgebra ra1, JxnRealArrayAlgebra ra2)Returns a newJxnRealArrayAlgebracontaining the elements of the internal array ofra1with elements replaced byDouble.NaNif the respective element inra2is invalid (NaN or Infinity).static JxnRealArrayAlgebraclipGE(JxnRealArrayAlgebra ra, double maxValue)Returns a newJxnRealArrayAlgebracontaining the elements of the internal array ofrawith elementsvalue[i] >= maxValuereplaced byDouble.NaN.static JxnRealArrayAlgebraclipGT(JxnRealArrayAlgebra ra, double maxValue)Returns a newJxnRealArrayAlgebracontaining the elements of the internal array ofrawith elementsvalue[i] > maxValuereplaced byDouble.NaN.static JxnRealArrayAlgebraclipLE(JxnRealArrayAlgebra ra, double minValue)Returns a newJxnRealArrayAlgebracontaining the elements of the internal array ofrawith elementsvalue[i] <= minValuereplaced byDouble.NaN.static JxnRealArrayAlgebraclipLT(JxnRealArrayAlgebra ra, double minValue)Returns a newJxnRealArrayAlgebracontaining the elements of the internal array ofrawith elementsvalue[i] < minValuereplaced byDouble.NaN.JxnCloneableAlgebracloneThis()Called internally.static JxnRealArrayAlgebraconcat(JxnRealArrayAlgebra ra1, JxnRealArrayAlgebra ra2)Returns a newJxnRealArrayAlgebrawhich is the concatenation of the elements ofra1followed byra2.static JxnRealArrayAlgebraconvolution(JxnRealArrayAlgebra ra, JxnRealArrayAlgebra filter)Returnsconvolution( ra, filter, 1 ).static JxnRealArrayAlgebraconvolution(JxnRealArrayAlgebra ra, JxnRealArrayAlgebra filter, int mode)Returns the convolution ofrawithfilter.static JxnRealArrayAlgebracopySign(JxnRealArrayAlgebra x, JxnRealArrayAlgebra y)static doublecorXY(JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry)Returns the correlation coefficient ofrxandry.static JxnRealArrayAlgebracos(JxnRealArrayAlgebra ra)CallsMath.cos(double)for each element of the internal array ofra.static JxnRealArrayAlgebracosD(JxnRealArrayAlgebra ra)CallsMath.cos(double)for each element of the internal array ofraafter converting the argument from degrees to radians.static JxnRealArrayAlgebracosh(JxnRealArrayAlgebra ra)CallsMath.cosh(double)for each element of the internal array ofra.static JxnRealArrayCurvecurve(JxnRealArrayAlgebra ry, Color color)Returns a curve representation ofry( xi = i, yi = ry.value[i] ).static JxnRealArrayCurvecurve(JxnRealArrayAlgebra ry, Color color, int lineType)Seecurve.static JxnRealArrayCurvecurve(JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry, Color color)Returns a curve representation ofrxandry( xi = rx.value[i], yi = ry.value[i] ).static JxnRealArrayCurvecurve(JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry, Color color, int lineType)Seecurve.static JxnRealArrayCurvecurve(JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry, JxnRealArrayAlgebra rz, IKmg3DProjection p3d)static JxnRealArrayCurvecurve(JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry, JxnRealArrayAlgebra rz, IKmg3DProjection p3d, Color color)static JxnRealArrayCurvecurve(JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry, JxnRealArrayAlgebra rz, IKmg3DProjection p3d, Color color, int lineType)Only used for anaglyph stereo.static int[]cut(JxnRealArrayAlgebra ra)Returns an int array of the indicesiof values ofrawith:value[i] > 0..static int[]cut(JxnRealArrayAlgebra ra, double min, double max)Returns an int array of the indicesiof values ofrawith:min <= value[i] <= max.static int[]cut(JxnRealArrayAlgebra ra, int[] index)Analyzes the values ofraonly with indices given in arrayindexand returns an int array of the indicesiof values with:value[i] > 0..static JxnRealArrayAlgebraderivative(JxnRealArrayAlgebra y)Returnsderivative( y, 1. ).static JxnRealArrayAlgebraderivative(JxnRealArrayAlgebra y, double dt)Returns the derivativedy/dtfor equidistant step sizedt.static JxnRealArrayAlgebraderivative(JxnRealArrayAlgebra y, JxnRealArrayAlgebra t)Returns the derivativedy/dtfor the elements of the internal arrays ofyandt.JxnRealArrayAlgebradiv(double d)Divides this byd.static JxnRealArrayAlgebradiv(double d, JxnRealArrayAlgebra ra)Returnsd / ra.JxnComplexArrayAlgebradiv(JxnComplexAlgebra cx)Divides this bycx.JxnRealArrayAlgebradiv(JxnRealArrayAlgebra ra)Divides this byra.static JxnRealArrayAlgebraenergy(JxnRealArrayAlgebra p, double h)Returns the integral of a power curve (with e.g.booleanequals(Object other)JxnRealArrayAlgebraobjects are equal, if all corresponding array elements are equal.static JxnRealArrayAlgebraexp(JxnRealArrayAlgebra ra)CallsMath.exp(double)for each element of the internal array ofra.static JxnRealArrayAlgebraexpm1(JxnRealArrayAlgebra ra)CallsMath.expm1(double)for each element of the internal array ofra.static JxnRealArrayAlgebrafaltung(JxnRealArrayAlgebra ra, JxnRealArrayAlgebra filter)Deprecated.static JxnRealArrayAlgebrafaltung(JxnRealArrayAlgebra ra, JxnRealArrayAlgebra filter, int iRand)Deprecated.double[]findValue(double value)Findsvaluein the internal array.static double[]findValue(JxnRealArrayAlgebra ra, double value)Same asra.findValue(double value).static JxnRealArrayAlgebrafloor(JxnRealArrayAlgebra ra)CallsMath.floor(double)for each element of the internal array ofra.static JxnRealArrayAlgebragaussFilter(JxnRealArrayAlgebra t, double bandWidth)ReturnsgaussFilter( t, bandWidth, 3. ).static JxnRealArrayAlgebragaussFilter(JxnRealArrayAlgebra t, double bandWidth, double filterWidth)Creates a gaussFilter forconvolution.doubleget(double x)Returns a value for positionxby linear interpolation between the adjacent elements of the internal array of thisJxnRealArrayAlgebra.double[]get(double[] da)Returns an array of values at the positions given indaby linear interpolation between the adjacent elements of the internal array of thisJxnRealArrayAlgebrausingget(double x).doubleget(int i)Returns the value of thei-th element of the internal array of thisJxnRealArrayAlgebra.double[]get(int[] ia)Returns an array of the values of the elements of the internal array of thisJxnRealArrayAlgebradefined by the indices given inia.JxnRealArrayAlgebraget(JxnRealArrayAlgebra ra)Returns aJxnRealArrayAlgebraof values at the positions given inraby linear interpolation between the adjacent elements of the internal array of thisJxnRealArrayAlgebrausingget(double[]).static JxnRealArrayAlgebragetCalendarField(JxnRealArrayAlgebra ra, int field)Returns the result ofgc.get( field )withgc = newGregorianCalendar()for the values of the internal array ofrainterpreted as decimal seconds since 01-Jan-1970 00:00:00 UTC.static intgetCntInvalid(JxnRealArrayAlgebra ra)Returns the number of invalid (NaNorInfinitive) values inra.static intgetCntNaN(JxnRealArrayAlgebra ra)Returns the number ofNaNvalues inra.static intgetCntValid(JxnRealArrayAlgebra ra)Returns the number of valid (neitherNaNnorInfinitive) values inra.static JxnRealArrayAlgebragetDayOfWeek(JxnRealArrayAlgebra ra)Returns the day of week ( Mo: 1, ...static doublegetEqualityTolerance()Returns the tolerance used for theequalsmethod.static booleangetIgnoreSurplus()ReturnsignoreSurplus.double[]getValue()Returns a reference to the internal array of thisJxnRealArrayAlgebra.doublegetValue(double x)Returnsget(x).double[]getValue(double[] da)Returnsget(da).doublegetValue(int i)Deprecated.Useget(i).static doublegetValue(JxnRealArrayAlgebra ra, double x)static double[]getValue(JxnRealArrayAlgebra ra, double[] da)static doublegetValue(JxnRealArrayAlgebra ra, int i)Returns the value of thei-th element of the internal array ofra.static JxnRealArrayAlgebrahypot(JxnRealArrayAlgebra x, JxnRealArrayAlgebra y)static JxnRealArrayAlgebraIEEEremainder(double d, JxnRealArrayAlgebra y)static JxnRealArrayAlgebraIEEEremainder(JxnRealArrayAlgebra x, double d)static JxnRealArrayAlgebraIEEEremainder(JxnRealArrayAlgebra x, JxnRealArrayAlgebra y)static JxnRealArrayAlgebraintegral(JxnRealArrayAlgebra y)Returnsintegral( y, 1. ).static JxnRealArrayAlgebraintegral(JxnRealArrayAlgebra y, double dt)Returns the integral ∫y dtfor equidistant step sizedt.static JxnRealArrayAlgebraintegral(JxnRealArrayAlgebra y, JxnRealArrayAlgebra t)Returns the integral ∫y dtfor the elements of the internal arrays ofyandt.JxnRealArrayAlgebrainv()Replaces this by its reciprocal.static int[]invalid(JxnRealArrayAlgebra ra)Returns an int array of the indices of values ofrawith invalid (NaNorInfinitive) values.static doublekorXY(JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry)ReturnscorXY( rx, ry ).static intlength(JxnRealArrayAlgebra ra)Returns the length of the internal array ofra.static JxnRealArrayAlgebralimit(JxnRealArrayAlgebra ra, double lower, double upper)Returns a newJxnRealArrayAlgebracontaining the elements of the internal array ofralimitted tolowerandupper.static JxnRealArrayAlgebralog(double b, JxnRealArrayAlgebra ra)Determines the baseblogarithm of each element of the internal array ofra.static JxnRealArrayAlgebralog(JxnRealArrayAlgebra ra)CallsMath.log(double)for each element of the internal array ofra.static JxnRealArrayAlgebralog10(JxnRealArrayAlgebra ra)CallsMath.log10(double)for each element of the internal array ofra.static JxnRealArrayAlgebralog1p(JxnRealArrayAlgebra ra)CallsMath.log1p(double)for each element of the internal array ofra.static JxnRealArrayAlgebramax(double d, JxnRealArrayAlgebra y)Deprecated.Usemax( y, d ).static JxnRealArrayAlgebramax(JxnRealArrayAlgebra x, double d)static JxnRealArrayAlgebramax(JxnRealArrayAlgebra x, JxnRealArrayAlgebra y)static intmaxIndex(JxnRealArrayAlgebra ra)Returns the index of the (first) maximum value (including +Infinity) of the internal array ofra.static doublemaxValid(JxnRealArrayAlgebra ra)Returns the minimum value excluding +Infinity of the internal array ofra.static doublemaxValue(JxnRealArrayAlgebra ra)Returns the maximum value (including +Infinity) of the internal array ofra.static JxnRealArrayAlgebramin(double d, JxnRealArrayAlgebra y)Deprecated.Usemin( y, d ).static JxnRealArrayAlgebramin(JxnRealArrayAlgebra x, double d)static JxnRealArrayAlgebramin(JxnRealArrayAlgebra x, JxnRealArrayAlgebra y)static intminIndex(JxnRealArrayAlgebra ra)Returns the index of the (first) minimum value (including -Infinity) of the internal array ofra.static doubleminValid(JxnRealArrayAlgebra ra)Returns the minimum value excluding -Infinity of the internal array ofra.static doubleminValue(JxnRealArrayAlgebra ra)Returns the minimum value (including -Infinity) of the internal array ofra.static JxnRealArrayAlgebramodulo(double d, JxnRealArrayAlgebra y)static JxnRealArrayAlgebramodulo(JxnRealArrayAlgebra x, double d)static JxnRealArrayAlgebramodulo(JxnRealArrayAlgebra x, JxnRealArrayAlgebra y)JxnRealArrayAlgebramul(boolean sw)Deprecated....static JxnRealArrayAlgebramul(boolean sw, JxnRealArrayAlgebra z)Deprecated....JxnRealArrayAlgebramul(double d)(Post)Multiplies this byd.static JxnRealArrayAlgebramul(double d, JxnRealArrayAlgebra ra)Returnsd * ra.JxnComplexArrayAlgebramul(JxnComplexAlgebra cx)(Post)Multiplies this bycx.JxnRealArrayAlgebramul(JxnRealArrayAlgebra ra)(Post)Multiplies this byra.JxnRealArrayAlgebramulL(double d)(Pre)Multiplies this byd.static JxnRealArrayAlgebranoise(int n)Returns a newJxnRealArrayAlgebrawithnrandom numbers fromrnd.nextGaussian()withrnd = newRandom().static JxnRealArrayAlgebranoise(int n, long seed)Returns a newJxnRealArrayAlgebrawithnrandom numbers fromrnd.nextGaussian()withrnd = newRandom(seed).static JxnRealArrayAlgebranoise(JxnRealArrayAlgebra ra)Returnsnoise(int n)withn = ra.size().static JxnRealArrayAlgebranoise(JxnRealArrayAlgebra ra, long seed)Returnsnoise(int n, long seed)withn = ra.size().static JxnRealArrayAlgebranonWindupStore(JxnRealArrayAlgebra p, double h, double initial, double lower, double upper)Returns the integral internally limited tolowerandupper(non windup limiter) of a power curve.static JxnRealArrayAlgebrapeak(JxnRealArrayAlgebra p, double h)Determines the peak energy from a power curvep.static JxnRealArrayPlotFrameplot(JxnRealArrayAlgebra ry)Creates a newJxnRealArrayPlotFrameand visualizes the values ofryas a curve:
xi = i, yi = ry.value[i], i = 0 ... y.length - 1.static JxnRealArrayPlotFrameplot(JxnRealArrayAlgebra ry, double ymin, double ymax)Deprecated.static JxnRealArrayPlotFrameplot(JxnRealArrayAlgebra ry, Color color, int lineType)Seeplot.static JxnRealArrayPlotFrameplot(JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry)Creates a newJxnRealArrayPlotFrameand visualizes the values ofrxandryas a curve:
xi = rx.value[i], yi = ry.value[i], i = 0 ... min( length(rx), length(ry) ) - 1.static JxnRealArrayPlotFrameplot(JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry, double vyx)Seeplot.static JxnRealArrayPlotFrameplot(JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry, double ymin, double ymax)Deprecated.static JxnRealArrayPlotFrameplot(JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry, int logScales)Seeplot.static JxnRealArrayPlotFrameplot(JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry, Color color)Seeplot.static JxnRealArrayPlotFrameplot(JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry, Color color, float lineWidth)Seeplot.static JxnRealArrayPlotFrameplot(JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry, Color color, int lineType)Seeplot.static JxnRealArrayPlotFrameplot(JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry, Color color, int lineType, double vyx)Seeplot.static JxnRealArrayPlotFrameplot(JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry, Color color, int lineType, float lineWidth, double vyx)Seeplot.static JxnRealArrayPlotFrameplot(JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry, Color color, int lineType, float lineWidth, int logScales)Seeplot.static JxnRealArrayPlotFrameplot(JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry, Color color, int lineType, int logScales)Seeplot.static JxnRealArrayPlotFrameplot(JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry, Color color, Stroke stroke)Seeplot.static JxnRealArrayPlotFrameplot(JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry, Color color, Stroke stroke, double vyx)Seeplot.static JxnRealArrayPlotFrameplot(JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry, Color color, Stroke stroke, int logScales)Seeplot.static JxnRealArrayPlotFrameplot(JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry1, JxnRealArrayAlgebra ry2)static JxnRealArrayPlotFrameplot(JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry1, JxnRealArrayAlgebra ry2, double ymin, double ymax)Deprecated.static JxnRealArrayPlotFrameplot(JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry, JxnRealArrayAlgebra rz, IKmg3DProjection p3d)static JxnRealArrayPlotFrameplot(JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry1, JxnRealArrayAlgebra ry2, JxnRealArrayAlgebra ry3)static JxnRealArrayPlotFrameplot(JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry1, JxnRealArrayAlgebra ry2, JxnRealArrayAlgebra ry3, double ymin, double ymax)Deprecated.JxnRealArrayAlgebrapow(double exponent)Replaces this by its power ofexponent.static JxnRealArrayAlgebrapow(double d, JxnRealArrayAlgebra exponent)Returnsdto the power ofexponent.JxnRealArrayAlgebrapow(JxnRealArrayAlgebra exponent)Replaces this by its power ofexponent.static doublequadsum(JxnRealArrayAlgebra ra)Returns the sum of the squares of all elements of the internal array ofra.static JxnRealArrayAlgebrarandom(int n)static JxnRealArrayAlgebrarandom(int n, long seed)Returns a newJxnRealArrayAlgebrawithnrandom numbers fromrnd.nextDouble()withrnd = newRandom(seed).static JxnRealArrayAlgebrarandom(JxnRealArrayAlgebra ra)Returnsrandom(int n)withn = ra.size().static JxnRealArrayAlgebrarandom(JxnRealArrayAlgebra ra, long seed)Returnsrandom(int n, long seed)withn = ra.size().JxnRealArrayAlgebrarange()JxnRealArrayAlgebrarange(double start)Callsrange(int)withstartrounded to int.JxnRealArrayAlgebrarange(double start, double end)JxnRealArrayAlgebrarange(int iStart)Returns a newJxnRealArrayAlgebracontaininglength(ra)-iStartvalues starting from indexiStart.JxnRealArrayAlgebrarange(int iStart, int iEnd)Returns a newJxnRealArrayAlgebracontainingiEnd-iStartvalues starting from indexiStartto indexiEnd(excluding).JxnRealArrayAlgebrarange(String start)Returns a newJxnRealArrayAlgebracontaining the values of this starting fromstartgiven as date time string.JxnRealArrayAlgebrarange(String start, String end)Returns a newJxnRealArrayAlgebracontaining the values of this starting fromstarttoendgiven as date time string.JxnRealArrayAlgebrarange(JxnRealArrayAlgebra ra)Deprecated.No more supported.JxnRealArrayAlgebraremainder(double d)Replaces this bythis % d.static JxnRealArrayAlgebraremainder(double d, JxnRealArrayAlgebra ra)Returnsd % ra.JxnRealArrayAlgebraremainder(JxnRealArrayAlgebra ra)Replaces this bythis % ra.static JxnRealArrayAlgebrareverse(JxnRealArrayAlgebra ra)Returns a newJxnRealArrayAlgebracontaining the elements of the internal array ofrain reversed order.static JxnRealArrayAlgebrarint(JxnRealArrayAlgebra ra)CallsMath.rint(double)for each element of the internal array ofra.static JxnRealArrayAlgebraround(JxnRealArrayAlgebra ra)Commercial rounding of each element of the internal array ofra.static JxnRealArrayAlgebrascalb(JxnRealArrayAlgebra ra, int scaleFactor)CallsMath.scalb(double, int)for each element of the internal array ofra.JxnRealArrayAlgebraset(int i, double vi)Replaces thei-th value of thisJxnRealArrayAlgebrabyvi.static JxnRealArrayAlgebraset(JxnRealArrayAlgebra ra, int i, double vi)Returns a copy ofra, with thei-th value replaced byvi.JxnRealArrayAlgebrasetDateTimeValue(boolean isDateTime)Indicates that this instance represents date time values.static doublesetEqualityTolerance(double eps)Sets tolerance for theequalsmethod for all instances of this class.static booleansetIgnoreSurplus(boolean ignore)Controls if to ignore surplus elements of the longer internal array for methods which expect two instances with equal length internal arrays.JxnRealArrayAlgebrasetName(String name)Sets a name for this instance (status experimental).static booleansetNamedResultEnabled(boolean enabled)Enables the use of name forJxnRealArrayAlgebrainstances (status experimental).JxnRealArrayAlgebrasetTimeFormat(boolean isDateTime)Deprecated.replaced bysetDateTimeValue(boolean).doublesetValue(double vi, int i)Deprecated.replaced bysetValue( i, vi ).doublesetValue(int i, double vi)Replaces thei-th value of thisJxnRealArrayAlgebrabyvi.static JxnRealArrayAlgebrasetValue(JxnRealArrayAlgebra ra, double vi, int i)Deprecated.Useset( ra, i, vi ).JxnRealArrayAlgebrashift(int k)Returns a newJxnRealArrayAlgebracontaining the values of this circularly shifted byk.static JxnRealArrayAlgebrashift(JxnRealArrayAlgebra ra, int k)Returns a newJxnRealArrayAlgebracontaining the values of this shifted bykfilling with0..static JxnRealArrayAlgebrashift(JxnRealArrayAlgebra ra, int k, double d)Returns a newJxnRealArrayAlgebracontaining the values of this shifted bykfilling withd.static JxnRealArrayAlgebrasign(JxnRealArrayAlgebra ra)Returns a newJxnRealArrayAlgebracontaining the sign of each element of the internal array ofra.static JxnRealArrayAlgebrasignum(JxnRealArrayAlgebra ra)CallsMath.signum(double)for each element of the internal array ofra.static JxnRealArrayAlgebrasin(JxnRealArrayAlgebra ra)CallsMath.sin(double)for each element of the internal array ofra.static JxnRealArrayAlgebrasinD(JxnRealArrayAlgebra ra)CallsMath.sin(double)for each element of the internal array ofraafter converting the argument from degrees to radians.static JxnRealArrayAlgebrasinh(JxnRealArrayAlgebra ra)CallsMath.sinh(double)for each element of the internal array ofra.intsize()Returns the length of the internal array.static JxnRealArrayAlgebrasmoothExp(JxnRealArrayAlgebra x, double alpha)Returns the resultyof an exponential smoothing ofx.static JxnRealArrayAlgebrasort(JxnRealArrayAlgebra ra)Returns a newJxnRealArrayAlgebracontaining the elements of the internal array ofrasorted in ascending order.static int[]sortIndex(JxnRealArrayAlgebra ra)Returns an array of the indices of the values ofrain ascending order.static JxnRealArrayAlgebrasqrt(JxnRealArrayAlgebra ra)CallsMath.sqrt(double)for each element of the internal array ofra.JxnRealArrayAlgebrasub(double d)Subtractsdfrom this.static JxnRealArrayAlgebrasub(double d, JxnRealArrayAlgebra ra)Returnsd - ra.JxnComplexArrayAlgebrasub(JxnComplexAlgebra cx)Subtractscxfrom this.JxnRealArrayAlgebrasub(JxnRealArrayAlgebra ra)Subtractsrafrom this.static doublesumme(JxnRealArrayAlgebra ra)Returnstotal( ra ).static JxnRealArrayAlgebrasw(JxnRealArrayAlgebra ra, double lower, double upper)Deprecated.replaced byclip(JxnRealArrayAlgebra, double, double).static JxnRealArrayAlgebrasw(JxnRealArrayAlgebra x, double lower, double upper, JxnRealArrayAlgebra yLower, JxnRealArrayAlgebra yInner, JxnRealArrayAlgebra yUpper)Returns values ofyLower,yInneroryUpperdepending on the value ofx.static JxnRealArrayAlgebrasw(JxnRealArrayAlgebra x, JxnRealArrayAlgebra yLT, JxnRealArrayAlgebra yGE)Returns values ofyLToryGEdepending on the value ofx.static JxnRealArrayAlgebrasw(JxnRealArrayAlgebra x, JxnRealArrayAlgebra yLT, JxnRealArrayAlgebra yEQ, JxnRealArrayAlgebra yGT, double eps)Returns values ofyLT,yEQoryGTdepending on the value ofx.static JxnRealArrayAlgebratan(JxnRealArrayAlgebra ra)CallsMath.tan(double)for each element of the internal array ofra.static JxnRealArrayAlgebratanD(JxnRealArrayAlgebra ra)CallsMath.tan(double)for each element of the internal array ofraafter converting the argument from degrees to radians.static JxnRealArrayAlgebratanh(JxnRealArrayAlgebra ra)CallsMath.tanh(double)for each element of the internal array ofra.double[]toArray()Returns a copy of the internal array of thisJxnRealArrayAlgebra.StringtoString()Formats instance.static doubletotal(JxnRealArrayAlgebra ra)Returns the sum of all elements of the internal array ofra.static int[]valid(JxnRealArrayAlgebra ra)Returns an int array of the indices of values ofrawith valid (neitherNaNnorInfinitive) values.doublevalueAt(int i)Deprecated.Useget(i).static doublevalueAt(JxnRealArrayAlgebra ra, int i)Deprecated.UsegetValue( ra, i ).
-
-
-
Field Detail
-
value
public double[] value
Internal storage.
-
equalityTolerance
protected static double equalityTolerance
Tolerance forequalsmethod.- See Also:
setEqualityTolerance(double)
-
ignoreSurplus
protected static boolean ignoreSurplus
-
-
Constructor Detail
-
JxnRealArrayAlgebra
protected JxnRealArrayAlgebra()
-
JxnRealArrayAlgebra
protected JxnRealArrayAlgebra(int length)
-
JxnRealArrayAlgebra
public JxnRealArrayAlgebra(double[] value)
Creates aJxnRealArrayAlgebrainstance from the arrayvalue. CallsJxnRealArrayAlgebra( value, false ).
Note: This constructor exists for performance and memory reasons and stores a reference tovalueas the internal array representation. Consequently modifications of the array elements ofvaluemodify the JxnRealArrayAlgebra object and vice versa. To store an independent internal copy of the external arrayvalueuseJxnRealArrayalgebra( value, true ).- See Also:
getValue()
-
JxnRealArrayAlgebra
public JxnRealArrayAlgebra(double[] value, boolean copyInput)Creates aJxnRealArrayAlgebrainstance from the arraydouble [] value.- Parameters:
copyInput- if true, stores a copy of the arrayvalue, otherwise stores a reference to the arrayvalue.
-
JxnRealArrayAlgebra
public JxnRealArrayAlgebra(int[] value)
Creates aJxnRealArrayAlgebrainstance from the arrayint[] value.
-
JxnRealArrayAlgebra
public JxnRealArrayAlgebra(JxnRealArrayAlgebra ra)
Creates a copy ofra. CallsJxnRealArrayAlgebra( ra, true )
-
JxnRealArrayAlgebra
public JxnRealArrayAlgebra(JxnRealArrayAlgebra ra, boolean transfer)
Creates a copy ofra.- Parameters:
transfer- if true includes copies ofitsNameandisDateTimeValue.
-
JxnRealArrayAlgebra
public JxnRealArrayAlgebra(double start, double step, int length)Creates an instance from the given parameters.
value[i] = start + step * ifori = 0 ... length-1
-
JxnRealArrayAlgebra
public JxnRealArrayAlgebra(double start, double end, double step)Creates an instance from the given parameters.
Ifstart < end:value[i] = start + abs(step) * i
ifstart > end:value[i] = start - abs(step) * i
fori = 0 ... nwithn = 1 + abs( round( ( end - start ) / step ) )
-
JxnRealArrayAlgebra
public JxnRealArrayAlgebra(double uvmin, double uvStep, int nuvSteps, int nvuSteps, int ni)Deprecated.replaced by classJxnUVGrid.Darstellung von Funktionen x(u,v) und y(u,v) durch Abbildung eines Netzes in der uv-Ebene in die xy-Ebene.Anwendung:
u = @JxnRealArrayAlgebra( umin, uStep, nuSteps, nvSteps, ni ) v = @JxnRealArrayAlgebra( vmin, vStep, nvSteps, nuSteps, -ni ) x = fx( u, v ) y = fy( u, v ) plot( x, y ) mit uStep: Maschenweite in u-Richtung, nuSteps: Anzahl der Maschen vStep: Maschenweite in v-Richtung, nvSteps: Anzahl der Maschen ni: Anzahl der Stuetzstellen je Masche (ni=1 Stuetzstellen nur in den Knotenpunkten) Beispiel: nuSteps = 3, nvSteps = 2, ni = 2 ( + : Stuetzstelle ) +---+---+---+---+---+---+ | | | | + + + + | | | | vmin+vStep -> +---+---+---+---+---+---+ | | | | + + + + | | | | vmin +---+---+---+---+---+---+ umin | u -> umin+uStep
-
-
Method Detail
-
cloneThis
public JxnCloneableAlgebra cloneThis()
Description copied from interface:JxnCloneableAlgebraCalled internally. Required to avoid overwriting the left side operandopndLeftinopndLeft op opndRght, ifopis implemented asopndLeft.op(opndRght)and the instance methodopmodifies the instance.- Specified by:
cloneThisin interfaceJxnCloneableAlgebra- Returns:
- copy of this instance
-
size
public int size()
Returns the length of the internal array.
-
length
public static int length(JxnRealArrayAlgebra ra)
Returns the length of the internal array ofra.
-
setIgnoreSurplus
public static boolean setIgnoreSurplus(boolean ignore)
Controls if to ignore surplus elements of the longer internal array for methods which expect two instances with equal length internal arrays. By default the methods silently ignore surplus elements.- Parameters:
ignore- if set to false methods throw an Exception if the internal arrays differ in length.
-
getIgnoreSurplus
public static boolean getIgnoreSurplus()
ReturnsignoreSurplus.
-
equals
public boolean equals(Object other)
JxnRealArrayAlgebraobjects are equal, if all corresponding array elements are equal. UsesetEqualityTolerance(double)to set a tolerance for the comparision of the array values.
-
setEqualityTolerance
public static double setEqualityTolerance(double eps)
Sets tolerance for theequalsmethod for all instances of this class.- Parameters:
eps-eps> 0. absolute difference,eps< 0. relative difference- Returns:
- old tolerance
-
getEqualityTolerance
public static double getEqualityTolerance()
Returns the tolerance used for theequalsmethod.
-
setName
public JxnRealArrayAlgebra setName(String name)
Sets a name for this instance (status experimental).
-
setNamedResultEnabled
public static boolean setNamedResultEnabled(boolean enabled)
Enables the use of name forJxnRealArrayAlgebrainstances (status experimental).
-
setDateTimeValue
public JxnRealArrayAlgebra setDateTimeValue(boolean isDateTime)
Indicates that this instance represents date time values. The values of the internal array are interpreted as decimal seconds since 01-Jan-1970 00:00:00 UTC.- See Also:
KmgDateTimeConverter
-
setTimeFormat
public JxnRealArrayAlgebra setTimeFormat(boolean isDateTime)
Deprecated.replaced bysetDateTimeValue(boolean).
-
add
public JxnRealArrayAlgebra add(JxnRealArrayAlgebra ra)
Addsrato this.
-
sub
public JxnRealArrayAlgebra sub(JxnRealArrayAlgebra ra)
Subtractsrafrom this.
-
mul
public JxnRealArrayAlgebra mul(JxnRealArrayAlgebra ra)
(Post)Multiplies this byra.
-
div
public JxnRealArrayAlgebra div(JxnRealArrayAlgebra ra)
Divides this byra.
-
inv
public JxnRealArrayAlgebra inv()
Replaces this by its reciprocal.
-
remainder
public JxnRealArrayAlgebra remainder(JxnRealArrayAlgebra ra)
Replaces this bythis % ra.
-
pow
public JxnRealArrayAlgebra pow(JxnRealArrayAlgebra exponent)
Replaces this by its power ofexponent.
-
add
public JxnRealArrayAlgebra add(double d)
Addsdto this.
-
sub
public JxnRealArrayAlgebra sub(double d)
Subtractsdfrom this.
-
mul
public JxnRealArrayAlgebra mul(double d)
(Post)Multiplies this byd.
-
mulL
public JxnRealArrayAlgebra mulL(double d)
(Pre)Multiplies this byd.
-
div
public JxnRealArrayAlgebra div(double d)
Divides this byd.
-
remainder
public JxnRealArrayAlgebra remainder(double d)
Replaces this bythis % d.
-
pow
public JxnRealArrayAlgebra pow(double exponent)
Replaces this by its power ofexponent.
-
add
public static JxnRealArrayAlgebra add(double d, JxnRealArrayAlgebra ra)
Returnsd + ra.
-
sub
public static JxnRealArrayAlgebra sub(double d, JxnRealArrayAlgebra ra)
Returnsd - ra.
-
mul
public static JxnRealArrayAlgebra mul(double d, JxnRealArrayAlgebra ra)
Returnsd * ra.
-
div
public static JxnRealArrayAlgebra div(double d, JxnRealArrayAlgebra ra)
Returnsd / ra.
-
remainder
public static JxnRealArrayAlgebra remainder(double d, JxnRealArrayAlgebra ra)
Returnsd % ra.
-
pow
public static JxnRealArrayAlgebra pow(double d, JxnRealArrayAlgebra exponent)
Returnsdto the power ofexponent.
-
mul
public JxnRealArrayAlgebra mul(boolean sw)
Deprecated....
-
mul
public static JxnRealArrayAlgebra mul(boolean sw, JxnRealArrayAlgebra z)
Deprecated....
-
add
public JxnComplexArrayAlgebra add(JxnComplexAlgebra cx)
Addscxto this.
-
sub
public JxnComplexArrayAlgebra sub(JxnComplexAlgebra cx)
Subtractscxfrom this.
-
mul
public JxnComplexArrayAlgebra mul(JxnComplexAlgebra cx)
(Post)Multiplies this bycx.
-
div
public JxnComplexArrayAlgebra div(JxnComplexAlgebra cx)
Divides this bycx.
-
abs
public static JxnRealArrayAlgebra abs(JxnRealArrayAlgebra ra)
CallsMath.abs(double)for each element of the internal array ofra.- Returns:
- the result in a new
JxnRealArrayAlgebrainstance.
-
abs
public static JxnRealArrayAlgebra abs(JxnRealArrayAlgebra x, JxnRealArrayAlgebra y)
- Returns:
- the result in a new
JxnRealArrayAlgebrainstance.
-
hypot
public static JxnRealArrayAlgebra hypot(JxnRealArrayAlgebra x, JxnRealArrayAlgebra y)
- Returns:
- the result in a new
JxnRealArrayAlgebrainstance.
-
floor
public static JxnRealArrayAlgebra floor(JxnRealArrayAlgebra ra)
CallsMath.floor(double)for each element of the internal array ofra.- Returns:
- the result in a new
JxnRealArrayAlgebrainstance.
-
ceil
public static JxnRealArrayAlgebra ceil(JxnRealArrayAlgebra ra)
CallsMath.ceil(double)for each element of the internal array ofra.- Returns:
- the result in a new
JxnRealArrayAlgebrainstance.
-
round
public static JxnRealArrayAlgebra round(JxnRealArrayAlgebra ra)
Commercial rounding of each element of the internal array ofra.
Note: The implementation differs fromMath.round(double).- Returns:
- the result in a new
JxnRealArrayAlgebrainstance. - See Also:
JxnUtilities.round_half_away_from_zero(double)
-
rint
public static JxnRealArrayAlgebra rint(JxnRealArrayAlgebra ra)
CallsMath.rint(double)for each element of the internal array ofra.- Returns:
- the result in a new
JxnRealArrayAlgebrainstance.
-
modulo
public static JxnRealArrayAlgebra modulo(JxnRealArrayAlgebra x, JxnRealArrayAlgebra y)
- Returns:
- the result in a new
JxnRealArrayAlgebrainstance. - See Also:
remainder(JxnRealArrayAlgebra),IEEEremainder(JxnRealArrayAlgebra x, JxnRealArrayAlgebra y)
-
modulo
public static JxnRealArrayAlgebra modulo(JxnRealArrayAlgebra x, double d)
- Returns:
- the result in a new
JxnRealArrayAlgebrainstance. - See Also:
remainder(double d),IEEEremainder(JxnRealArrayAlgebra ra, double d)
-
modulo
public static JxnRealArrayAlgebra modulo(double d, JxnRealArrayAlgebra y)
- Returns:
- the result in a new
JxnRealArrayAlgebrainstance. - See Also:
remainder(double d, JxnRealArrayAlgebra y),IEEEremainder(double d, JxnRealArrayAlgebra y)
-
IEEEremainder
public static JxnRealArrayAlgebra IEEEremainder(JxnRealArrayAlgebra x, JxnRealArrayAlgebra y)
- Returns:
- the result in a new
JxnRealArrayAlgebrainstance.
-
IEEEremainder
public static JxnRealArrayAlgebra IEEEremainder(JxnRealArrayAlgebra x, double d)
- Returns:
- the result in a new
JxnRealArrayAlgebrainstance.
-
IEEEremainder
public static JxnRealArrayAlgebra IEEEremainder(double d, JxnRealArrayAlgebra y)
- Returns:
- the result in a new
JxnRealArrayAlgebrainstance.
-
sign
public static JxnRealArrayAlgebra sign(JxnRealArrayAlgebra ra)
Returns a newJxnRealArrayAlgebracontaining the sign of each element of the internal array ofra.- Returns:
- new
JxnRealArrayAlgebrawith
= +1 > 0. value[i] = 0 if ra.value[i] == 0. = -1 < 0.
-
signum
public static JxnRealArrayAlgebra signum(JxnRealArrayAlgebra ra)
CallsMath.signum(double)for each element of the internal array ofra.- Returns:
- the result in a new
JxnRealArrayAlgebrainstance.
-
copySign
public static JxnRealArrayAlgebra copySign(JxnRealArrayAlgebra x, JxnRealArrayAlgebra y)
- Returns:
- the result in a new
JxnRealArrayAlgebrainstance.
-
min
public static JxnRealArrayAlgebra min(JxnRealArrayAlgebra x, JxnRealArrayAlgebra y)
- Returns:
- the result in a new
JxnRealArrayAlgebrainstance.
-
min
public static JxnRealArrayAlgebra min(JxnRealArrayAlgebra x, double d)
- Returns:
- the result in a new
JxnRealArrayAlgebrainstance.
-
min
public static JxnRealArrayAlgebra min(double d, JxnRealArrayAlgebra y)
- Returns:
- the result in a new
JxnRealArrayAlgebrainstance.
-
max
public static JxnRealArrayAlgebra max(JxnRealArrayAlgebra x, JxnRealArrayAlgebra y)
- Returns:
- the result in a new
JxnRealArrayAlgebrainstance.
-
max
public static JxnRealArrayAlgebra max(JxnRealArrayAlgebra x, double d)
- Returns:
- the result in a new
JxnRealArrayAlgebrainstance.
-
max
public static JxnRealArrayAlgebra max(double d, JxnRealArrayAlgebra y)
- Returns:
- the result in a new
JxnRealArrayAlgebrainstance.
-
limit
public static JxnRealArrayAlgebra limit(JxnRealArrayAlgebra ra, double lower, double upper)
Returns a newJxnRealArrayAlgebracontaining the elements of the internal array ofralimitted tolowerandupper.- Returns:
- new
JxnRealArrayAlgebrawith
value[i] = lower if ra.value[i] < lower = upper if ra.value[i] > upper = ra.value[i] else
-
clip
public static JxnRealArrayAlgebra clip(JxnRealArrayAlgebra ra, double lower, double upper)
Returns a newJxnRealArrayAlgebracontaining the elements of the internal array ofralimitted tolowerandupper.
Clipped values ofraare replaced byDouble.NaN.
NaN(Not-a-Number) is handled as follows:
- Arithmetic operations withNaNoperands do not abort but giveNaNas result.
-NaNvalues result in a gap in aJxnRealArrayCurve.- Returns:
- new
JxnRealArrayAlgebrawithif( lower < upper ) value[i] = ra.value[i] if lower <= ra.value[i] <= upper = Double.NaN else else if( lower > upper ) value[i] = Double.NaN if upper < ra.value[i] < lower = ra.value[i] else else // lower == upper value[i] = Double.NaN if lower == ra.value[i] == upper = ra.value[i] else
-
clip
public static JxnRealArrayAlgebra clip(JxnRealArrayAlgebra ra1, JxnRealArrayAlgebra ra2)
Returns a newJxnRealArrayAlgebracontaining the elements of the internal array ofra1with elements replaced byDouble.NaNif the respective element inra2is invalid (NaN or Infinity).
-
clip
public static JxnRealArrayAlgebra clip(JxnRealArrayAlgebra ra, int[] iClip)
-
clipLE
public static JxnRealArrayAlgebra clipLE(JxnRealArrayAlgebra ra, double minValue)
Returns a newJxnRealArrayAlgebracontaining the elements of the internal array ofrawith elementsvalue[i] <= minValuereplaced byDouble.NaN.
-
clipLT
public static JxnRealArrayAlgebra clipLT(JxnRealArrayAlgebra ra, double minValue)
Returns a newJxnRealArrayAlgebracontaining the elements of the internal array ofrawith elementsvalue[i] < minValuereplaced byDouble.NaN.
-
clipGE
public static JxnRealArrayAlgebra clipGE(JxnRealArrayAlgebra ra, double maxValue)
Returns a newJxnRealArrayAlgebracontaining the elements of the internal array ofrawith elementsvalue[i] >= maxValuereplaced byDouble.NaN.
-
clipGT
public static JxnRealArrayAlgebra clipGT(JxnRealArrayAlgebra ra, double maxValue)
Returns a newJxnRealArrayAlgebracontaining the elements of the internal array ofrawith elementsvalue[i] > maxValuereplaced byDouble.NaN.
-
sw
public static JxnRealArrayAlgebra sw(JxnRealArrayAlgebra ra, double lower, double upper)
Deprecated.replaced byclip(JxnRealArrayAlgebra, double, double).
-
sw
public static JxnRealArrayAlgebra sw(JxnRealArrayAlgebra x, JxnRealArrayAlgebra yLT, JxnRealArrayAlgebra yGE)
Returns values ofyLToryGEdepending on the value ofx.
Combined logical conditions:for x1 >= 0. AND x2 >= 0. use sw( min( x1, x2 ), ... ) for x1 >= 0. OR x2 >= 0. use sw( max( x1, x2 ), ... ) for x1 >= 0. EXOR x2 >= 0. use sw( x1 * x2, ... )
- Returns:
- new
JxnRealArrayAlgebrawith
value[i] = yLT.value[i] if x.value[i] < 0. = yGE.value[i] else
-
sw
public static JxnRealArrayAlgebra sw(JxnRealArrayAlgebra x, JxnRealArrayAlgebra yLT, JxnRealArrayAlgebra yEQ, JxnRealArrayAlgebra yGT, double eps)
Returns values ofyLT,yEQoryGTdepending on the value ofx.- Returns:
- new
JxnRealArrayAlgebrawith
value[i] = yLT.value[i] if x.value[i] < -eps = yGT.value[i] if x.value[i] > +eps = yEQ.value[i] else
-
sw
public static JxnRealArrayAlgebra sw(JxnRealArrayAlgebra x, double lower, double upper, JxnRealArrayAlgebra yLower, JxnRealArrayAlgebra yInner, JxnRealArrayAlgebra yUpper)
Returns values ofyLower,yInneroryUpperdepending on the value ofx.- Returns:
- new
JxnRealArrayAlgebrawith
value[i] = yLower.value[i] if x.value[i] < lower = yUpper.value[i] if x.value[i] > upper = yInner.value[i] else
-
sort
public static JxnRealArrayAlgebra sort(JxnRealArrayAlgebra ra)
Returns a newJxnRealArrayAlgebracontaining the elements of the internal array ofrasorted in ascending order.- See Also:
sortIndex(JxnRealArrayAlgebra)
-
reverse
public static JxnRealArrayAlgebra reverse(JxnRealArrayAlgebra ra)
Returns a newJxnRealArrayAlgebracontaining the elements of the internal array ofrain reversed order.
-
concat
public static JxnRealArrayAlgebra concat(JxnRealArrayAlgebra ra1, JxnRealArrayAlgebra ra2)
Returns a newJxnRealArrayAlgebrawhich is the concatenation of the elements ofra1followed byra2.
-
sqrt
public static JxnRealArrayAlgebra sqrt(JxnRealArrayAlgebra ra)
CallsMath.sqrt(double)for each element of the internal array ofra.- Returns:
- the result in a new
JxnRealArrayAlgebrainstance.
-
cbrt
public static JxnRealArrayAlgebra cbrt(JxnRealArrayAlgebra ra)
CallsMath.cbrt(double)for each element of the internal array ofra.- Returns:
- the result in a new
JxnRealArrayAlgebrainstance.
-
scalb
public static JxnRealArrayAlgebra scalb(JxnRealArrayAlgebra ra, int scaleFactor)
CallsMath.scalb(double, int)for each element of the internal array ofra.- Returns:
- the result in a new
JxnRealArrayAlgebrainstance.
-
exp
public static JxnRealArrayAlgebra exp(JxnRealArrayAlgebra ra)
CallsMath.exp(double)for each element of the internal array ofra.- Returns:
- the result in a new
JxnRealArrayAlgebrainstance.
-
expm1
public static JxnRealArrayAlgebra expm1(JxnRealArrayAlgebra ra)
CallsMath.expm1(double)for each element of the internal array ofra.- Returns:
- the result in a new
JxnRealArrayAlgebrainstance.
-
log
public static JxnRealArrayAlgebra log(JxnRealArrayAlgebra ra)
CallsMath.log(double)for each element of the internal array ofra.- Returns:
- the result in a new
JxnRealArrayAlgebrainstance.
-
log1p
public static JxnRealArrayAlgebra log1p(JxnRealArrayAlgebra ra)
CallsMath.log1p(double)for each element of the internal array ofra.- Returns:
- the result in a new
JxnRealArrayAlgebrainstance.
-
log10
public static JxnRealArrayAlgebra log10(JxnRealArrayAlgebra ra)
CallsMath.log10(double)for each element of the internal array ofra.- Returns:
- the result in a new
JxnRealArrayAlgebrainstance.
-
log
public static JxnRealArrayAlgebra log(double b, JxnRealArrayAlgebra ra)
Determines the baseblogarithm of each element of the internal array ofra.- Returns:
- the result in a new
JxnRealArrayAlgebrainstance.
-
sin
public static JxnRealArrayAlgebra sin(JxnRealArrayAlgebra ra)
CallsMath.sin(double)for each element of the internal array ofra.- Returns:
- the result in a new
JxnRealArrayAlgebrainstance.
-
cos
public static JxnRealArrayAlgebra cos(JxnRealArrayAlgebra ra)
CallsMath.cos(double)for each element of the internal array ofra.- Returns:
- the result in a new
JxnRealArrayAlgebrainstance.
-
tan
public static JxnRealArrayAlgebra tan(JxnRealArrayAlgebra ra)
CallsMath.tan(double)for each element of the internal array ofra.- Returns:
- the result in a new
JxnRealArrayAlgebrainstance.
-
asin
public static JxnRealArrayAlgebra asin(JxnRealArrayAlgebra ra)
CallsMath.asin(double)for each element of the internal array ofra.- Returns:
- the result in a new
JxnRealArrayAlgebrainstance.
-
acos
public static JxnRealArrayAlgebra acos(JxnRealArrayAlgebra ra)
CallsMath.acos(double)for each element of the internal array ofra.- Returns:
- the result in a new
JxnRealArrayAlgebrainstance.
-
atan
public static JxnRealArrayAlgebra atan(JxnRealArrayAlgebra ra)
CallsMath.atan(double)for each element of the internal array ofra.- Returns:
- the result in a new
JxnRealArrayAlgebrainstance.
-
atan2
public static JxnRealArrayAlgebra atan2(JxnRealArrayAlgebra y, JxnRealArrayAlgebra x)
- Returns:
- the result in a new
JxnRealArrayAlgebrainstance.
-
sinD
public static JxnRealArrayAlgebra sinD(JxnRealArrayAlgebra ra)
CallsMath.sin(double)for each element of the internal array ofraafter converting the argument from degrees to radians.- Returns:
- the result in a new
JxnRealArrayAlgebrainstance.
-
cosD
public static JxnRealArrayAlgebra cosD(JxnRealArrayAlgebra ra)
CallsMath.cos(double)for each element of the internal array ofraafter converting the argument from degrees to radians.- Returns:
- the result in a new
JxnRealArrayAlgebrainstance.
-
tanD
public static JxnRealArrayAlgebra tanD(JxnRealArrayAlgebra ra)
CallsMath.tan(double)for each element of the internal array ofraafter converting the argument from degrees to radians.- Returns:
- the result in a new
JxnRealArrayAlgebrainstance.
-
asinD
public static JxnRealArrayAlgebra asinD(JxnRealArrayAlgebra ra)
CallsMath.asin(double)and converts the result from radians to degrees for each element of the internal array ofra.- Returns:
- the result in a new
JxnRealArrayAlgebrainstance.
-
acosD
public static JxnRealArrayAlgebra acosD(JxnRealArrayAlgebra ra)
CallsMath.acos(double)and converts the result from radians to degrees for each element of the internal array ofra.- Returns:
- the result in a new
JxnRealArrayAlgebrainstance.
-
atanD
public static JxnRealArrayAlgebra atanD(JxnRealArrayAlgebra ra)
CallsMath.atan(double)and converts the result from radians to degrees for each element of the internal array ofra.- Returns:
- the result in a new
JxnRealArrayAlgebrainstance.
-
atan2D
public static JxnRealArrayAlgebra atan2D(JxnRealArrayAlgebra y, JxnRealArrayAlgebra x)
CallsMath.atan2(yi,xi)and converts the result from radians to degrees for each pair of elements of the internal arrays ofyandx.- Returns:
- the result in a new
JxnRealArrayAlgebrainstance.
-
sinh
public static JxnRealArrayAlgebra sinh(JxnRealArrayAlgebra ra)
CallsMath.sinh(double)for each element of the internal array ofra.- Returns:
- the result in a new
JxnRealArrayAlgebrainstance.
-
cosh
public static JxnRealArrayAlgebra cosh(JxnRealArrayAlgebra ra)
CallsMath.cosh(double)for each element of the internal array ofra.- Returns:
- the result in a new
JxnRealArrayAlgebrainstance.
-
tanh
public static JxnRealArrayAlgebra tanh(JxnRealArrayAlgebra ra)
CallsMath.tanh(double)for each element of the internal array ofra.- Returns:
- the result in a new
JxnRealArrayAlgebrainstance.
-
asinh
public static JxnRealArrayAlgebra asinh(JxnRealArrayAlgebra ra)
CallsJxnUtilities.asinh(double)for each element of the internal array ofra.- Returns:
- the result in a new
JxnRealArrayAlgebrainstance.
-
acosh
public static JxnRealArrayAlgebra acosh(JxnRealArrayAlgebra ra)
CallsJxnUtilities.acosh(double)for each element of the internal array ofra.- Returns:
- the result in a new
JxnRealArrayAlgebrainstance.
-
atanh
public static JxnRealArrayAlgebra atanh(JxnRealArrayAlgebra ra)
CallsJxnUtilities.atanh(double)for each element of the internal array ofra.- Returns:
- the result in a new
JxnRealArrayAlgebrainstance.
-
random
public static JxnRealArrayAlgebra random(int n)
-
random
public static JxnRealArrayAlgebra random(int n, long seed)
Returns a newJxnRealArrayAlgebrawithnrandom numbers fromrnd.nextDouble()withrnd = newRandom(seed).
-
random
public static JxnRealArrayAlgebra random(JxnRealArrayAlgebra ra)
Returnsrandom(int n)withn = ra.size().
-
random
public static JxnRealArrayAlgebra random(JxnRealArrayAlgebra ra, long seed)
Returnsrandom(int n, long seed)withn = ra.size().
-
noise
public static JxnRealArrayAlgebra noise(int n)
Returns a newJxnRealArrayAlgebrawithnrandom numbers fromrnd.nextGaussian()withrnd = newRandom().
-
noise
public static JxnRealArrayAlgebra noise(int n, long seed)
Returns a newJxnRealArrayAlgebrawithnrandom numbers fromrnd.nextGaussian()withrnd = newRandom(seed).
-
noise
public static JxnRealArrayAlgebra noise(JxnRealArrayAlgebra ra)
Returnsnoise(int n)withn = ra.size().
-
noise
public static JxnRealArrayAlgebra noise(JxnRealArrayAlgebra ra, long seed)
Returnsnoise(int n, long seed)withn = ra.size().
-
derivative
public static JxnRealArrayAlgebra derivative(JxnRealArrayAlgebra y)
Returnsderivative( y, 1. ).
-
derivative
public static JxnRealArrayAlgebra derivative(JxnRealArrayAlgebra y, double dt)
Returns the derivativedy/dtfor equidistant step sizedt.
result[i] = 0.5 * ( y[i+1] - y[i-1] ) / dt(derivative from quadratic polynom through 3 adjacent points).- Returns:
- the result in a new
JxnRealArrayAlgebrainstance.
-
derivative
public static JxnRealArrayAlgebra derivative(JxnRealArrayAlgebra y, JxnRealArrayAlgebra t)
Returns the derivativedy/dtfor the elements of the internal arrays ofyandt.
Determines the derivative at ti from the quadratic polynom through the (not necessarily equidistant) points (ti-1, yi-1), (ti, yi) and (ti+1, yi+1).- Returns:
- the result in a new
JxnRealArrayAlgebrainstance.
-
integral
public static JxnRealArrayAlgebra integral(JxnRealArrayAlgebra y)
Returnsintegral( y, 1. ).
-
integral
public static JxnRealArrayAlgebra integral(JxnRealArrayAlgebra y, double dt)
Returns the integral ∫y dtfor equidistant step sizedt.
result[0] = 0.; result[i+1] = result[i] + 0.5 * ( y[i+1] + y[i] ) * dt(trapeziod rule: linear interpolation between data points)- Returns:
- the result in a new
JxnRealArrayAlgebrainstance.
-
integral
public static JxnRealArrayAlgebra integral(JxnRealArrayAlgebra y, JxnRealArrayAlgebra t)
Returns the integral ∫y dtfor the elements of the internal arrays ofyandt.
Determines the integral by the trapeziod rule (linear interpolation between (not necessarily equidistant) data points).
result[0] = 0.; result[i+1] = result[i] + 0.5 * ( y[i+1] + y[i] ) * ( t[i+1] - t[i] )- Returns:
- the result in a new
JxnRealArrayAlgebrainstance.
-
energy
public static JxnRealArrayAlgebra energy(JxnRealArrayAlgebra p, double h)
Returns the integral of a power curve (with e.g.p[0]= average power of time interval: 0:00 - 0:15 (available and stored at 0:15) ).
result[0] = p[0]; result[i+1] = result[i] + h * p[i+1]( withresult[i]= accumulated meter value at time( i + 1 ) * h).- Parameters:
h- sample interval: If p is in kW and h is 0.25 h (= 15 min) the result is in kWh- Returns:
- the result in a new
JxnRealArrayAlgebrainstance.
-
nonWindupStore
public static JxnRealArrayAlgebra nonWindupStore(JxnRealArrayAlgebra p, double h, double initial, double lower, double upper)
Returns the integral internally limited tolowerandupper(non windup limiter) of a power curve.
Differs fromlimit(energy( p, h ), lower, upper )which winds up.- Parameters:
initial- initial value of the store- Returns:
- the result in a new
JxnRealArrayAlgebrainstance. - See Also:
energy(JxnRealArrayAlgebra, double), Wikipedia
-
peak
public static JxnRealArrayAlgebra peak(JxnRealArrayAlgebra p, double h)
Determines the peak energy from a power curvep. Forep = peak( p, h )the valueep[i]contains the (peak) energy consumed above a power value ofps[i+1]of the sorted power curveps =reverse(sort(p) ).- Parameters:
h- sample interval ofp
-
gaussFilter
public static JxnRealArrayAlgebra gaussFilter(JxnRealArrayAlgebra t, double bandWidth)
ReturnsgaussFilter( t, bandWidth, 3. ).
-
gaussFilter
public static JxnRealArrayAlgebra gaussFilter(JxnRealArrayAlgebra t, double bandWidth, double filterWidth)
Creates a gaussFilter forconvolution.- Parameters:
bandWidth- of the filter in terms oft.filterWidth- width of the (finite) approximation of the infinite width gauss filter in terms of thebandWidth
-
convolution
public static JxnRealArrayAlgebra convolution(JxnRealArrayAlgebra ra, JxnRealArrayAlgebra filter)
Returnsconvolution( ra, filter, 1 ).
-
convolution
public static JxnRealArrayAlgebra convolution(JxnRealArrayAlgebra ra, JxnRealArrayAlgebra filter, int mode)
Returns the convolution ofrawithfilter. Together withgaussFilterthis results in the smoothing ofra.
The filtering implements a generalized weighted moving average which removes high frequency signal components (noise).
Example:slider = @JxnSliderPanel($this) seed = slider.add( "seed", 0., 0., 1000. ) an = slider.add( "noise amplitude", 0.5, 0.01, 2. ) bw = slider.add( "filter bandwidth", 0.05, 0.001, 2. ) mode = 1 noise = JxnRealArrayAlgebra.noise( t, round seed ) y0 = 2 + sin 4 PI t y1 = y0 + an noise gf = gaussFilter( t, bw ) yf = convolution( y1, gf, mode ) plot( t, y1, yf, y0 ) total y1 + " " + total yf- Parameters:
filter- positive half of a symmetrical filter function e.g. fromgaussFiltermode- determines how to handle values which by the convolution are mapped to the intervals outside the left and right margins:
0 : discards values. As a concequence the total of the data is reduced.
1 : adjust the weight of the filter function applied near the margins to preserve the total of the data.
2 : cyclic mapping of data from the right to the left margin and vice versa (periodic extension).- See Also:
- Wikipedia
-
faltung
public static JxnRealArrayAlgebra faltung(JxnRealArrayAlgebra ra, JxnRealArrayAlgebra filter)
Deprecated.
-
faltung
public static JxnRealArrayAlgebra faltung(JxnRealArrayAlgebra ra, JxnRealArrayAlgebra filter, int iRand)
Deprecated.- See Also:
- Wikipedia
-
smoothExp
public static JxnRealArrayAlgebra smoothExp(JxnRealArrayAlgebra x, double alpha)
Returns the resultyof an exponential smoothing ofx.
y[i] = alpha * x[i] + ( 1 - alpha ) * y[i-1]- Returns:
- the result in a new
JxnRealArrayAlgebrainstance.
-
getDayOfWeek
public static JxnRealArrayAlgebra getDayOfWeek(JxnRealArrayAlgebra ra)
Returns the day of week ( Mo: 1, ... Su: 7 ) for the values of the internal array ofrainterpreted as decimal seconds since 01-Jan-1970 00:00:00 UTC. Returns negative values for German holidays (Bavaria).- Returns:
- the result in a new
JxnRealArrayAlgebrainstance. - See Also:
Calendar, German holidays (Wikipedia),setDateTimeValue(boolean),KmgDateTimeConverter
-
getCalendarField
public static JxnRealArrayAlgebra getCalendarField(JxnRealArrayAlgebra ra, int field)
Returns the result ofgc.get( field )withgc = newGregorianCalendar()for the values of the internal array ofrainterpreted as decimal seconds since 01-Jan-1970 00:00:00 UTC.- Parameters:
field- constant fromCalendar- Returns:
- the result in a new
JxnRealArrayAlgebrainstance. - See Also:
setDateTimeValue(boolean),KmgDateTimeConverter
-
set
public static JxnRealArrayAlgebra set(JxnRealArrayAlgebra ra, int i, double vi)
Returns a copy ofra, with thei-th value replaced byvi.
-
set
public JxnRealArrayAlgebra set(int i, double vi)
Replaces thei-th value of thisJxnRealArrayAlgebrabyvi.- Returns:
- this
-
setValue
public double setValue(int i, double vi)Replaces thei-th value of thisJxnRealArrayAlgebrabyvi.- Returns:
- the old value
-
setValue
public double setValue(double vi, int i)Deprecated.replaced bysetValue( i, vi ).
-
setValue
public static JxnRealArrayAlgebra setValue(JxnRealArrayAlgebra ra, double vi, int i)
Deprecated.Useset( ra, i, vi ).
-
range
public JxnRealArrayAlgebra range(int iStart)
Returns a newJxnRealArrayAlgebracontaininglength(ra)-iStartvalues starting from indexiStart. IfiStart< 0 returnsabs(iStart)values starting from indexlength(ra)-abs(iStart).
-
range
public JxnRealArrayAlgebra range(int iStart, int iEnd)
Returns a newJxnRealArrayAlgebracontainingiEnd-iStartvalues starting from indexiStartto indexiEnd(excluding).
-
range
public JxnRealArrayAlgebra range()
-
range
public JxnRealArrayAlgebra range(JxnRealArrayAlgebra ra)
Deprecated.
-
range
public JxnRealArrayAlgebra range(double start)
Callsrange(int)withstartrounded to int.
-
range
public JxnRealArrayAlgebra range(double start, double end)
-
range
public JxnRealArrayAlgebra range(String start)
Returns a newJxnRealArrayAlgebracontaining the values of this starting fromstartgiven as date time string.- See Also:
setDateTimeValue(boolean),KmgDateTimeConverter
-
range
public JxnRealArrayAlgebra range(String start, String end)
Returns a newJxnRealArrayAlgebracontaining the values of this starting fromstarttoendgiven as date time string.- See Also:
setDateTimeValue(boolean),KmgDateTimeConverter
-
shift
public JxnRealArrayAlgebra shift(int k)
Returns a newJxnRealArrayAlgebracontaining the values of this circularly shifted byk.
-
shift
public static JxnRealArrayAlgebra shift(JxnRealArrayAlgebra ra, int k)
Returns a newJxnRealArrayAlgebracontaining the values of this shifted bykfilling with0..
-
shift
public static JxnRealArrayAlgebra shift(JxnRealArrayAlgebra ra, int k, double d)
Returns a newJxnRealArrayAlgebracontaining the values of this shifted bykfilling withd.
-
byIndex
public JxnRealArrayAlgebra byIndex(int[] index)
Returns a newJxnRealArrayAlgebracontaining the values of this instance at the positions given inindex.- See Also:
get(int[])
-
by
public JxnRealArrayAlgebra by(int[] index)
Same asbyIndex(int[]).
-
sortIndex
public static int[] sortIndex(JxnRealArrayAlgebra ra)
Returns an array of the indices of the values ofrain ascending order.ry.byIndex( sortIndex(ry) )gives the sameJxnRealArrayAlgebraassort(ry), but sortIndex also allows to address other arrays according to the order of a given arrayry.- See Also:
sort(JxnRealArrayAlgebra)
-
cut
public static int[] cut(JxnRealArrayAlgebra ra)
Returns an int array of the indicesiof values ofrawith:value[i] > 0..
-
cut
public static int[] cut(JxnRealArrayAlgebra ra, int[] index)
Analyzes the values ofraonly with indices given in arrayindexand returns an int array of the indicesiof values with:value[i] > 0..
-
cut
public static int[] cut(JxnRealArrayAlgebra ra, double min, double max)
Returns an int array of the indicesiof values ofrawith:min <= value[i] <= max.
-
getCntValid
public static int getCntValid(JxnRealArrayAlgebra ra)
Returns the number of valid (neitherNaNnorInfinitive) values inra.
-
getCntNaN
public static int getCntNaN(JxnRealArrayAlgebra ra)
Returns the number ofNaNvalues inra.
-
getCntInvalid
public static int getCntInvalid(JxnRealArrayAlgebra ra)
Returns the number of invalid (NaNorInfinitive) values inra.
-
valid
public static int[] valid(JxnRealArrayAlgebra ra)
Returns an int array of the indices of values ofrawith valid (neitherNaNnorInfinitive) values.
-
invalid
public static int[] invalid(JxnRealArrayAlgebra ra)
Returns an int array of the indices of values ofrawith invalid (NaNorInfinitive) values.
-
valueAt
public double valueAt(int i)
Deprecated.Useget(i).
-
valueAt
public static double valueAt(JxnRealArrayAlgebra ra, int i)
Deprecated.UsegetValue( ra, i ).
-
get
public double get(int i)
Returns the value of thei-th element of the internal array of thisJxnRealArrayAlgebra.
-
get
public double[] get(int[] ia)
Returns an array of the values of the elements of the internal array of thisJxnRealArrayAlgebradefined by the indices given inia.- See Also:
byIndex(int[])
-
get
public double get(double x)
Returns a value for positionxby linear interpolation between the adjacent elements of the internal array of thisJxnRealArrayAlgebra.
For:i <= x <= i+1returns:value[i] + ( x - i ) * ( value[i+1] - value[i] )
-
get
public double[] get(double[] da)
Returns an array of values at the positions given indaby linear interpolation between the adjacent elements of the internal array of thisJxnRealArrayAlgebrausingget(double x).
-
get
public JxnRealArrayAlgebra get(JxnRealArrayAlgebra ra)
Returns aJxnRealArrayAlgebraof values at the positions given inraby linear interpolation between the adjacent elements of the internal array of thisJxnRealArrayAlgebrausingget(double[]).
-
toArray
public double[] toArray()
Returns a copy of the internal array of thisJxnRealArrayAlgebra.
-
getValue
public double[] getValue()
Returns a reference to the internal array of thisJxnRealArrayAlgebra.
Note: This method exists for performance and memory reasons. The modification of an array value will modify theJxnRealArrayAlgebraobject and vice versa. UsetoArray()to get an independent copy of the internal array.- See Also:
JxnRealArrayAlgebra(double[])
-
getValue
public double getValue(int i)
Deprecated.Useget(i).
-
getValue
public static double getValue(JxnRealArrayAlgebra ra, int i)
Returns the value of thei-th element of the internal array ofra.
-
getValue
public double getValue(double x)
Returnsget(x).
-
getValue
public static double getValue(JxnRealArrayAlgebra ra, double x)
-
getValue
public double[] getValue(double[] da)
Returnsget(da).
-
getValue
public static double[] getValue(JxnRealArrayAlgebra ra, double[] da)
-
findValue
public double[] findValue(double value)
Findsvaluein the internal array.
Example:x = x / 2 = {-5.0, -4.975, ... 5.0}[401] (JxnRealArrayAlgebra) y = sin x = {0.9589242746631385, 0.9657154423905294, ... -0.9589242746631385}[401] (JxnRealArrayAlgebra) p = y.findValue( 0. ) = { 74.33630146888443, 200.0, 325.6636985311156 } (double[3]) x[p] ! shortcut of x.Note: Intervals containingget( p ) = { -3.141592463277889, 0.0, 3.14159246327789 } (double[3]) x[p] / PI = { -0.9999999394218395, 0.0, 0.9999999394218397 } (double[3]) y[p] = { -4.85722573273506E-17, 0.0, -6.002143226879753E-16 } (double[3]) sin x[p] = { -1.903119041361038E-7, 0.0, 1.903119032479254E-7 } (double[3])valueare detected only by looking for transitions of the values of the internal array from abovevalueto belowvaluewithout any magic to distinguish a pole from a zero crossing (try the example replacingsinbytan).- Returns:
- position(s) (by linear interpolation) within all intervals of the internal array which include the given
value. - See Also:
get(double)
-
findValue
public static double[] findValue(JxnRealArrayAlgebra ra, double value)
Same asra.findValue(double value).
-
minValue
public static double minValue(JxnRealArrayAlgebra ra)
Returns the minimum value (including -Infinity) of the internal array ofra.
-
minValid
public static double minValid(JxnRealArrayAlgebra ra)
Returns the minimum value excluding -Infinity of the internal array ofra.
-
minIndex
public static int minIndex(JxnRealArrayAlgebra ra)
Returns the index of the (first) minimum value (including -Infinity) of the internal array ofra.
-
maxValue
public static double maxValue(JxnRealArrayAlgebra ra)
Returns the maximum value (including +Infinity) of the internal array ofra.
-
maxValid
public static double maxValid(JxnRealArrayAlgebra ra)
Returns the minimum value excluding +Infinity of the internal array ofra.
-
maxIndex
public static int maxIndex(JxnRealArrayAlgebra ra)
Returns the index of the (first) maximum value (including +Infinity) of the internal array ofra.
-
summe
public static double summe(JxnRealArrayAlgebra ra)
Returnstotal( ra ).
-
total
public static double total(JxnRealArrayAlgebra ra)
Returns the sum of all elements of the internal array ofra.
-
quadsum
public static double quadsum(JxnRealArrayAlgebra ra)
Returns the sum of the squares of all elements of the internal array ofra.
-
korXY
public static double korXY(JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry)
ReturnscorXY( rx, ry ).- See Also:
- Wikipedia
-
corXY
public static double corXY(JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry)
Returns the correlation coefficient ofrxandry.- See Also:
- Wikipedia
-
plot
public static JxnRealArrayPlotFrame plot(JxnRealArrayAlgebra ry)
Creates a newJxnRealArrayPlotFrameand visualizes the values ofryas a curve:
xi = i, yi = ry.value[i], i = 0 ... y.length - 1.
-
plot
public static JxnRealArrayPlotFrame plot(JxnRealArrayAlgebra ry, Color color, int lineType)
Seeplot.- Parameters:
lineType- seeJxnRealArrayCurve
-
plot
public static JxnRealArrayPlotFrame plot(JxnRealArrayAlgebra ry, double ymin, double ymax)
Deprecated.
-
plot
public static JxnRealArrayPlotFrame plot(JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry)
Creates a newJxnRealArrayPlotFrameand visualizes the values ofrxandryas a curve:
xi = rx.value[i], yi = ry.value[i], i = 0 ... min( length(rx), length(ry) ) - 1.
-
plot
public static JxnRealArrayPlotFrame plot(JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry, double ymin, double ymax)
Deprecated.
-
plot
public static JxnRealArrayPlotFrame plot(JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry1, JxnRealArrayAlgebra ry2)
-
plot
public static JxnRealArrayPlotFrame plot(JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry1, JxnRealArrayAlgebra ry2, double ymin, double ymax)
Deprecated.
-
plot
public static JxnRealArrayPlotFrame plot(JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry1, JxnRealArrayAlgebra ry2, JxnRealArrayAlgebra ry3)
-
plot
public static JxnRealArrayPlotFrame plot(JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry1, JxnRealArrayAlgebra ry2, JxnRealArrayAlgebra ry3, double ymin, double ymax)
Deprecated.
-
plot
public static JxnRealArrayPlotFrame plot(JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry, double vyx)
Seeplot.- Parameters:
vyx- fixed ratio of the scaling: 1.0 for equally scaled x- and y-axis.
-
plot
public static JxnRealArrayPlotFrame plot(JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry, int logScales)
Seeplot.
Note: logarithmic scaling requires that all values are positive. The scale switches to linear if rx or ry include any value(s) <= 0.- Parameters:
logScales- determines which axis should be scaled logarithmiclogScales x-axis y-axis 0 lin lin 1 lin log 2 log lin 3 log log 4 time lin 5 time log
-
plot
public static JxnRealArrayPlotFrame plot(JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry, Color color)
Seeplot.
-
plot
public static JxnRealArrayPlotFrame plot(JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry, Color color, int lineType)
Seeplot.- Parameters:
lineType- seeJxnRealArrayCurve
-
plot
public static JxnRealArrayPlotFrame plot(JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry, Color color, float lineWidth)
Seeplot.
-
plot
public static JxnRealArrayPlotFrame plot(JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry, Color color, Stroke stroke)
Seeplot.- Parameters:
stroke- seejava.awt.BasicStroke
-
plot
public static JxnRealArrayPlotFrame plot(JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry, Color color, int lineType, double vyx)
Seeplot.
-
plot
public static JxnRealArrayPlotFrame plot(JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry, Color color, int lineType, int logScales)
Seeplot.
-
plot
public static JxnRealArrayPlotFrame plot(JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry, Color color, int lineType, float lineWidth, double vyx)
Seeplot.- Parameters:
lineWidth- seejava.awt.BasicStroke
-
plot
public static JxnRealArrayPlotFrame plot(JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry, Color color, int lineType, float lineWidth, int logScales)
Seeplot.
-
plot
public static JxnRealArrayPlotFrame plot(JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry, Color color, Stroke stroke, double vyx)
Seeplot.
-
plot
public static JxnRealArrayPlotFrame plot(JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry, Color color, Stroke stroke, int logScales)
Seeplot.
-
plot
public static JxnRealArrayPlotFrame plot(JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry, JxnRealArrayAlgebra rz, IKmg3DProjection p3d)
-
curve
public static JxnRealArrayCurve curve(JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry, Color color)
Returns a curve representation ofrxandry( xi = rx.value[i], yi = ry.value[i] ). Call theaddmethod on aPlotFrameinstance to display the curve in the PlotFrame. Allows e.g. to show a curve in aJxnComplexPlotFrame.
Example:plot( 3 + j 4 ).add( curve( 5 cos 2 PI t, 5 sin 2 PI t, Color.BLUE ).setLineWidth(3) )
-
curve
public static JxnRealArrayCurve curve(JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry, Color color, int lineType)
Seecurve.- Parameters:
lineType- seeJxnRealArrayCurve- See Also:
JxnAbstractPainter.setLineWidth(float),JxnAbstractPainter.setStroke(java.awt.Stroke)
-
curve
public static JxnRealArrayCurve curve(JxnRealArrayAlgebra ry, Color color)
-
curve
public static JxnRealArrayCurve curve(JxnRealArrayAlgebra ry, Color color, int lineType)
Seecurve.- Parameters:
lineType- seeJxnRealArrayCurve
-
curve
public static JxnRealArrayCurve curve(JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry, JxnRealArrayAlgebra rz, IKmg3DProjection p3d)
-
curve
public static JxnRealArrayCurve curve(JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry, JxnRealArrayAlgebra rz, IKmg3DProjection p3d, Color color)
-
curve
public static JxnRealArrayCurve curve(JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry, JxnRealArrayAlgebra rz, IKmg3DProjection p3d, Color color, int lineType)
- Parameters:
lineType- seeJxnRealArrayCurve- See Also:
- JXN gallery, → anaglyph stereo
-
-