Searched refs:distance (Results 1 - 25 of 43) sorted by relevance

12

/packages/inputmethods/LatinIME/native/jni/src/utils/
H A Dautocorrection_threshold_utils.cpp74 const int distance = editDistance(before, beforeLength, after, afterLength); local
86 if (score <= 0 || distance >= afterLength) {
88 // or if the edit distance is larger than or equal to afterLength.
91 // add a weight based on edit distance.
92 const float weight = 1.0f - static_cast<float>(distance) / static_cast<float>(afterLength);
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/keyboard/
H A DKeyDetector.java33 * @param keyHysteresisDistance if the pointer movement distance is smaller than this, the
43 * @param keyHysteresisDistance if the pointer movement distance is smaller than this, the
107 final int distance = key.squaredDistanceToEdge(touchX, touchY);
108 if (distance > minDistance) {
112 if (primaryKey == null || distance < minDistance
114 minDistance = distance;
/packages/apps/Gallery2/src/com/android/gallery3d/ui/
H A DScrollerHelper.java84 // Returns the distance that over the scroll limit.
85 public int startScroll(int distance, int min, int max) { argument
89 int newPosition = Utils.clamp(finalPosition + distance, min, max);
95 return finalPosition + distance - newPosition;
H A DPaper.java36 public void overScroll(float distance) { argument
37 distance /= mWidth; // make it relative to width
38 if (distance < 0) {
39 mAnimationLeft.onPull(-distance);
41 mAnimationRight.onPull(distance);
H A DEdgeEffect.java180 * @param deltaDistance Change in distance since the last call. Values may be 0 (no change) to
198 float distance = Math.abs(mPullDistance);
200 mEdgeAlpha = mEdgeAlphaStart = Math.max(PULL_EDGE_BEGIN, Math.min(distance, MAX_ALPHA));
202 HELD_EDGE_SCALE_Y, Math.min(distance * PULL_DISTANCE_EDGE_FACTOR, 1.f));
/packages/apps/QuickSearchBox/src/com/android/quicksearchbox/util/
H A DLevenshteinDistance.java20 * This class represents the matrix used in the Levenshtein distance algorithm, together
60 * Implementation of Levenshtein distance algorithm.
62 * @return The Levenshtein distance.
77 int distance = distTab[s-1][t] + 1;
81 if (d + 1 < distance ) {
82 distance = d + 1;
87 if (d + cost < distance) {
88 distance = d + cost;
91 distTab[s][t] = distance;
/packages/apps/Launcher2/src/com/android/launcher2/
H A DSmoothPagedView.java46 public void setDistance(int distance) { argument
47 mTension = distance > 0 ? DEFAULT_TENSION / distance : DEFAULT_TENSION;
H A DWorkspace.java806 // As a ratio of screen height, the total distance we want the parallax effect to span
1457 * as its distance from a camera increases. When this interpolator is applied to a scale
2006 float distance = dropTargetLayout.getDistanceFromCell(mDragViewVisualCenter[0],
2009 mTargetCell, distance, true)) {
2013 mTargetCell, distance)) {
2044 distance, boolean considerTimeout) {
2045 if (distance > mMaxDistanceForFolderCreation) return false;
2073 float distance) {
2074 if (distance > mMaxDistanceForFolderCreation) return false;
2094 int[] targetCell, float distance, boolea
2043 willCreateUserFolder(ItemInfo info, CellLayout target, int[] targetCell, float distance, boolean considerTimeout) argument
2072 willAddToExistingUserFolder(Object dragInfo, CellLayout target, int[] targetCell, float distance) argument
2093 createUserFolderIfNecessary(View newView, long container, CellLayout target, int[] targetCell, float distance, boolean external, DragView dragView, Runnable postAnimationRunnable) argument
2146 addToExistingFolderIfNecessary(View newView, CellLayout target, int[] targetCell, float distance, DragObject d, boolean external) argument
2875 manageFolderFeedback(ItemInfo info, CellLayout targetLayout, int[] targetCell, float distance, View dragOverView) argument
[all...]
/packages/apps/Launcher3/src/com/android/launcher3/
H A DSmoothPagedView.java46 public void setDistance(int distance) { argument
47 mTension = distance > 0 ? DEFAULT_TENSION / distance : DEFAULT_TENSION;
/packages/apps/QuickSearchBox/tests/src/com/android/quicksearchbox/util/
H A DLevenshteinDistanceTest.java43 LevenshteinDistance distance = new LevenshteinDistance(sourceTokens, targetTokens);
45 assertEquals(expectedDistance, distance.calculate());
46 EditOperation[] ops = distance.getTargetOperations();
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/utils/
H A DAutoCorrectionUtils.java116 // we should not use net because relatively edit distance can be big.
123 final int distance = BinaryDictionary.editDistance(typedWord, suggestion);
125 Log.d(TAG, "Autocorrected edit distance = " + distance
128 if (distance > maxEditDistanceOfNativeDictionary) {
131 Log.e(TAG, "(Error) The edit distance of this correction exceeds limit. "
/packages/apps/DeskClock/src/com/android/deskclock/widget/sgv/
H A DOverScrollerSGV.java159 * @return The new X offset as an absolute distance from the origin.
168 * @return The new Y offset as an absolute distance from the origin.
188 * @return The start X offset as an absolute distance from the origin.
197 * @return The start Y offset as an absolute distance from the origin.
206 * @return The final X offset as an absolute distance from the origin.
215 * @return The final Y offset as an absolute distance from the origin.
258 * @param newX The new X offset as an absolute distance from the origin.
276 * @param newY The new Y offset as an absolute distance from the origin.
348 * Start scrolling by providing a starting point and the distance to travel.
356 * @param dx Horizontal distance t
684 startScroll(int start, int distance, int duration) argument
[all...]
/packages/apps/Gallery2/gallerycommon/src/com/android/gallery3d/common/
H A DOverScroller.java157 * @return The new X offset as an absolute distance from the origin.
166 * @return The new Y offset as an absolute distance from the origin.
186 * @return The start X offset as an absolute distance from the origin.
195 * @return The start Y offset as an absolute distance from the origin.
204 * @return The final X offset as an absolute distance from the origin.
213 * @return The final Y offset as an absolute distance from the origin.
256 * @param newX The new X offset as an absolute distance from the origin.
274 * @param newY The new Y offset as an absolute distance from the origin.
346 * Start scrolling by providing a starting point and the distance to travel.
354 * @param dx Horizontal distance t
685 startScroll(int start, int distance, int duration) argument
[all...]
/packages/apps/Browser/src/com/android/browser/
H A DNavTabScroller.java280 int distance = target - (mHorizontal ? v.getTop() : v.getLeft());
281 long duration = (long) (Math.abs(distance) * 1000 / Math.abs(velocity));
432 protected void onOrthoDrag(View v, float distance) { argument
434 offsetView(v, distance);
464 private void offsetView(View v, float distance) { argument
465 v.setAlpha(getAlpha(v, distance));
467 v.setTranslationY(distance);
469 v.setTranslationX(distance);
473 private float getAlpha(View v, float distance) { argument
474 return 1 - (float) Math.abs(distance) / (mHorizonta
[all...]
/packages/apps/Gallery2/src/com/android/gallery3d/data/
H A DLocationClustering.java39 // If the total distance change is less than this ratio, stop iterating.
223 // (sum of distance from each point to its group center) * sqrt(k).
256 float distance = (float) GalleryUtils.fastDistanceMeters(
258 // We may have small non-zero distance introduced by
261 if (distance < 1) {
262 distance = 0;
264 if (distance < bestDistance) {
265 bestDistance = distance;
/packages/inputmethods/LatinIME/native/jni/src/suggest/core/layout/
H A Dproximity_info_state_utils.cpp316 // Calculating point to key distance for all near keys and returning the distance between
365 // If there is only one point, add this point. Besides, if the previous point's distance map
605 // This function basically converts from a length to an edit distance. Accordingly, it's obviously
644 const float distance = getPointToKeyByIdLength( local
646 if (distance < nearestKeyDistance) {
647 nearestKeyDistance = distance;
725 float distance = sqrtf(getPointToKeyByIdLength( local
729 // next point to the key is used as a point to key distance.
733 if (nextDistance < distance) {
767 float distance = sqrtf(getPointToKeyByIdLength( local
[all...]
H A Dproximity_info_utils.h180 const int distance = squaredLengthToEdge(keyXCoordinates, keyYCoordinates, local
182 if (onKey || distance < mostCommonKeyWidthSquare) {
/packages/inputmethods/PinyinIME/jni/share/
H A Dngram.cpp37 inline double distance(double freq, double code) { function in namespace:ime_pinyin
48 if (distance(freq, code_book[end]) > distance(freq, code_book[start]))
87 ret += distance(freqs[pos], code_book[code_idx[pos]]);
/packages/apps/Gallery2/src/com/android/gallery3d/app/
H A DEyePosition.java147 float distance = (gx > 0 ? gx : -gx) + (gy > 0 ? gy : - gy);
148 if (distance < GYROSCOPE_THRESHOLD
149 || distance > GYROSCOPE_LIMIT || mGyroscopeCountdown > 0) {
/packages/screensavers/PhotoTable/src/com/android/dreams/phototable/
H A DPhotoTouchListener.java111 // distance travelled before stopping
208 double distance = Math.hypot(x0 - mInitialTouchX,
211 if (distance < mTouchSlop) {
221 distance < mTouchSlop) {
/packages/apps/Calendar/src/com/android/calendar/agenda/
H A DAgendaByDayAdapter.java545 long distance = Math.abs(millis - row.mEventStartTimeMilli);
546 if (distance < idFoundMinDistance) {
547 idFoundMinDistance = distance;
565 long distance = Math.abs(millis - row.mEventStartTimeMilli);
566 if (distance < minDistance) {
567 minDistance = distance;
/packages/providers/ContactsProvider/src/com/android/providers/contacts/aggregation/util/
H A DContactMatcher.java69 // Minimum edit distance between two names to be considered an approximate match
72 // Minimum edit distance between two email ids to be considered an approximate match
87 * match producing the score of 70. The score may also be 0 if the similarity (distance)
278 * of name we found and, if the match is approximate, the distance between the candidate and
317 float distance = nameDistance.getDistance(decodedCandidateName, decodedName);
323 if (distance > threshold) {
324 score = (int)(minScore + (maxScore - minScore) * (1.0f - distance));
/packages/inputmethods/LatinIME/native/jni/src/suggest/policyimpl/typing/
H A Dtyping_weighting.h121 const float distance = distance1 + distance2; local
123 distance * ScoringParams::DISTANCE_WEIGHT_LENGTH;
/packages/inputmethods/LatinIME/native/jni/src/suggest/core/
H A Dsuggest.cpp267 // Get the distance for the first word of the suggestion
268 const float distance = terminalDicNode->getNormalizedCompoundDistanceAfterFirstWord(); local
280 // Expected distance is about 0.2 ~ 2.0, but consider 0.0 ~ 2.0
290 // The smaller the edit distance, the higher the contribution. MIN_EXPECTED_DISTANCE means 0
292 // weight of the distance. Clamp to avoid overflows.
293 const float clampedDistance = distance < MIN_EXPECTED_DISTANCE ? MIN_EXPECTED_DISTANCE
294 : distance > MAX_EXPECTED_DISTANCE ? MAX_EXPECTED_DISTANCE : distance;
367 // Only consider typing error corrections if the normalized compound distance is
368 // below a spatial distance threshol
[all...]
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/keyboard/internal/
H A DGestureStroke.java335 final int distance = detectFastMove(x, y, time);
336 if (distance > mGestureSamplingMinimumDistance) {

Completed in 548 milliseconds

12