List of usage examples for java.util TreeMap TreeMap
public TreeMap()
From source file:edu.northwestern.bioinformatics.studycalendar.domain.Gender.java
public static Map<String, String[]> getGenderValueMap() { Map<String, String[]> genders = new TreeMap<String, String[]>(); genders.put(Gender.MALE.getCode(), Gender.MALE.getVariations()); genders.put(Gender.FEMALE.getCode(), Gender.FEMALE.getVariations()); genders.put(Gender.NOT_REPORTED.getCode(), Gender.NOT_REPORTED.getVariations()); genders.put(Gender.UNKNOWN.getCode(), Gender.UNKNOWN.getVariations()); return genders; }
From source file:adalid.util.meta.sql.PlatformBean.java
public PlatformBean(String name, File propertiesFile) { _name = name; _propertiesFile = propertiesFile; _templates = new TreeMap<>(); }
From source file:com.github.tteofili.p2h.Par2HierUtils.java
/** * perform PCA using SVD//w w w .j a v a2 s . co m * * @param weightTable the weights to scale * @param k the target vector dimensions * @return a weight table doc->reduced vector */ static Map<String, INDArray> svdPCA(Map<String, INDArray> weightTable, int k) { Map<String, INDArray> reducedVectors = new TreeMap<>(); INDArray matrix = null; int i = 0; for (Map.Entry<String, INDArray> entry : weightTable.entrySet()) { INDArray vector = entry.getValue(); if (matrix == null) { matrix = Nd4j.zeros(weightTable.size(), vector.columns()); } matrix.putRow(i, vector); i++; } int j = 0; INDArray reducedMatrix = Nd4j.create(getTruncatedUT(matrix, k)); for (Map.Entry<String, INDArray> entry : weightTable.entrySet()) { reducedVectors.put(entry.getKey(), reducedMatrix.getRow(j)); j++; } return reducedVectors; }
From source file:it.polimi.diceH2020.SPACE4Cloud.shared.inputDataMultiProvider.JobProfile.java
public JobProfile() { profileMap = new TreeMap<String, Double>(); }
From source file:com.enonic.cms.core.RequestParameters.java
public RequestParameters(RequestParameters requestParameters) { parameters = new TreeMap<String, Param>(); for (Param param : requestParameters.parameters.values()) { parameters.put(param.getName(), param); }/* w w w .j a v a 2 s. c om*/ }
From source file:com.biomeris.i2b2.export.engine.session.WSessionManager.java
public WSessionManager() { sessions = new TreeMap<String, WSession>(); // read temp dire location from cell properties InputStream is_i2b2 = ExportRunnable.class.getClassLoader() .getResourceAsStream("conf/exportcell.properties"); Properties exportCellProperties = new Properties(); try {/*from www .j a v a 2 s . c o m*/ exportCellProperties.load(is_i2b2); } catch (IOException e) { e.printStackTrace(); } String downloadtDirPath = exportCellProperties.getProperty("exportcell.download.dir"); downloadDir = new File(downloadtDirPath); try { int timeoutMins = Integer .parseInt(exportCellProperties.getProperty("exportcell.session.timeout.minutes")); timeoutMillis = timeoutMins * 60 * 1000; } catch (NumberFormatException e) { timeoutMillis = TIMEOUT_MILLIS_DEFAULT; } }
From source file:net.proest.librepilot.web.serialize.UAVTalkInstanceSerializer.java
public UAVTalkInstanceSerializer() { fields = new TreeMap<>(); }
From source file:net.proest.librepilot.web.serialize.UAVTalkObjectSerializer.java
public UAVTalkObjectSerializer() { instances = new TreeMap<>(); }
From source file:com.opengamma.analytics.math.statistics.descriptive.ModeCalculator.java
/** * @param x The array of data, not null or empty * @return The arithmetic mean/* www.java2 s. c o m*/ */ @Override public Double evaluate(final double[] x) { Validate.notNull(x, "x"); Validate.isTrue(x.length > 0, "x cannot be empty"); if (x.length == 1) { return x[0]; } final double[] x1 = Arrays.copyOf(x, x.length); Arrays.sort(x1); final TreeMap<Integer, Double> counts = new TreeMap<Integer, Double>(); int count = 1; for (int i = 1; i < x1.length; i++) { if (Math.abs(x1[i] - x1[i - 1]) < EPS) { count++; } else { counts.put(count, x1[i - 1]); count = 1; } } if (counts.lastKey() == 1) { throw new MathException("Could not find mode for array; no repeated values"); } return counts.lastEntry().getValue(); }
From source file:net.proest.librepilot.web.serialize.UAVTalkFieldSerializer.java
public UAVTalkFieldSerializer() { elements = new TreeMap<>(); }