summaryrefslogtreecommitdiff
path: root/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/BasicArray.java
diff options
context:
space:
mode:
Diffstat (limited to 'nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/BasicArray.java')
-rwxr-xr-xnlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/BasicArray.java31
1 files changed, 31 insertions, 0 deletions
diff --git a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/BasicArray.java b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/BasicArray.java
new file mode 100755
index 000000000000..4071cf8c7540
--- /dev/null
+++ b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/BasicArray.java
@@ -0,0 +1,31 @@
+/**
+ * Description: basic operations on Arrays
+ *
+ * @ Author Create/Modi Note
+ * Xiaofeng Xie Oct. 9, 2002
+ *
+ */
+
+package net.adaptivebox.global;
+
+public class BasicArray {
+ public static double getMinValue(double[] v) {
+ double mv = Double.MAX_VALUE;
+ for (int i=0; i<v.length; i++) {
+ if (v[i]<mv) {
+ mv=v[i];
+ }
+ }
+ return mv;
+ }
+ public static double getMaxValue(double[] v) {
+ double mv = -Double.MAX_VALUE;
+ for (int i=0; i<v.length; i++) {
+ if (v[i]>mv) {
+ mv=v[i];
+ }
+ }
+ return mv;
+ }
+
+} \ No newline at end of file