Skip to content
Snippets Groups Projects
Commit 46d5ffff authored by helene ortiz's avatar helene ortiz
Browse files

No commit message

No commit message
parent e588f6ef
No related branches found
No related tags found
No related merge requests found
......@@ -27,7 +27,9 @@ public abstract class Array {
public static int INIT_ZERO = 0;
public static int INIT_INCR = 1;
/**
* Reset min and max values when the array content changes.
*/
protected void resetMinAndMaxValues() {
minValue = Float.MAX_VALUE;
maxValue = Float.MIN_VALUE;
......
......@@ -63,6 +63,7 @@ public class Float32Array extends Array {
}
public float getMinValue() {
// If min value equals the maximum float value, that means that it hasn't been found yet
if (minValue == Float.MAX_VALUE) {
int size = array.length;
for (int i = 0; i < size; i++) {
......@@ -75,6 +76,7 @@ public class Float32Array extends Array {
}
public float getMaxValue() {
// If max value equals the minimum float value, that means that it hasn't been found yet
if (maxValue == Float.MIN_VALUE) {
int size = array.length;
for (int i = 0; i < size; i++) {
......
......@@ -63,6 +63,7 @@ public class Float64Array extends Array {
}
public float getMinValue() {
// If min value equals the maximum float value, that means that it hasn't been found yet
if (minValue == Float.MAX_VALUE) {
int size = array.length;
for (int i = 0; i < size; i++) {
......@@ -75,6 +76,7 @@ public class Float64Array extends Array {
}
public float getMaxValue() {
// If max value equals the minimum float value, that means that it hasn't been found yet
if (maxValue == Float.MIN_VALUE) {
int size = array.length;
for (int i = 0; i < size; i++) {
......
......@@ -63,6 +63,7 @@ public class Int16Array extends Array {
}
public float getMinValue() {
// If min value equals the maximum float value, that means that it hasn't been found yet
if (minValue == Float.MAX_VALUE) {
int size = array.length;
for (int i = 0; i < size; i++) {
......@@ -75,6 +76,7 @@ public class Int16Array extends Array {
}
public float getMaxValue() {
// If max value equals the minimum float value, that means that it hasn't been found yet
if (maxValue == Float.MIN_VALUE) {
int size = array.length;
for (int i = 0; i < size; i++) {
......
......@@ -63,6 +63,7 @@ public class Int32Array extends Array {
}
public float getMinValue() {
// If min value equals the maximum float value, that means that it hasn't been found yet
if (minValue == Float.MAX_VALUE) {
int size = array.length;
for (int i = 0; i < size; i++) {
......@@ -75,6 +76,7 @@ public class Int32Array extends Array {
}
public float getMaxValue() {
// If max value equals the minimum float value, that means that it hasn't been found yet
if (maxValue == Float.MIN_VALUE) {
int size = array.length;
for (int i = 0; i < size; i++) {
......
......@@ -63,6 +63,7 @@ public class Int64Array extends Array {
}
public float getMinValue() {
// If min value equals the maximum float value, that means that it hasn't been found yet
if (minValue == Float.MAX_VALUE) {
int size = array.length;
for (int i = 0; i < size; i++) {
......@@ -75,6 +76,7 @@ public class Int64Array extends Array {
}
public float getMaxValue() {
// If max value equals the minimum float value, that means that it hasn't been found yet
if (maxValue == Float.MIN_VALUE) {
int size = array.length;
for (int i = 0; i < size; i++) {
......
......@@ -63,6 +63,7 @@ public class Int8Array extends Array {
}
public float getMinValue() {
// If min value equals the maximum float value, that means that it hasn't been found yet
if (minValue == Float.MAX_VALUE) {
int size = array.length;
for (int i = 0; i < size; i++) {
......@@ -75,6 +76,7 @@ public class Int8Array extends Array {
}
public float getMaxValue() {
// If max value equals the minimum float value, that means that it hasn't been found yet
if (maxValue == Float.MIN_VALUE) {
int size = array.length;
for (int i = 0; i < size; i++) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment