Class SlopeEmphasizer
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoidemphasize(byte[] values) voidemphasize(byte[] values, int offset, int count) Emphasizes boundaries: sub-ranges ofvaluesarray with high gradient.voidemphasize(byte[] values, int offset, int count, int step) voidemphasize(char[] values) voidemphasize(char[] values, int offset, int count) Emphasizes boundaries: sub-ranges ofvaluesarray with high gradient.voidemphasize(char[] values, int offset, int count, int step) voidemphasize(double[] values) voidemphasize(double[] values, int offset, int count) Emphasizes boundaries: sub-ranges ofvaluesarray with high gradient.voidemphasize(double[] values, int offset, int count, int step) voidemphasize(float[] values) voidemphasize(float[] values, int offset, int count) Emphasizes boundaries: sub-ranges ofvaluesarray with high gradient.voidemphasize(float[] values, int offset, int count, int step) voidemphasize(int[] values) voidemphasize(int[] values, int offset, int count) Emphasizes boundaries: sub-ranges ofvaluesarray with high gradient.voidemphasize(int[] values, int offset, int count, int step) voidemphasize(long[] values) voidemphasize(long[] values, int offset, int count) Emphasizes boundaries: sub-ranges ofvaluesarray with high gradient.voidemphasize(long[] values, int offset, int count, int step) voidemphasize(short[] values) voidemphasize(short[] values, int offset, int count) Emphasizes boundaries: sub-ranges ofvaluesarray with high gradient.voidemphasize(short[] values, int offset, int count, int step) forElementType(Class<?> elementType) static SlopeEmphasizerdoubleintbooleanbooleanbooleanbooleansetAllowLongSlopes(boolean allowLongSlopes) setExactHalfSum(boolean exactHalfSum) setMinimalChange(double minimalChange) setProcessAscending(boolean processAscending) setProcessDescending(boolean processDescending) setSlopeWidth(int slopeWidth)
-
Method Details
-
getInstance
-
forElementType
-
getMinimalChange
public double getMinimalChange() -
setMinimalChange
-
getSlopeWidth
public int getSlopeWidth() -
setSlopeWidth
-
isAllowLongSlopes
public boolean isAllowLongSlopes() -
setAllowLongSlopes
-
isProcessAscending
public boolean isProcessAscending() -
setProcessAscending
-
isProcessDescending
public boolean isProcessDescending() -
setProcessDescending
-
isExactHalfSum
public boolean isExactHalfSum() -
setExactHalfSum
-
emphasize
public void emphasize(byte[] values) -
emphasize
public void emphasize(byte[] values, int offset, int count) Emphasizes boundaries: sub-ranges ofvaluesarray with high gradient. It means, that slopes of the function, represented by this array, with a large difference in values are replaced with a step function, where the border has a width of 1.More formal specification. Let V(x) is the function from integer argument x, represented by
valuesarray: V(i)=values[i],from≤ i <to. This method finds all ranges x1..x2, where:from≤ x1 ≤ x2 <to;- the function is strictly monotone inside the range: V(x1)<V(x1+1)<...<V(x2) or
V(x1)>V(x1+1)>...>V(x2);
if property
processAscendingis cleared, first type of ranges is skipped (not changed), if propertyprocessDescendingis cleared, second type of ranges is skipped (not changed), if both are cleared, this method does nothing; - total change of the function at this range is large, i.e. |V(x1)−V(x2)|
≥
minimalChange; - length of the range x2−x1+1 ≤ D, where D =
slopeWidth, or, maybe, it is not so, butallowLongSlopesflag is set and and the following condition is fulfilled:
for every sub-range with length D the total change of the function is also large, i.e. for every x, x1≤x≤x2−D+1, we have |V(x)−V(x+D−1)| ≥minimalChange; - x1..x2 is a maximal range with this properties, i.e. for any other range x'1..x'2, where x'1<x1 and x'2>x2, one of the previous conditions is not fulfilled.
For each range x1..x2 with the specified properties this method replaces every value V(x) inside this range (x1<x<x2) with the nearest from two values V(x1) and V(x2). Values, exactly equal to (V(x1)+V(x2)/2, are replaced with V(x2).
Note: default values
minimalChange=0 andslopeWidth=1 provides emphasizing every slope, regardless on its length and value of the function change.- Parameters:
values- array to be modified.offset- index of the first element of the processed fragment of this array.count- number of elements to process.
-
emphasize
public void emphasize(byte[] values, int offset, int count, int step) -
emphasize
public void emphasize(char[] values) -
emphasize
public void emphasize(char[] values, int offset, int count) Emphasizes boundaries: sub-ranges ofvaluesarray with high gradient. It means, that slopes of the function, represented by this array, with a large difference in values are replaced with a step function, where the border has a width of 1.More formal specification. Let V(x) is the function from integer argument x, represented by
valuesarray: V(i)=values[i],from≤ i <to. This method finds all ranges x1..x2, where:from≤ x1 ≤ x2 <to;- the function is strictly monotone inside the range: V(x1)<V(x1+1)<...<V(x2) or
V(x1)>V(x1+1)>...>V(x2);
if property
processAscendingis cleared, first type of ranges is skipped (not changed), if propertyprocessDescendingis cleared, second type of ranges is skipped (not changed), if both are cleared, this method does nothing; - total change of the function at this range is large, i.e. |V(x1)−V(x2)|
≥
minimalChange; - length of the range x2−x1+1 ≤ D, where D =
slopeWidth, or, maybe, it is not so, butallowLongSlopesflag is set and and the following condition is fulfilled:
for every sub-range with length D the total change of the function is also large, i.e. for every x, x1≤x≤x2−D+1, we have |V(x)−V(x+D−1)| ≥minimalChange; - x1..x2 is a maximal range with this properties, i.e. for any other range x'1..x'2, where x'1<x1 and x'2>x2, one of the previous conditions is not fulfilled.
For each range x1..x2 with the specified properties this method replaces every value V(x) inside this range (x1<x<x2) with the nearest from two values V(x1) and V(x2). Values, exactly equal to (V(x1)+V(x2)/2, are replaced with V(x2).
Note: default values
minimalChange=0 andslopeWidth=1 provides emphasizing every slope, regardless on its length and value of the function change.- Parameters:
values- array to be modified.offset- index of the first element of the processed fragment of this array.count- number of elements to process.
-
emphasize
public void emphasize(char[] values, int offset, int count, int step) -
emphasize
public void emphasize(short[] values) -
emphasize
public void emphasize(short[] values, int offset, int count) Emphasizes boundaries: sub-ranges ofvaluesarray with high gradient. It means, that slopes of the function, represented by this array, with a large difference in values are replaced with a step function, where the border has a width of 1.More formal specification. Let V(x) is the function from integer argument x, represented by
valuesarray: V(i)=values[i],from≤ i <to. This method finds all ranges x1..x2, where:from≤ x1 ≤ x2 <to;- the function is strictly monotone inside the range: V(x1)<V(x1+1)<...<V(x2) or
V(x1)>V(x1+1)>...>V(x2);
if property
processAscendingis cleared, first type of ranges is skipped (not changed), if propertyprocessDescendingis cleared, second type of ranges is skipped (not changed), if both are cleared, this method does nothing; - total change of the function at this range is large, i.e. |V(x1)−V(x2)|
≥
minimalChange; - length of the range x2−x1+1 ≤ D, where D =
slopeWidth, or, maybe, it is not so, butallowLongSlopesflag is set and and the following condition is fulfilled:
for every sub-range with length D the total change of the function is also large, i.e. for every x, x1≤x≤x2−D+1, we have |V(x)−V(x+D−1)| ≥minimalChange; - x1..x2 is a maximal range with this properties, i.e. for any other range x'1..x'2, where x'1<x1 and x'2>x2, one of the previous conditions is not fulfilled.
For each range x1..x2 with the specified properties this method replaces every value V(x) inside this range (x1<x<x2) with the nearest from two values V(x1) and V(x2). Values, exactly equal to (V(x1)+V(x2)/2, are replaced with V(x2).
Note: default values
minimalChange=0 andslopeWidth=1 provides emphasizing every slope, regardless on its length and value of the function change.- Parameters:
values- array to be modified.offset- index of the first element of the processed fragment of this array.count- number of elements to process.
-
emphasize
public void emphasize(short[] values, int offset, int count, int step) -
emphasize
public void emphasize(int[] values) -
emphasize
public void emphasize(int[] values, int offset, int count) Emphasizes boundaries: sub-ranges ofvaluesarray with high gradient. It means, that slopes of the function, represented by this array, with a large difference in values are replaced with a step function, where the border has a width of 1.More formal specification. Let V(x) is the function from integer argument x, represented by
valuesarray: V(i)=values[i],from≤ i <to. This method finds all ranges x1..x2, where:from≤ x1 ≤ x2 <to;- the function is strictly monotone inside the range: V(x1)<V(x1+1)<...<V(x2) or
V(x1)>V(x1+1)>...>V(x2);
if property
processAscendingis cleared, first type of ranges is skipped (not changed), if propertyprocessDescendingis cleared, second type of ranges is skipped (not changed), if both are cleared, this method does nothing; - total change of the function at this range is large, i.e. |V(x1)−V(x2)|
≥
minimalChange; - length of the range x2−x1+1 ≤ D, where D =
slopeWidth, or, maybe, it is not so, butallowLongSlopesflag is set and and the following condition is fulfilled:
for every sub-range with length D the total change of the function is also large, i.e. for every x, x1≤x≤x2−D+1, we have |V(x)−V(x+D−1)| ≥minimalChange; - x1..x2 is a maximal range with this properties, i.e. for any other range x'1..x'2, where x'1<x1 and x'2>x2, one of the previous conditions is not fulfilled.
For each range x1..x2 with the specified properties this method replaces every value V(x) inside this range (x1<x<x2) with the nearest from two values V(x1) and V(x2). Values, exactly equal to (V(x1)+V(x2)/2, are replaced with V(x2).
Note: default values
minimalChange=0 andslopeWidth=1 provides emphasizing every slope, regardless on its length and value of the function change.- Parameters:
values- array to be modified.offset- index of the first element of the processed fragment of this array.count- number of elements to process.
-
emphasize
public void emphasize(int[] values, int offset, int count, int step) -
emphasize
public void emphasize(long[] values) -
emphasize
public void emphasize(long[] values, int offset, int count) Emphasizes boundaries: sub-ranges ofvaluesarray with high gradient. It means, that slopes of the function, represented by this array, with a large difference in values are replaced with a step function, where the border has a width of 1.More formal specification. Let V(x) is the function from integer argument x, represented by
valuesarray: V(i)=values[i],from≤ i <to. This method finds all ranges x1..x2, where:from≤ x1 ≤ x2 <to;- the function is strictly monotone inside the range: V(x1)<V(x1+1)<...<V(x2) or
V(x1)>V(x1+1)>...>V(x2);
if property
processAscendingis cleared, first type of ranges is skipped (not changed), if propertyprocessDescendingis cleared, second type of ranges is skipped (not changed), if both are cleared, this method does nothing; - total change of the function at this range is large, i.e. |V(x1)−V(x2)|
≥
minimalChange; - length of the range x2−x1+1 ≤ D, where D =
slopeWidth, or, maybe, it is not so, butallowLongSlopesflag is set and and the following condition is fulfilled:
for every sub-range with length D the total change of the function is also large, i.e. for every x, x1≤x≤x2−D+1, we have |V(x)−V(x+D−1)| ≥minimalChange; - x1..x2 is a maximal range with this properties, i.e. for any other range x'1..x'2, where x'1<x1 and x'2>x2, one of the previous conditions is not fulfilled.
For each range x1..x2 with the specified properties this method replaces every value V(x) inside this range (x1<x<x2) with the nearest from two values V(x1) and V(x2). Values, exactly equal to (V(x1)+V(x2)/2, are replaced with V(x2).
Note: default values
minimalChange=0 andslopeWidth=1 provides emphasizing every slope, regardless on its length and value of the function change.- Parameters:
values- array to be modified.offset- index of the first element of the processed fragment of this array.count- number of elements to process.
-
emphasize
public void emphasize(long[] values, int offset, int count, int step) -
emphasize
public void emphasize(float[] values) -
emphasize
public void emphasize(float[] values, int offset, int count) Emphasizes boundaries: sub-ranges ofvaluesarray with high gradient. It means, that slopes of the function, represented by this array, with a large difference in values are replaced with a step function, where the border has a width of 1.More formal specification. Let V(x) is the function from integer argument x, represented by
valuesarray: V(i)=values[i],from≤ i <to. This method finds all ranges x1..x2, where:from≤ x1 ≤ x2 <to;- the function is strictly monotone inside the range: V(x1)<V(x1+1)<...<V(x2) or
V(x1)>V(x1+1)>...>V(x2);
if property
processAscendingis cleared, first type of ranges is skipped (not changed), if propertyprocessDescendingis cleared, second type of ranges is skipped (not changed), if both are cleared, this method does nothing; - total change of the function at this range is large, i.e. |V(x1)−V(x2)|
≥
minimalChange; - length of the range x2−x1+1 ≤ D, where D =
slopeWidth, or, maybe, it is not so, butallowLongSlopesflag is set and and the following condition is fulfilled:
for every sub-range with length D the total change of the function is also large, i.e. for every x, x1≤x≤x2−D+1, we have |V(x)−V(x+D−1)| ≥minimalChange; - x1..x2 is a maximal range with this properties, i.e. for any other range x'1..x'2, where x'1<x1 and x'2>x2, one of the previous conditions is not fulfilled.
For each range x1..x2 with the specified properties this method replaces every value V(x) inside this range (x1<x<x2) with the nearest from two values V(x1) and V(x2). Values, exactly equal to (V(x1)+V(x2)/2, are replaced with V(x2).
Note: default values
minimalChange=0 andslopeWidth=1 provides emphasizing every slope, regardless on its length and value of the function change.- Parameters:
values- array to be modified.offset- index of the first element of the processed fragment of this array.count- number of elements to process.
-
emphasize
public void emphasize(float[] values, int offset, int count, int step) -
emphasize
public void emphasize(double[] values) -
emphasize
public void emphasize(double[] values, int offset, int count) Emphasizes boundaries: sub-ranges ofvaluesarray with high gradient. It means, that slopes of the function, represented by this array, with a large difference in values are replaced with a step function, where the border has a width of 1.More formal specification. Let V(x) is the function from integer argument x, represented by
valuesarray: V(i)=values[i],from≤ i <to. This method finds all ranges x1..x2, where:from≤ x1 ≤ x2 <to;- the function is strictly monotone inside the range: V(x1)<V(x1+1)<...<V(x2) or
V(x1)>V(x1+1)>...>V(x2);
if property
processAscendingis cleared, first type of ranges is skipped (not changed), if propertyprocessDescendingis cleared, second type of ranges is skipped (not changed), if both are cleared, this method does nothing; - total change of the function at this range is large, i.e. |V(x1)−V(x2)|
≥
minimalChange; - length of the range x2−x1+1 ≤ D, where D =
slopeWidth, or, maybe, it is not so, butallowLongSlopesflag is set and and the following condition is fulfilled:
for every sub-range with length D the total change of the function is also large, i.e. for every x, x1≤x≤x2−D+1, we have |V(x)−V(x+D−1)| ≥minimalChange; - x1..x2 is a maximal range with this properties, i.e. for any other range x'1..x'2, where x'1<x1 and x'2>x2, one of the previous conditions is not fulfilled.
For each range x1..x2 with the specified properties this method replaces every value V(x) inside this range (x1<x<x2) with the nearest from two values V(x1) and V(x2). Values, exactly equal to (V(x1)+V(x2)/2, are replaced with V(x2).
Note: default values
minimalChange=0 andslopeWidth=1 provides emphasizing every slope, regardless on its length and value of the function change.- Parameters:
values- array to be modified.offset- index of the first element of the processed fragment of this array.count- number of elements to process.
-
emphasize
public void emphasize(double[] values, int offset, int count, int step)
-