id
stringlengths
7
14
text
stringlengths
1
106k
336330_62
@Override public double getQuick(int index) { return vector.getQuick(offset + index); }
336330_63
@Override public double getQuick(int index) { return vector.getQuick(offset + index); }
336330_64
@Override public double getQuick(int index) { return vector.getQuick(offset + index); }
336330_65
@Override public double getQuick(int index) { return vector.getQuick(offset + index); }
336330_66
@Override public double getQuick(int index) { return vector.getQuick(offset + index); }
336330_67
@Override public double getQuick(int index) { return vector.getQuick(offset + index); }
336330_68
@Override public VectorView like() { return new VectorView(vector.like(), offset, size()); }
336330_69
@Override public double getQuick(int index) { return vector.getQuick(offset + index); }
336330_70
public double[] getSingularValues() { return s; }
336330_71
public double[] getSingularValues() { return s; }
336330_72
public Matrix getU() { if (transpositionNeeded) { //case numRows() < numCols() return new DenseMatrix(v); } else { int numCols = Math.min(m + 1, n); Matrix r = new DenseMatrix(m, numCols); for (int i = 0; i < m; i++) { for (int j = 0; j < numCols; j++) { r.set(i, j, u[i][j]); } ...
336330_73
public Matrix getV() { if (transpositionNeeded) { //case numRows() < numCols() int numCols = Math.min(m + 1, n); Matrix r = new DenseMatrix(m, numCols); for (int i = 0; i < m; i++) { for (int j = 0; j < numCols; j++) { r.set(i, j, u[i][j]); } } return r; } else { return n...
336330_74
public double cond() { return s[0] / s[Math.min(m, n) - 1]; }
336330_75
protected Matrix addLambdaTimesNuiTimesE(Matrix matrix, double lambda, int nui) { Preconditions.checkArgument(matrix.numCols() == matrix.numRows()); double lambdaTimesNui = lambda * nui; for (int n = 0; n < matrix.numCols(); n++) { matrix.setQuick(n, n, matrix.getQuick(n, n) + lambdaTimesNui); } return ma...
336330_76
protected Matrix createMiIi(List<Vector> featureVectors, int numFeatures) { Matrix MiIi = new DenseMatrix(numFeatures, featureVectors.size()); for (int n = 0; n < featureVectors.size(); n++) { Vector featureVector = featureVectors.get(n); for (int m = 0; m < numFeatures; m++) { MiIi.setQuick(m, n, fea...
336330_77
protected Matrix createRiIiMaybeTransposed(Vector ratingVector) { Preconditions.checkArgument(ratingVector.isSequentialAccess()); Matrix RiIiMaybeTransposed = new DenseMatrix(ratingVector.getNumNondefaultElements(), 1); Iterator<Vector.Element> ratingsIterator = ratingVector.iterateNonZero(); int index = 0; w...
336330_78
protected Matrix createRiIiMaybeTransposed(Vector ratingVector) { Preconditions.checkArgument(ratingVector.isSequentialAccess()); Matrix RiIiMaybeTransposed = new DenseMatrix(ratingVector.getNumNondefaultElements(), 1); Iterator<Vector.Element> ratingsIterator = ratingVector.iterateNonZero(); int index = 0; w...
336330_79
@Override public final int size() { return size; }
336330_80
@Override public double get(int index) { if (index < 0 || index >= size) { throw new IndexException(index, size); } return getQuick(index); }
336330_81
@Override public double get(int index) { if (index < 0 || index >= size) { throw new IndexException(index, size); } return getQuick(index); }
336330_82
@Override public void set(int index, double value) { if (index < 0 || index >= size) { throw new IndexException(index, size); } setQuick(index, value); }
336330_83
@Override public final int size() { return size; }
336330_84
@Override public Vector viewPart(int offset, int length) { if (offset < 0) { throw new IndexException(offset, size); } if (offset + length > size) { throw new IndexException(offset + length, size); } return new VectorView(this, offset, length); }
336330_85
@Override public Vector viewPart(int offset, int length) { if (offset < 0) { throw new IndexException(offset, size); } if (offset + length > size) { throw new IndexException(offset + length, size); } return new VectorView(this, offset, length); }
336330_86
@Override public Vector viewPart(int offset, int length) { if (offset < 0) { throw new IndexException(offset, size); } if (offset + length > size) { throw new IndexException(offset + length, size); } return new VectorView(this, offset, length); }
336330_87
@Override public Vector viewPart(int offset, int length) { if (offset < 0) { throw new IndexException(offset, size); } if (offset + length > size) { throw new IndexException(offset + length, size); } return new VectorView(this, offset, length); }
336330_88
@Override public double dot(Vector x) { if (size != x.size()) { throw new CardinalityException(size, x.size()); } if (this == x) { return dotSelf(); } double result = 0.0; Iterator<Element> iter = iterateNonZero(); while (iter.hasNext()) { Element element = iter.next(); result += element.g...
336330_89
@Override public Vector normalize() { return divide(Math.sqrt(dotSelf())); }
336330_90
@Override public Vector minus(Vector that) { if (size != that.size()) { throw new CardinalityException(size, that.size()); } // TODO: check the numNonDefault elements to further optimize Vector result = like().assign(this); Iterator<Element> iter = that.iterateNonZero(); while (iter.hasNext()) { Ele...
336330_91
@Override public double zSum() { double result = 0.0; Iterator<Element> iter = iterateNonZero(); while (iter.hasNext()) { result += iter.next().get(); } return result; }
336330_92
@Override public double getDistanceSquared(Vector v) { if (size != v.size()) { throw new CardinalityException(size, v.size()); } // if this and v has a cached lengthSquared, dot product is quickest way to compute this. if (lengthSquared >= 0 && v instanceof AbstractVector && ((AbstractVector)v).lengthSquare...
336330_93
@Override public Vector assign(double value) { for (int i = 0; i < size; i++) { setQuick(i, value); } return this; }
336330_94
@Override public Vector assign(double value) { for (int i = 0; i < size; i++) { setQuick(i, value); } return this; }
336330_95
@Override public final int size() { return size; }
336330_96
@Override public double dot(Vector x) { if (size() != x.size()) { throw new CardinalityException(size(), x.size()); } if (this == x) { return dotSelf(); } if (x instanceof SequentialAccessSparseVector) { // For sparse SeqAccVectors. do dot product without lookup in a linear fashion Iterator<El...
336330_97
public static double entropy(int... elements) { double sum = 0.0; double result = 0.0; for (int element : elements) { if (element < 0) { throw new IllegalArgumentException("Should not have negative count for entropy computation: (" + element + ')'); } if (element > 0) { result += element *...
336330_98
private LogLikelihood() { }
336330_99
public static double rootLogLikelihoodRatio(int k11, int k12, int k21, int k22) { double llr = logLikelihoodRatio(k11, k12, k21, k22); double sqrt = Math.sqrt(llr); if (((double) k11 / (k11 + k12)) < ((double) k21 / (k21 + k22))) { sqrt = -sqrt; } return sqrt; }
3370128_0
public int tokenize(String string, char delim) { tokens.clear(); // nest holds how many levels we are in the current token. // if this is > 0 then we don't split a token when delim is matched. // // The Geometric datatypes use this, because often a type may have others // (usualls PGpoint) imbedded within a...
3370128_1
public static String removePara(String s) { return remove(s, "(", ")"); }
3370128_2
public static String removeBox(String s) { return remove(s, "[", "]"); }
3370128_3
public static String removeAngle(String s) { return remove(s, "<", ">"); }
3370128_4
public static String removeCurlyBrace(String s) { return remove(s, "{", "}"); }
3370128_5
@Override public int read() throws IOException { int res = 0; while (res != -1) { res = read(oneByte); if (res > 0) { return (oneByte[0] & 0xFF); } } return -1; }
3370128_6
@Override public int read() throws IOException { int res = 0; while (res != -1) { res = read(oneByte); if (res > 0) { return (oneByte[0] & 0xFF); } } return -1; }
3370128_7
@Override public int read() throws IOException { int res = 0; while (res != -1) { res = read(oneByte); if (res > 0) { return (oneByte[0] & 0xFF); } } return -1; }
3370128_8
@Override public int read() throws IOException { int res = 0; while (res != -1) { res = read(oneByte); if (res > 0) { return (oneByte[0] & 0xFF); } } return -1; }
3370128_9
@Override public int read() throws IOException { int res = 0; while (res != -1) { res = read(oneByte); if (res > 0) { return (oneByte[0] & 0xFF); } } return -1; }
3375991_0
@Override public Query parseQuery(String expression) { if (expression == null) { return null; } OqlParser parser = newParser(expression); try { parser.oql(); } catch (RecognitionException e) { e.printStackTrace(); } return parser.getQuery(); }
3375991_1
@Override public Query parseQuery(String expression) { if (expression == null) { return null; } OqlParser parser = newParser(expression); try { parser.oql(); } catch (RecognitionException e) { e.printStackTrace(); } return parser.getQuery(); }
3376848_0
public static void addListener(WebDriverEventListener listener) { webdriverContainer.addListener(listener); }
3376848_1
@Override @CheckReturnValue @Nonnull public WebDriver getAndCheckWebDriver() { WebDriver webDriver = threadWebDriver.get(currentThread().getId()); if (webDriver != null && reopenBrowserOnFail && !browserHealthChecker.isBrowserStillOpen(webDriver)) { log.info("Webdriver has been closed meanwhile. Let's re-create...
3376848_2
@Override @CheckReturnValue public boolean hasWebDriverStarted() { WebDriver webDriver = threadWebDriver.get(currentThread().getId()); return webDriver != null; }
3376848_3
@Override @CheckReturnValue @Nonnull public WebDriver getAndCheckWebDriver() { WebDriver webDriver = threadWebDriver.get(currentThread().getId()); if (webDriver != null && reopenBrowserOnFail && !browserHealthChecker.isBrowserStillOpen(webDriver)) { log.info("Webdriver has been closed meanwhile. Let's re-create...
3376848_4
@Override @CheckReturnValue @Nonnull public WebDriver getAndCheckWebDriver() { WebDriver webDriver = threadWebDriver.get(currentThread().getId()); if (webDriver != null && reopenBrowserOnFail && !browserHealthChecker.isBrowserStillOpen(webDriver)) { log.info("Webdriver has been closed meanwhile. Let's re-create...
3382195_0
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; if (!super.equals(o)) return false; ExternalIdentityProviderDefinition that = (ExternalIdentityProviderDefinition) o; if (addShadowUserOnLogin != that.addShadowUserOnLog...
3382195_1
public boolean isStoreCustomAttributes() { return storeCustomAttributes; }
3382195_2
public void setStoreCustomAttributes(boolean storeCustomAttributes) { this.storeCustomAttributes = storeCustomAttributes; }
3382195_3
public boolean isRequestSigned() { return requestSigned; }
3382195_4
public boolean isWantAssertionSigned() { return wantAssertionSigned; }
3382195_5
public Map<String, SamlKey> getKeys() { return Collections.unmodifiableMap(keys); }
3382195_6
public static IdentityZone getUaa() { Calendar calendar = Calendar.getInstance(); calendar.clear(); calendar.set(Calendar.YEAR, 2000); IdentityZone uaa = new IdentityZone(); uaa.setCreated(calendar.getTime()); uaa.setLastModified(calendar.getTime()); uaa.setVersion(0); uaa.setId(OriginKe...
3382195_7
public static String getUaaZoneId() { return getUaa().getId(); }
3382195_8
@JsonIgnore public void setKeys(Map<String, String> keys) { if (keys != null) { keys.forEach((key, value) -> { if (!StringUtils.hasText(value) || !StringUtils.hasText(key)) { throw new IllegalArgumentException("KeyId and Signing key should not be null or empty"); } ...
3382195_9
@JsonIgnore public void setKeys(Map<String, String> keys) { if (keys != null) { keys.forEach((key, value) -> { if (!StringUtils.hasText(value) || !StringUtils.hasText(key)) { throw new IllegalArgumentException("KeyId and Signing key should not be null or empty"); } ...
338815_10
public static String formatTimestamp(long t) { DateFormat f = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT); return f.format(new Date(t)); }
338815_11
public FileDifferenceModel getDifferenceModel() { return new EntireFileDifferenceModel(myGateway, getLeftEntry(), getRightEntry(), isCurrentRevisionSelected()); }
338815_12
public FileDifferenceModel getDifferenceModel() { return new EntireFileDifferenceModel(myGateway, getLeftEntry(), getRightEntry(), isCurrentRevisionSelected()); }
338815_13
@Override public String getTitle() { return myChange.getChangeName(); }
338815_14
public String getEntryName(int i) { Entry e = getEntry(i); return e == null ? "" : e.getName(); }
338815_15
public String getEntryName(int i) { Entry e = getEntry(i); return e == null ? "" : e.getName(); }
338815_16
public FileDifferenceModel getFileDifferenceModel() { return new EntireFileDifferenceModel(myGateway, myDiff.getLeft(), myDiff.getRight(), isRightContentEditable); }
338815_17
public boolean canShowFileDifference() { return isFile(); }
338815_18
public boolean canShowFileDifference() { return isFile(); }
338815_19
public Block getSelectionFor(Revision r, Progress p) { return doGetSelectionFor(r, p); }
338815_20
public Block getSelectionFor(Revision r, Progress p) { return doGetSelectionFor(r, p); }
338815_21
public Block getSelectionFor(Revision r, Progress p) { return doGetSelectionFor(r, p); }
338815_22
public Block getSelectionFor(Revision r, Progress p) { return doGetSelectionFor(r, p); }
338815_23
public boolean canCalculateFor(Revision r, Progress p) { try { doGetSelectionFor(r, p); } catch (ContentIsUnavailableException e) { return false; } return true; }
338815_24
public Block getSelectionFor(Revision r, Progress p) { return doGetSelectionFor(r, p); }
338815_25
public boolean canCalculateFor(Revision r, Progress p) { try { doGetSelectionFor(r, p); } catch (ContentIsUnavailableException e) { return false; } return true; }
338815_26
public List<Revision> getRevisions() { if (myRevisionsCache == null) initRevisionsCache(); return myRevisionsCache; }
338815_27
public List<Revision> getRevisions() { if (myRevisionsCache == null) initRevisionsCache(); return myRevisionsCache; }
338815_28
public List<Revision> getRevisions() { if (myRevisionsCache == null) initRevisionsCache(); return myRevisionsCache; }
338815_29
public void selectRevisions(int first, int second) { doSelect(first, second); myIsChangesSelected = false; }
338815_30
public void selectRevisions(int first, int second) { doSelect(first, second); myIsChangesSelected = false; }
338815_31
public void selectRevisions(int first, int second) { doSelect(first, second); myIsChangesSelected = false; }
338815_32
protected boolean isCurrentRevisionSelected() { return myRightRevisionIndex == 0; }
338815_33
public void selectChanges(int first, int second) { doSelect(first, second + 1); myIsChangesSelected = true; }
338815_34
public void selectChanges(int first, int second) { doSelect(first, second + 1); myIsChangesSelected = true; }
338815_35
public void registerUnsavedDocuments(LocalVcs vcs) { vcs.beginChangeSet(); for (Document d : getUnsavedDocuments()) { VirtualFile f = getFile(d); if (shouldNotRegister(f)) continue; registerDocumentContents(vcs, f, d); } vcs.endChangeSet(null); }
338815_36
public void registerUnsavedDocuments(LocalVcs vcs) { vcs.beginChangeSet(); for (Document d : getUnsavedDocuments()) { VirtualFile f = getFile(d); if (shouldNotRegister(f)) continue; registerDocumentContents(vcs, f, d); } vcs.endChangeSet(null); }
338815_37
public void registerUnsavedDocuments(LocalVcs vcs) { vcs.beginChangeSet(); for (Document d : getUnsavedDocuments()) { VirtualFile f = getFile(d); if (shouldNotRegister(f)) continue; registerDocumentContents(vcs, f, d); } vcs.endChangeSet(null); }
338815_38
protected VirtualFile[] selectParentlessRootsAndSort(List<VirtualFile> roots) { List<VirtualFile> result = new ArrayList<VirtualFile>(); for (VirtualFile r : roots) { if (parentIsNotUnderContentRoot(r)) result.add(r); } ContainerUtil.removeDuplicates(result); sortRoots(result); return result.toArray(new...
338815_39
public static <T> Reversed<T> list(List<T> l) { return new Reversed<T>(l); }
338815_40
public static String getParentOf(String path) { int i = path.lastIndexOf(DELIM); return i == -1 ? null : path.substring(0, i); }
338815_41
public static String getNameOf(String path) { int i = path.lastIndexOf(DELIM); return i == -1 ? path : path.substring(i + 1); }
338815_42
public static String appended(String path, String child) { return path + DELIM + child; }
338815_43
public static String appended(String path, String child) { return path + DELIM + child; }
338815_44
public static String renamed(String path, String newName) { String parent = getParentOf(path); return parent == null ? newName : appended(parent, newName); }