diff options
author | Noel Grandin <noel@peralex.com> | 2014-08-12 12:11:25 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-08-19 14:57:13 +0200 |
commit | 3a8d3519889a68ddf209ea7c83307bec51cd6da0 (patch) | |
tree | ab67ef1b6f1f65443b7c4d0e086fdcff17f84283 /nlpsolver | |
parent | 8b65a61788aa18e97de068bc75fdeecb20a23026 (diff) |
java: remove unused methods
Change-Id: Ibb905e6f3e7d92a0e558f1f6562e5b472cd2717b
Diffstat (limited to 'nlpsolver')
4 files changed, 0 insertions, 115 deletions
diff --git a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/GlobalString.java b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/GlobalString.java index bb7bf8d8dfe8..fc77d0f9a42e 100644 --- a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/GlobalString.java +++ b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/GlobalString.java @@ -23,7 +23,6 @@ package net.adaptivebox.global; -import java.io.*; import java.util.*; public class GlobalString { @@ -49,81 +48,4 @@ public class GlobalString { - private static int getCharLoc(char data, String str) { - for(int i=0; i<str.length(); i++) { - if(str.charAt(i)==data) return i; - } - return -1; - } - private static String trim(String origStr, String discardStr) { - String str = origStr; - do { - if(str.length()==0) return str; - if(getCharLoc(str.charAt(0), discardStr)!=-1) str = str.substring(1); - else if(getCharLoc(str.charAt(str.length()-1), discardStr)!=-1) str = str.substring(0, str.length()-1); - else {return str;} - } while(true); - } - - private static boolean getFirstCharExist(String str, String chars) throws Exception { - int neglectFirstCharLength = chars.length(); - for(int i=0; i<neglectFirstCharLength; i++) { - if(str.startsWith(chars.substring(i, i+1))) { - return true; - } - } - return false; - } - - private static String getMeaningfulLine(BufferedReader outReader, String neglectFirstChars) throws Exception { - String str; - boolean isNeglect = true; - do { - str = outReader.readLine(); - if (str==null) { - return null; - } - str = trim(str, " \t"); - if(str.length()>0) { - isNeglect = getFirstCharExist(str, neglectFirstChars); - } - } while (isNeglect); - return str; - } - - private static String[] getMeaningfulLines(String srcStr, String neglectFirstChars) throws Exception { - StringReader outStringReader = new StringReader(srcStr); - BufferedReader outReader = new BufferedReader(outStringReader); - ArrayList<String> origData = new ArrayList<String>(); - while(true) { - String str = getMeaningfulLine(outReader, neglectFirstChars); - if (str==null) { - break; - } - origData.add(str); - } - return convert1DVectorToStringArray(origData); - } - - /** - * convert vector to 1D String array - */ - private static String[] convert1DVectorToStringArray(ArrayList<String> toToConvert) { - if (toToConvert==null) return null; - String[] objs = new String[toToConvert.size()]; - for (int i=0; i<toToConvert.size(); i++) { - objs[i] = getObjString(toToConvert.get(i)); - } - return(objs); - } - - private static String getObjString(Object nObj) { - if(nObj instanceof String) return (String)nObj; - return nObj.toString(); - } - - - - - }
\ No newline at end of file diff --git a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/RandomGenerator.java b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/RandomGenerator.java index 549d9e14c89d..448ae01d9d64 100644 --- a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/RandomGenerator.java +++ b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/RandomGenerator.java @@ -53,17 +53,6 @@ public static double doubleRangeRandom(double lowLimit,double upLimit){ - private static int[] randomSelection(int[] totalIndices, int times) { - if (times>=totalIndices.length) { - return totalIndices; - } - int[] indices = randomSelection(totalIndices.length, times); - for(int i=0; i<indices.length; i++) { - indices[i] = totalIndices[indices[i]]; - } - return indices; - } - public static int[] randomSelection(int maxNum, int times) { if(times<=0) return new int[0]; int realTimes = Math.min(maxNum, times); diff --git a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/space/DesignSpace.java b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/space/DesignSpace.java index d2e3f5a55fe2..bc17ebd2f03b 100644 --- a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/space/DesignSpace.java +++ b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/space/DesignSpace.java @@ -51,16 +51,6 @@ public class DesignSpace { return dimProps[dim].paramBound.boundAdjust(val); } - private void annulusAdjust (double[] location){ - for (int i=0; i<getDimension(); i++) { - location[i] = dimProps[i].paramBound.annulusAdjust(location[i]); - } - } - - - - - public void mutationAt(double[] location, int i){ location[i] = dimProps[i].paramBound.getRandomValue(); } diff --git a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseNLPSolver.java b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseNLPSolver.java index 8a85b5ad2d87..8794beb96e0c 100644 --- a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseNLPSolver.java +++ b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseNLPSolver.java @@ -45,7 +45,6 @@ import com.sun.star.lang.XMultiComponentFactory; import com.sun.star.lib.uno.helper.WeakBase; import com.sun.star.sheet.SolverConstraint; import com.sun.star.sheet.SolverConstraintOperator; -import com.sun.star.sheet.XCellRangeData; import com.sun.star.sheet.XSpreadsheet; import com.sun.star.sheet.XSpreadsheetDocument; import com.sun.star.sheet.XSpreadsheets; @@ -362,21 +361,6 @@ public abstract class BaseNLPSolver extends WeakBase - private XCellRangeData getCellRangeData(int sheet, int startCol, int startRow, int endCol, int endRow) { - try { - XSpreadsheets xSpreadsheets = m_document.getSheets(); - XIndexAccess xSheetIndex = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); - XSpreadsheet xSpreadsheet = UnoRuntime.queryInterface(XSpreadsheet.class, xSheetIndex.getByIndex(sheet)); - return UnoRuntime.queryInterface(XCellRangeData.class, xSpreadsheet.getCellRangeByPosition(startCol, startRow, endCol, endRow)); - } catch (IndexOutOfBoundsException ex) { - Logger.getLogger(BaseNLPSolver.class.getName()).log(Level.SEVERE, null, ex); - } catch (WrappedTargetException ex) { - Logger.getLogger(BaseNLPSolver.class.getName()).log(Level.SEVERE, null, ex); - } - - return null; - } - private XChartDataArray getChartDataArray(CellRangeAddress cellRangeAddress) { return getChartDataArray(cellRangeAddress.Sheet, cellRangeAddress.StartColumn, cellRangeAddress.StartRow, cellRangeAddress.EndColumn, cellRangeAddress.EndRow); |