id
stringlengths
7
14
text
stringlengths
1
106k
590532_2
protected static long getNumericType(String raw) { if (raw.contains(RemoteParticipant.RemoteParticipant_TYPE_CALL)) { return TYPE_CALL; } else if (raw.contains(RemoteParticipant.RemoteParticipant_TYPE_CONFERENCE)) { return TYPE_CONFERENCE; } else if (raw.contains(RemoteParticipant.RemoteParticipant_TYPE_DIALOG...
590532_3
protected static String shorten(BigInteger number) { StringBuilder builder = new StringBuilder(); int url; do { url = number.mod(new BigInteger("36")).intValue(); number = number.divide(new BigInteger("36")); builder.append(alphabet.charAt(url)); } while (number.compareTo(BigInteger.ZERO) > 0); return bu...
590532_4
public static String encode(String raw) { String[] parts = parseId(raw); return shorten(toBigInteger(parts[0])) + "-" + shorten(toBigInteger(parts[1], parts[2])) + "-" + shorten(new BigInteger(parts[3])); }
590532_5
@Override public Contact getContact(Endpoint addr, Endpoint contact) { HColumn<String, Object> result = queryResult(addr, contact); if (result == null) { return null; } return (Contact) result.getValue(); }
590532_6
@Override public boolean isExisting(Endpoint addr, Contact contact) { CountQuery<String, Object> query = HFactory.createCountQuery(_keyspace, STRING_SERIALIZER, OBJECT_SERIALIZER); query.setColumnFamily(DEFAULT_COLUMN_FAMILY_NAME); query.setKey(getCleanUri(addr)); query.setRange(contact.getEndpoint().ge...
591784_0
public CollectResult collectDependencies( RepositorySystemSession session, CollectRequest request ) throws DependencyCollectionException { session = optimizeSession( session ); RequestTrace trace = DefaultRequestTrace.newChild( request.getTrace(), request ); CollectResult result = new CollectResult( req...
591784_1
public CollectResult collectDependencies( RepositorySystemSession session, CollectRequest request ) throws DependencyCollectionException { session = optimizeSession( session ); RequestTrace trace = DefaultRequestTrace.newChild( request.getTrace(), request ); CollectResult result = new CollectResult( req...
591784_2
public CollectResult collectDependencies( RepositorySystemSession session, CollectRequest request ) throws DependencyCollectionException { session = optimizeSession( session ); RequestTrace trace = DefaultRequestTrace.newChild( request.getTrace(), request ); CollectResult result = new CollectResult( req...
591784_3
public CollectResult collectDependencies( RepositorySystemSession session, CollectRequest request ) throws DependencyCollectionException { session = optimizeSession( session ); RequestTrace trace = DefaultRequestTrace.newChild( request.getTrace(), request ); CollectResult result = new CollectResult( req...
591784_4
public CollectResult collectDependencies( RepositorySystemSession session, CollectRequest request ) throws DependencyCollectionException { session = optimizeSession( session ); RequestTrace trace = DefaultRequestTrace.newChild( request.getTrace(), request ); CollectResult result = new CollectResult( req...
591784_5
public CollectResult collectDependencies( RepositorySystemSession session, CollectRequest request ) throws DependencyCollectionException { session = optimizeSession( session ); RequestTrace trace = DefaultRequestTrace.newChild( request.getTrace(), request ); CollectResult result = new CollectResult( req...
591784_6
public CollectResult collectDependencies( RepositorySystemSession session, CollectRequest request ) throws DependencyCollectionException { session = optimizeSession( session ); RequestTrace trace = DefaultRequestTrace.newChild( request.getTrace(), request ); CollectResult result = new CollectResult( req...
591784_7
public CollectResult collectDependencies( RepositorySystemSession session, CollectRequest request ) throws DependencyCollectionException { session = optimizeSession( session ); RequestTrace trace = DefaultRequestTrace.newChild( request.getTrace(), request ); CollectResult result = new CollectResult( req...
591784_8
public List<MetadataResult> resolveMetadata( RepositorySystemSession session, Collection<? extends MetadataRequest> requests ) { SyncContext syncContext = syncContextFactory.newInstance( session, false ); try { Collection<Metadata> metadata = new ArrayLis...
591784_9
private List<MetadataResult> resolve( RepositorySystemSession session, Collection<? extends MetadataRequest> requests ) { List<MetadataResult> results = new ArrayList<MetadataResult>( requests.size() ); List<ResolveTask> tasks = new ArrayList<ResolveTask>( requests.size() )...
597631_0
public SimpleGapPenalty() { this(dgop, dgep); }
597631_1
@Override public Type getType() { return type; }
597631_2
public NeedlemanWunsch() { }
597631_3
public GuideTree(List<S> sequences, List<PairwiseSequenceScorer<S, C>> scorers) { this.sequences = Collections.unmodifiableList(sequences); this.scorers = Collections.unmodifiableList(scorers); distances = new BasicSymmetricalDistanceMatrix(sequences.size()); BasicSymmetricalDistanceMatrix distclone = n...
597631_4
public int[] getAllPairsScores() { int[] scores = new int[scorers.size()]; int n = 0; for (PairwiseSequenceScorer<S, C> scorer : scorers) { scores[n++] = scorer.getScore(); } return scores; }
597631_5
public double[][] getDistanceMatrix() { double[][] matrix = new double[distances.getSize()][distances.getSize()]; for (int i = 0; i < matrix.length; i++) { for (int j = i+1; j < matrix.length; j++) { matrix[i][j] = matrix[j][i] = distances.getValue(i, j); } } return matrix; }
597631_6
public Node getRoot() { return root; }
597631_7
public int[][] getScoreMatrix() { int[][] matrix = new int[sequences.size()][sequences.size()]; for (int i = 0, n = 0; i < matrix.length; i++) { matrix[i][i] = scorers.get(i).getMaxScore(); for (int j = i+1; j < matrix.length; j++) { matrix[i][j] = matrix[j][i] = scorers.get(n++).get...
597631_8
public List<S> getSequences() { return sequences; }
597631_9
@Override public Iterator<GuideTreeNode<S, C>> iterator() { return new PostOrderIterator(); }
608316_0
@Override public void put(K key, T obj) throws IOException { getDatumWriter().write(obj, getEncoder()); }
608316_1
@Override public void close() throws IOException { super.close(); if(encoder != null) { encoder.flush(); } encoder = null; decoder = null; }
608316_2
public static byte[] readFully(InputStream in) throws IOException { List<ByteBuffer> buffers = new ArrayList<ByteBuffer>(4); while(true) { ByteBuffer buffer = ByteBuffer.allocate(BUFFER_SIZE); int count = in.read(buffer.array(), 0, BUFFER_SIZE); if(count > 0) { buffer.limit(count); buffers.a...
608316_3
@Override public void setLimit(long limit) { baseQuery.setLimit(limit); }
608316_4
@SuppressWarnings("unchecked") public static <D extends DataStore<K,T>, K, T extends Persistent> D getDataStore( Class<D> dataStoreClass, Class<K> keyClass, Class<T> persistentClass) { int hash = getDataStoreKey(dataStoreClass, keyClass, persistentClass); D dataStore = (D) dataStores.get(hash); if(dataStore =...
608316_5
@SuppressWarnings("unchecked") public static <D extends DataStore<K,T>, K, T extends Persistent> D getDataStore( Class<D> dataStoreClass, Class<K> keyClass, Class<T> persistentClass) { int hash = getDataStoreKey(dataStoreClass, keyClass, persistentClass); D dataStore = (D) dataStores.get(hash); if(dataStore =...
608316_6
@SuppressWarnings("unchecked") public static <D extends DataStore<K,T>, K, T extends Persistent> D getDataStore( Class<D> dataStoreClass, Class<K> keyClass, Class<T> persistentClass) { int hash = getDataStoreKey(dataStoreClass, keyClass, persistentClass); D dataStore = (D) dataStores.get(hash); if(dataStore =...
608316_7
@SuppressWarnings("unchecked") public static <D extends DataStore<K,T>, K, T extends Persistent> D getDataStore( Class<D> dataStoreClass, Class<K> keyClass, Class<T> persistentClass) { int hash = getDataStoreKey(dataStoreClass, keyClass, persistentClass); D dataStore = (D) dataStores.get(hash); if(dataStore =...
608316_8
private static Properties readProperties() throws IOException { Properties properties = new Properties(); if(propertiesFile != null) { InputStream stream = DataStoreFactory.class.getClassLoader() .getResourceAsStream(propertiesFile); if(stream != null) { try { properties.load(stream); ...
608316_9
public static String findProperty(Properties properties , DataStore<?, ?> store, String baseKey, String defaultValue) { //recursively try the class names until the base class Class<?> clazz = store.getClass(); while(true) { String fullKey = GORA + "." + org.gora.util.StringUtils.getClassname(clazz) + "." ...
608843_0
public static Unsafe getUnsafe() { /* * Only code on the bootclasspath is allowed to get at the * Unsafe instance. */ ClassLoader calling = VMStack.getCallingClassLoader(); if ((calling != null) && (calling != Unsafe.class.getClassLoader())) { throw new SecurityException("Unsafe acces...
608843_1
public static Unsafe getUnsafe() { /* * Only code on the bootclasspath is allowed to get at the * Unsafe instance. */ ClassLoader calling = VMStack.getCallingClassLoader(); if ((calling != null) && (calling != Unsafe.class.getClassLoader())) { throw new SecurityException("Unsafe acces...
608843_2
;
608843_3
public native void setIntArray(int address, int[] ints, int offset, throws NullPointerException, ;
608843_4
public native void setShortArray(int address, short[] shorts, int offset, throws NullPointerException, ;
618103_0
@Override protected Void doInBackground(final String... args) { errors = new ArrayList<>(); List<Bank> banks; if (bankId != -1) { banks = new ArrayList<>(); banks.add(getBankFromDb(bankId, parent)); } else { banks = getBanksFromDb(parent); } getDialog().setMax(banks.size(...
618103_1
@Override protected Void doInBackground(final String... args) { errors = new ArrayList<>(); List<Bank> banks; if (bankId != -1) { banks = new ArrayList<>(); banks.add(getBankFromDb(bankId, parent)); } else { banks = getBanksFromDb(parent); } getDialog().setMax(banks.size(...
618103_2
@Override protected Void doInBackground(final String... args) { errors = new ArrayList<>(); List<Bank> banks; if (bankId != -1) { banks = new ArrayList<>(); banks.add(getBankFromDb(bankId, parent)); } else { banks = getBanksFromDb(parent); } getDialog().setMax(banks.size(...
618103_3
@Override protected Void doInBackground(final String... args) { errors = new ArrayList<>(); List<Bank> banks; if (bankId != -1) { banks = new ArrayList<>(); banks.add(getBankFromDb(bankId, parent)); } else { banks = getBanksFromDb(parent); } getDialog().setMax(banks.size(...
618103_4
public static void blameBankdroid(Throwable exception) { Throwable ultimateCause = getUltimateCause(exception); if (ultimateCause == null) { // Unable to find ultimate cause, never mind return; } StackTraceElement[] bankdroidifiedStacktrace = bankdroidifyStacktrace(ultimateCa...
618103_5
public static void blameBankdroid(Throwable exception) { Throwable ultimateCause = getUltimateCause(exception); if (ultimateCause == null) { // Unable to find ultimate cause, never mind return; } StackTraceElement[] bankdroidifiedStacktrace = bankdroidifyStacktrace(ultimateCa...
618103_6
public static void blameBankdroid(Throwable exception) { Throwable ultimateCause = getUltimateCause(exception); if (ultimateCause == null) { // Unable to find ultimate cause, never mind return; } StackTraceElement[] bankdroidifiedStacktrace = bankdroidifyStacktrace(ultimateCa...
618103_7
@VisibleForTesting @NonNull static StackTraceElement[] bankdroidifyStacktrace(final StackTraceElement[] rawStack) { for (int i = 0; i < rawStack.length; i++) { StackTraceElement stackTraceElement = rawStack[i]; if (stackTraceElement.getClassName().startsWith(PREFIX)) { return Arrays.copy...
618103_8
@Nullable @VisibleForTesting static <T extends Throwable> T cloneException(T wrapMe) { Class<?> newClass = wrapMe.getClass(); while (newClass != null) { try { T returnMe = (T) newClass.getConstructor(String.class).newInstance(wrapMe.getMessage()); returnMe.set...
618103_9
@Nullable @VisibleForTesting static <T extends Throwable> T cloneException(T wrapMe) { Class<?> newClass = wrapMe.getClass(); while (newClass != null) { try { T returnMe = (T) newClass.getConstructor(String.class).newInstance(wrapMe.getMessage()); returnMe.set...
618492_0
public static String updateUrl(String url, Properties props) { String result = url; // max connections. final String maxConnections = props.getProperty("mongodb.maxconnections", UNAVAILABLE).toLowerCase(); if (!UNAVAILABLE.equals(maxConnections)) { result = addUrlOption(result, "maxPoolSize", maxConne...
618492_1
public static String updateUrl(String url, Properties props) { String result = url; // max connections. final String maxConnections = props.getProperty("mongodb.maxconnections", UNAVAILABLE).toLowerCase(); if (!UNAVAILABLE.equals(maxConnections)) { result = addUrlOption(result, "maxPoolSize", maxConne...
618492_2
public static String updateUrl(String url, Properties props) { String result = url; // max connections. final String maxConnections = props.getProperty("mongodb.maxconnections", UNAVAILABLE).toLowerCase(); if (!UNAVAILABLE.equals(maxConnections)) { result = addUrlOption(result, "maxPoolSize", maxConne...
618492_3
public static String updateUrl(String url, Properties props) { String result = url; // max connections. final String maxConnections = props.getProperty("mongodb.maxconnections", UNAVAILABLE).toLowerCase(); if (!UNAVAILABLE.equals(maxConnections)) { result = addUrlOption(result, "maxPoolSize", maxConne...
618492_4
@Override public Status read(String table, String endpoint, Set<String> fields, Map<String, ByteIterator> result) { int responseCode; try { responseCode = httpGet(urlPrefix + endpoint, result); } catch (Exception e) { responseCode = handleExceptions(e, urlPrefix + endpoint, HttpMethod.GET); } if (logE...
618492_5
@Override public Status read(String table, String endpoint, Set<String> fields, Map<String, ByteIterator> result) { int responseCode; try { responseCode = httpGet(urlPrefix + endpoint, result); } catch (Exception e) { responseCode = handleExceptions(e, urlPrefix + endpoint, HttpMethod.GET); } if (logE...
618492_6
@Override public Status read(String table, String endpoint, Set<String> fields, Map<String, ByteIterator> result) { int responseCode; try { responseCode = httpGet(urlPrefix + endpoint, result); } catch (Exception e) { responseCode = handleExceptions(e, urlPrefix + endpoint, HttpMethod.GET); } if (logE...
618492_7
@Override public Status read(String table, String endpoint, Set<String> fields, Map<String, ByteIterator> result) { int responseCode; try { responseCode = httpGet(urlPrefix + endpoint, result); } catch (Exception e) { responseCode = handleExceptions(e, urlPrefix + endpoint, HttpMethod.GET); } if (logE...
618492_8
@Override public Status insert(String table, String endpoint, Map<String, ByteIterator> values) { int responseCode; try { responseCode = httpExecute(new HttpPost(urlPrefix + endpoint), values.get("data").toString()); } catch (Exception e) { responseCode = handleExceptions(e, urlPrefix + endpoint, HttpMeth...
618492_9
@Override public Status insert(String table, String endpoint, Map<String, ByteIterator> values) { int responseCode; try { responseCode = httpExecute(new HttpPost(urlPrefix + endpoint), values.get("data").toString()); } catch (Exception e) { responseCode = handleExceptions(e, urlPrefix + endpoint, HttpMeth...
618681_0
public String enhance(String input, String lang) { if (input == null) return null; if (input.isEmpty()) return ""; if (lang == null || lang.isEmpty()) return input; List<String> rules = loader.loadNBSP(lang); if (rules == null) return input; for (String r : rules) { Matcher m = Pattern.compile(r).matcher(input)...
618681_1
public String enhance(String input, String lang) { if (input == null) return null; if (input.isEmpty()) return ""; if (lang == null || lang.isEmpty()) return input; List<String> rules = loader.loadNBSP(lang); if (rules == null) return input; for (String r : rules) { Matcher m = Pattern.compile(r).matcher(input)...
618681_2
public String enhance(String input, String lang) { if (input == null) return null; if (input.isEmpty()) return ""; if (lang == null || lang.isEmpty()) return input; List<String> rules = loader.loadNBSP(lang); if (rules == null) return input; for (String r : rules) { Matcher m = Pattern.compile(r).matcher(input)...
618681_3
public String enhance(String input, String lang) { if (input == null) return null; if (input.isEmpty()) return ""; if (lang == null || lang.isEmpty()) return input; List<String> rules = loader.loadNBSP(lang); if (rules == null) return input; for (String r : rules) { Matcher m = Pattern.compile(r).matcher(input)...
618681_4
public String enhance(String input, String lang) { if (input == null) return null; if (input.isEmpty()) return ""; if (lang == null || lang.isEmpty()) return input; List<String> rules = loader.loadNBSP(lang); if (rules == null) return input; for (String r : rules) { Matcher m = Pattern.compile(r).matcher(input)...
618681_5
public String enhance(String input, String lang) { if (input == null) return null; if (input.isEmpty()) return ""; if (lang == null || lang.isEmpty()) return input; List<String> rules = loader.loadNBSP(lang); if (rules == null) return input; for (String r : rules) { Matcher m = Pattern.compile(r).matcher(input)...
618681_6
@Override public List<String> loadNBSP(String lang) { if (lang == null || lang.isEmpty()) { throw new IllegalArgumentException("Lang must be filled to search for file!"); } List<String> result = loadForKey(lang); if (result == null) { int index = lang.indexOf('_'); if (index < 0) return null; // cannot split ...
618681_7
@Override public List<String> loadNBSP(String lang) { if (lang == null || lang.isEmpty()) { throw new IllegalArgumentException("Lang must be filled to search for file!"); } List<String> result = loadForKey(lang); if (result == null) { int index = lang.indexOf('_'); if (index < 0) return null; // cannot split ...
618681_8
@Override public List<String> loadNBSP(String lang) { if (lang == null || lang.isEmpty()) { throw new IllegalArgumentException("Lang must be filled to search for file!"); } List<String> result = loadForKey(lang); if (result == null) { int index = lang.indexOf('_'); if (index < 0) return null; // cannot split ...
618681_9
@Override public List<String> loadNBSP(String lang) { if (lang == null || lang.isEmpty()) { throw new IllegalArgumentException("Lang must be filled to search for file!"); } List<String> result = loadForKey(lang); if (result == null) { int index = lang.indexOf('_'); if (index < 0) return null; // cannot split ...
620505_0
private List<String> getHosts(List<NodeMetadata> nodes) { return Lists.transform(Lists.newArrayList(nodes), ew Function<NodeMetadata, String>() { @Override public String apply(NodeMetadata node) { tring publicIp = Iterables.get(node.getPublicAddresses(), 0) .getHostName(); eturn String.format("%s:%d", publi...
625665_0
protected void resize(int newcount) { byte newbuf[] = new byte[Math.max(buf.length << 1, newcount)]; System.arraycopy(buf, 0, newbuf, 0, pos); buf = newbuf; }
643234_0
public void archive(File archive, File directory) { try { ArchiveOutputStream out = factory.createArchiveOutputStream(ARCHIVER_NAME, new FileOutputStream(archive)); List<File> files = listContent(directory); for (File file : files) { if (!file.isDirectory()) { ZipArchiveEntry entry = new ZipArchiveEnt...
643234_1
public void delete(List<File> files) { for (File file: files) { deleteFile(file); } }
643234_2
public List<File> upload(List<FileItem> fileItems, List<String> errors) { List<File> files = new ArrayList<File>(); File directory = uploadDirectory(); for (FileItem item : fileItems) { try { File file = writeItemToFile(directory, item); monitor.fileUploaded(file); ...
643234_3
public String resourceAsString(String relativePath) { String resourcePath = resolvePath(relativePath); try { try { return classpathResource(resourcePath); } catch (ResourceNotFoundException e) { return filesystemResource(resourcePath); } } catch (IOException e) { throw new ResourceRetrievalFailedExcept...
643234_4
public String resourceAsString(String relativePath) { String resourcePath = resolvePath(relativePath); try { try { return classpathResource(resourcePath); } catch (ResourceNotFoundException e) { return filesystemResource(resourcePath); } } catch (IOException e) { throw new ResourceRetrievalFailedExcept...
643234_5
public String resourceAsString(String relativePath) { String resourcePath = resolvePath(relativePath); try { try { return classpathResource(resourcePath); } catch (ResourceNotFoundException e) { return filesystemResource(resourcePath); } } catch (IOException e) { throw new ResourceRetrievalFailedExcept...
643234_6
public String resourceAsString(String relativePath) { String resourcePath = resolvePath(relativePath); try { try { return classpathResource(resourcePath); } catch (ResourceNotFoundException e) { return filesystemResource(resourcePath); } } catch (IOException e) { throw new ResourceRetrievalFailedExcept...
643234_7
public String resourceAsString(String relativePath) { String resourcePath = resolvePath(relativePath); try { try { return classpathResource(resourcePath); } catch (ResourceNotFoundException e) { return filesystemResource(resourcePath); } } catch (IOException e) { throw new ResourceRetrievalFailedExcept...
643234_8
public String resourceAsString(String relativePath) { String resourcePath = resolvePath(relativePath); try { try { return classpathResource(resourcePath); } catch (ResourceNotFoundException e) { return filesystemResource(resourcePath); } } catch (IOException e) { throw new ResourceRetrievalFailedExcept...
643234_9
public String resourceAsString(String relativePath) { String resourcePath = resolvePath(relativePath); try { try { return classpathResource(resourcePath); } catch (ResourceNotFoundException e) { return filesystemResource(resourcePath); } } catch (IOException e) { throw new ResourceRetrievalFailedExcept...
651333_0
public static Expression parse(String text) { text = text.replaceAll("\\s*,\\s*", ","); StringTokenizer st = new StringTokenizer(text, "$%,\'[])", true); MethodExpression root = new MethodExpression("eval"); Stack<MethodExpression> stack = new Stack<MethodExpression>(); stack.push(root); try { ...
651333_1
public static Expression parse(String text) { text = text.replaceAll("\\s*,\\s*", ","); StringTokenizer st = new StringTokenizer(text, "$%,\'[])", true); MethodExpression root = new MethodExpression("eval"); Stack<MethodExpression> stack = new Stack<MethodExpression>(); stack.push(root); try { ...
651333_2
public static Expression parse(String text) { text = text.replaceAll("\\s*,\\s*", ","); StringTokenizer st = new StringTokenizer(text, "$%,\'[])", true); MethodExpression root = new MethodExpression("eval"); Stack<MethodExpression> stack = new Stack<MethodExpression>(); stack.push(root); try { ...
651333_3
public static Expression parse(String text) { text = text.replaceAll("\\s*,\\s*", ","); StringTokenizer st = new StringTokenizer(text, "$%,\'[])", true); MethodExpression root = new MethodExpression("eval"); Stack<MethodExpression> stack = new Stack<MethodExpression>(); stack.push(root); try { ...
651333_4
public static Expression parse(String text) { text = text.replaceAll("\\s*,\\s*", ","); StringTokenizer st = new StringTokenizer(text, "$%,\'[])", true); MethodExpression root = new MethodExpression("eval"); Stack<MethodExpression> stack = new Stack<MethodExpression>(); stack.push(root); try { ...
657157_0
@Override public org.apache.lucene.search.Query parse(String query) throws ParseException { String q = ""; for (int i = 0; i < query.length(); i++) { if (query.charAt(i) == '"' && i + 1 < query.length() && !Character.isWhitespace(query.charAt(i + 1))) { if (i > 0 && !Character.isWhitespace(q...
657157_1
public Lemmatizer(final DictHebMorph dict) { this.dictHeb = dict; }
657157_2
public void addSpecialCase(final String token) { if (token.length() > TOKENIZATION_EXCEPTION_MAX_LENGTH) throw new IllegalArgumentException("Special tokenization rule must be at most " + TOKENIZATION_EXCEPTION_MAX_LENGTH + " in length"); if (token.contains(" ")) throw new Illegal...
662539_0
static double[][] reduceSpectralMeansToWLs(double[][] spectralMeans, int[] useIndices) { double[][] reducedSpectralMeans = new double[useIndices.length][]; for (int i = 0; i < useIndices.length; i++) { reducedSpectralMeans[i] = spectralMeans[useIndices[i]]; } return reducedSpectralMeans; }
662539_1
static double[][][] reduceCovarianceMatrixToWLs(double[][][] covarianceMatrix, int[] useIndices) { double[][][] reducedMatrix = new double[covarianceMatrix.length][useIndices.length][useIndices.length]; for (int i = 0; i < covarianceMatrix.length; i++) { double[][] innerCovarianceMatrix = covarianceMatr...
662539_2
@Override public Auxdata createAuxdata() throws AuxdataException { double[][] spectralMeans = loadSpectralMeans(); double[][][] invCovarianceMatrix = loadInvCovarianceMatrix(); if (spectralMeans == null || invCovarianceMatrix == null) { throw new AuxdataException("Could not load auxiliary data"); ...
662539_3
public double[] computeClassMemberships(double[] reflectances) throws OWTException { final String pattern = "Number of reflectances must be %d but is %d."; Assert.argument(reflectances.length == wavelengthCount, String.format(pattern, wavelengthCount, reflectances.length)); double[] y = new double[wavelengt...
662539_4
static String getBestBandName(String reflectancesPrefix, float wavelength, Band[] bands) { String bestBandName = null; final double maxDistance = 10.0; double wavelengthDist = Double.MAX_VALUE; for (Band band : bands) { final boolean isSpectralBand = band.getSpectralBandIndex() > -1; if ...
662539_5
static double trapz(double[] x, double[] y) { double sum = 0.0; for (int i = 1; i < x.length; i++) { sum += 0.5 * (x[i] - x[i - 1]) * (y[i] + y[i - 1]); } return sum; }
662539_6
static double trapz(double[] x, double[] y) { double sum = 0.0; for (int i = 1; i < x.length; i++) { sum += 0.5 * (x[i] - x[i - 1]) * (y[i] + y[i - 1]); } return sum; }
662539_7
@Override public void dispose() { if (glintProduct != null) { glintProduct.dispose(); glintProduct = null; } if (l1pProduct != sourceProduct) { l1pProduct.dispose(); l1pProduct = null; } super.dispose(); }
662539_8
@Override public void dispose() { if (glintProduct != null) { glintProduct.dispose(); glintProduct = null; } if (l1pProduct != sourceProduct) { l1pProduct.dispose(); l1pProduct = null; } super.dispose(); }
662539_9
@Override public void dispose() { if (glintProduct != null) { glintProduct.dispose(); glintProduct = null; } if (l1pProduct != sourceProduct) { l1pProduct.dispose(); l1pProduct = null; } super.dispose(); }