|
AlgART Home | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.algart.math.functions.PowerFunc
public abstract class PowerFunc extends java.lang.Object implements Func
Power function: f(x0, x1) = scale*x0x1 or f(x0) = scale*x0c, where c and scale are constants. More precisely, the result of this function is:
getBinaryInstance(double scale) or
getInstance(double c, double scale) methods;getStrictBinaryInstance(double scale) or
getStrictInstance(double c, double scale) methods.get(double...) method of the instance of this class requires at least 2 or 1 arguments
(for the cases x0x1 and
x0c correspondingly)
and throws IndexOutOfBoundsException if the number of arguments is less.
In a case of using getStrictBinaryInstance(double scale) /
getStrictInstance(double c, double scale) methods,
all calculations are performed in strictfp mode, so the result
is absolutely identical on all platforms.
This class is immutable and thread-safe: there are no ways to modify settings of the created instance.
AlgART Laboratory 2007-2013
| Modifier and Type | Class and Description |
|---|---|
static class |
PowerFunc.Updatable
Updatable extension of the power function
with one argument. |
| Modifier and Type | Field and Description |
|---|
| Fields inherited from interface net.algart.math.functions.Func |
|---|
ABS, ABS_DIFF, HALF_X_MINUS_Y, HALF_X_PLUS_Y, HALF_Y_MINUS_X, IDENTITY, MAX, MIN, POSITIVE_DIFF, REVERSE, SELECT, SELECT_FROM_8_DIRECTIONS_2D, SELECT_IF_GREATER, SELECT_IF_GREATER_OR_EQUAL, SHIFTS_ALONG_8_DIRECTIONS_2D, UPDATABLE_IDENTITY, X_MINUS_Y, X_PLUS_Y, Y_MINUS_X |
| Modifier and Type | Method and Description |
|---|---|
abstract double |
get()
Equivalent to get(new double[0]). |
abstract double |
get(double... x)
Returns the result of this function for the given arguments: f(x0, x1, ..., xx.length-1). |
abstract double |
get(double x0)
Equivalent to get(new double[] {x0}). |
abstract double |
get(double x0,
double x1)
Equivalent to get(new double[] {x0, x1}). |
abstract double |
get(double x0,
double x1,
double x2)
Equivalent to get(new double[] {x0, x1, x2}). |
static PowerFunc |
getBinaryInstance(double scale)
Returns an instance of this class, a case of binary function scale*x0x1, using Math.pow method. |
static PowerFunc |
getInstance(double c)
Returns an instance of this class, a case of unary function x0c, using Math.pow method. |
static PowerFunc |
getInstance(double c,
double scale)
Returns an instance of this class, a case of unary function scale*x0c, using Math.pow method. |
static PowerFunc |
getStrictBinaryInstance(double scale)
Returns an instance of this class, a case of binary function scale*x0x1, using StrictMath.pow method. |
static PowerFunc |
getStrictInstance(double c)
Returns an instance of this class, a case of unary function x0c, using StrictMath.pow method. |
static PowerFunc |
getStrictInstance(double c,
double scale)
Returns an instance of this class, a case of unary function scale*x0c, using StrictMath.pow method. |
static PowerFunc.Updatable |
getUpdatableInstance(double c,
double scale)
Returns an instance of the updatable version of this class, a case of unary function scale*x0c, using Math.pow method. |
static PowerFunc.Updatable |
getUpdatableStrictInstance(double c,
double scale)
Returns an instance of the updatable version of this class, a case of unary function scale*x0c, using StrictMath.pow method. |
java.lang.String |
toString()
Returns a brief string description of this object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface net.algart.math.functions.Func |
|---|
get |
| Method Detail |
|---|
public static PowerFunc getBinaryInstance(double scale)
scale - the constant scale.public static PowerFunc getStrictBinaryInstance(double scale)
scale - the constant scale.
public static PowerFunc getInstance(double c,
double scale)
This method returns special optimized versions of this class for several popular values of
cargument. In particular, there are optimized version
for
c - the constant c.scale - the constant scale.public static PowerFunc getInstance(double c)
getInstance(c,1.0).
c - the constant c.
public static PowerFunc getStrictInstance(double c,
double scale)
This method returns special optimized versions of this class for several popular values of
cargument. In particular, there are optimized version
for
c - the constant c.scale - the constant scale.public static PowerFunc getStrictInstance(double c)
getStrictInstance(c,1.0).
c - the constant c.
public static PowerFunc.Updatable getUpdatableInstance(double c,
double scale)
This method returns special optimized versions of this class for several popular values of
cargument. In particular, there are optimized version
for
c - the constant c.scale - the constant scale.
public static PowerFunc.Updatable getUpdatableStrictInstance(double c,
double scale)
This method returns special optimized versions of this class for several popular values of
cargument. In particular, there are optimized version
for
c - the constant c.scale - the constant scale.public abstract double get(double... x)
FuncThis method must not change the values of x elements!
get in interface Funcx - the function arguments.public abstract double get()
Funcget(new double[0]).
Provides better performance because it does not require Java array creation.
get in interface Funcpublic abstract double get(double x0)
Funcget(new double[] {x0}).
Provides better performance because it does not require Java array creation.
get in interface Funcx0 - the function argument.
public abstract double get(double x0,
double x1)
Funcget(new double[] {x0, x1}).
Provides better performance because it does not require Java array creation.
get in interface Funcx0 - the first function argument.x1 - the second function argument.
public abstract double get(double x0,
double x1,
double x2)
Funcget(new double[] {x0, x1, x2}).
Provides better performance because it does not require Java array creation.
get in interface Funcx0 - the first function argument.x1 - the second function argument.x2 - the third function argument.public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||