idx int64 0 165k | question stringlengths 73 5.81k | target stringlengths 5 918 |
|---|---|---|
157,000 | private DBIDs getNearestNeighbors ( Relation < V > relation , SimilarityQuery < V > simQ , DBIDRef queryObject ) { Heap < DoubleDBIDPair > nearestNeighbors = new TiedTopBoundedHeap < > ( knn ) ; for ( DBIDIter iter = relation . iterDBIDs ( ) ; iter . valid ( ) ; iter . advance ( ) ) { if ( DBIDUtil . equal ( iter , que... | Get the k nearest neighbors in terms of the shared nearest neighbor distance . |
157,001 | private static double [ ] computePerDimensionVariances ( Relation < ? extends NumberVector > relation , double [ ] center , DBIDs neighborhood ) { final int dim = center . length ; double [ ] variances = new double [ dim ] ; for ( DBIDIter iter = neighborhood . iter ( ) ; iter . valid ( ) ; iter . advance ( ) ) { Numbe... | Compute the per - dimension variances for the given neighborhood and center . |
157,002 | private double subspaceOutlierDegree ( V queryObject , double [ ] center , long [ ] weightVector ) { final int card = BitsUtil . cardinality ( weightVector ) ; if ( card == 0 ) { return 0 ; } final SubspaceEuclideanDistanceFunction df = new SubspaceEuclideanDistanceFunction ( weightVector ) ; return df . distance ( que... | Compute SOD score . |
157,003 | public static long parseLongBase10 ( final CharSequence str , final int start , final int end ) { int pos = start ; char cur = str . charAt ( pos ) ; boolean isNegative = ( cur == '-' ) ; if ( ( isNegative || ( cur == '+' ) ) && ( ++ pos < end ) ) { cur = str . charAt ( pos ) ; } if ( ( cur < '0' ) || ( cur > '9' ) ) {... | Parse a long integer from a character sequence . |
157,004 | private static boolean matchInf ( byte [ ] str , byte firstchar , int start , int end ) { final int len = end - start ; if ( len == 3 && firstchar == - 0x1E && str [ start + 1 ] == - 0x78 && str [ start + 2 ] == - 0x62 ) { return true ; } if ( ( len != 3 && len != INFINITY_LENGTH ) || ( firstchar != 'I' && firstchar !=... | Match inf infinity in a number of different capitalizations . |
157,005 | private static boolean matchNaN ( byte [ ] str , byte firstchar , int start , int end ) { final int len = end - start ; if ( len < 2 || len > 3 || ( firstchar != 'N' && firstchar != 'n' ) ) { return false ; } final byte c1 = str [ start + 1 ] ; if ( c1 != 'a' && c1 != 'A' ) { return false ; } if ( len == 2 ) { return t... | Match NaN in a number of different capitalizations . |
157,006 | public static void setLookAndFeel ( ) { try { if ( PREFER_GTK ) { LookAndFeelInfo [ ] lfs = UIManager . getInstalledLookAndFeels ( ) ; for ( LookAndFeelInfo lf : lfs ) { if ( lf . getClassName ( ) . contains ( "GTK" ) ) { UIManager . setLookAndFeel ( lf . getClassName ( ) ) ; return ; } } } UIManager . setLookAndFeel (... | Setup look at feel . |
157,007 | public static void logUncaughtExceptions ( Logging logger ) { try { Thread . setDefaultUncaughtExceptionHandler ( ( t , e ) -> logger . exception ( e ) ) ; } catch ( SecurityException e ) { logger . warning ( "Could not set the Default Uncaught Exception Handler" , e ) ; } } | Setup logging of uncaught exceptions . |
157,008 | protected List < OneItemset > buildFrequentOneItemsets ( final Relation < ? extends SparseFeatureVector < ? > > relation , final int dim , final int needed ) { int [ ] counts = new int [ dim ] ; for ( DBIDIter iditer = relation . iterDBIDs ( ) ; iditer . valid ( ) ; iditer . advance ( ) ) { SparseFeatureVector < ? > bv... | Build the 1 - itemsets . |
157,009 | protected List < SparseItemset > buildFrequentTwoItemsets ( List < OneItemset > oneitems , final Relation < BitVector > relation , final int dim , final int needed , DBIDs ids , ArrayModifiableDBIDs survivors ) { int f1 = 0 ; long [ ] mask = BitsUtil . zero ( dim ) ; for ( OneItemset supported : oneitems ) { BitsUtil .... | Build the 2 - itemsets . |
157,010 | protected List < ? extends Itemset > frequentItemsets ( List < ? extends Itemset > candidates , Relation < BitVector > relation , int needed , DBIDs ids , ArrayModifiableDBIDs survivors , int length ) { if ( candidates . isEmpty ( ) ) { return Collections . emptyList ( ) ; } Itemset first = candidates . get ( 0 ) ; if ... | Returns the frequent BitSets out of the given BitSets with respect to the given database . |
157,011 | protected List < SparseItemset > frequentItemsetsSparse ( List < SparseItemset > candidates , Relation < BitVector > relation , int needed , DBIDs ids , ArrayModifiableDBIDs survivors , int length ) { int begin = 0 , end = candidates . size ( ) ; int [ ] scratchi = new int [ length ] , iters = new int [ length ] ; Spar... | Returns the frequent BitSets out of the given BitSets with respect to the given database . Optimized implementation for SparseItemset . |
157,012 | private boolean initializeSearchItemset ( BitVector bv , int [ ] scratchi , int [ ] iters ) { for ( int i = 0 ; i < scratchi . length ; i ++ ) { iters [ i ] = ( i == 0 ) ? bv . iter ( ) : bv . iterAdvance ( iters [ i - 1 ] ) ; if ( iters [ i ] < 0 ) { return false ; } scratchi [ i ] = bv . iterDim ( iters [ i ] ) ; } r... | Initialize the scratch itemset . |
157,013 | private boolean nextSearchItemset ( BitVector bv , int [ ] scratchi , int [ ] iters ) { final int last = scratchi . length - 1 ; for ( int j = last ; j >= 0 ; j -- ) { int n = bv . iterAdvance ( iters [ j ] ) ; if ( n >= 0 && ( j == last || n != iters [ j + 1 ] ) ) { iters [ j ] = n ; scratchi [ j ] = bv . iterDim ( n ... | Advance scratch itemset to the next . |
157,014 | private int binarySearch ( List < SparseItemset > candidates , SparseItemset scratch , int begin , int end ) { -- end ; while ( begin < end ) { final int mid = ( begin + end ) >>> 1 ; SparseItemset midVal = candidates . get ( mid ) ; int cmp = midVal . compareTo ( scratch ) ; if ( cmp < 0 ) { begin = mid + 1 ; } else i... | Binary - search for the next - larger element . |
157,015 | private < A > ArrayList < int [ ] > buildPartitions ( NumberArrayAdapter < ? , A > adapter1 , A data1 , int len , int depth ) { final int [ ] idx = new int [ len ] ; final double [ ] tmp = new double [ len ] ; for ( int i = 0 ; i < len ; ++ i ) { idx [ i ] = i ; tmp [ i ] = adapter1 . getDouble ( data1 , i ) ; } Intege... | Partitions an attribute . |
157,016 | private void divide ( int [ ] idx , double [ ] data , ArrayList < int [ ] > ret , int start , int end , int depth ) { if ( depth == 0 ) { int [ ] a = Arrays . copyOfRange ( idx , start , end ) ; Arrays . sort ( a ) ; ret . add ( a ) ; return ; } final int count = end - start ; if ( count == 0 ) { for ( int j = 1 << dep... | Recursive call to further subdivide the array . |
157,017 | private void intersectionMatrix ( int [ ] [ ] res , ArrayList < int [ ] > partsx , ArrayList < int [ ] > partsy , int gridsize ) { for ( int x = 0 ; x < gridsize ; x ++ ) { final int [ ] px = partsx . get ( x ) ; final int [ ] rowx = res [ x ] ; for ( int y = 0 ; y < gridsize ; y ++ ) { int [ ] py = partsy . get ( y ) ... | Intersect the two 1d grid decompositions to obtain a 2d matrix . |
157,018 | private int intersectionSize ( int [ ] px , int [ ] py ) { int i = 0 , j = 0 , c = 0 ; while ( i < px . length && j < py . length ) { final int vx = px [ i ] , vy = py [ j ] ; if ( vx < vy ) { ++ i ; } else if ( vx > vy ) { ++ j ; } else { ++ c ; ++ i ; ++ j ; } } return c ; } | Compute the intersection of two sorted integer lists . |
157,019 | private double getMCEntropy ( int [ ] [ ] mat , ArrayList < int [ ] > partsx , ArrayList < int [ ] > partsy , int size , int gridsize , double loggrid ) { double [ ] mx = new double [ gridsize ] ; double [ ] my = new double [ gridsize ] ; for ( int i = 0 ; i < gridsize ; i ++ ) { final double sumx = ( double ) partsx .... | Compute the MCE entropy value . |
157,020 | public void add ( E e ) { if ( size + 1 > queue . length ) { resize ( size + 1 ) ; } this . size += 1 ; heapifyUp ( size - 1 , e ) ; heapModified ( ) ; } | Add an element to the heap . |
157,021 | @ SuppressWarnings ( "unchecked" ) public E replaceTopElement ( E e ) { E oldroot = ( E ) queue [ 0 ] ; heapifyDown ( 0 , e ) ; heapModified ( ) ; return oldroot ; } | Combined operation that removes the top element and inserts a new element instead . |
157,022 | @ SuppressWarnings ( "unchecked" ) protected E removeAt ( int pos ) { if ( pos < 0 || pos >= size ) { return null ; } final E ret = ( E ) queue [ pos ] ; final Object reinsert = queue [ size - 1 ] ; queue [ size - 1 ] = null ; size -- ; heapifyDown ( pos , reinsert ) ; heapModified ( ) ; return ret ; } | Remove the element at the given position . |
157,023 | protected final void resize ( int requiredSize ) { int newCapacity = ( ( queue . length < 64 ) ? ( ( queue . length + 1 ) << 1 ) : ( ( queue . length >> 1 ) + queue . length ) ) ; if ( newCapacity < 0 ) { throw new OutOfMemoryError ( ) ; } if ( requiredSize > newCapacity ) { newCapacity = requiredSize ; } queue = Array... | Test whether we need to resize to have the requested capacity . |
157,024 | public void clear ( ) { for ( int i = 0 ; i < size ; i ++ ) { queue [ i ] = null ; } this . size = 0 ; heapModified ( ) ; } | Clear the heap . |
157,025 | protected String checkHeap ( ) { for ( int i = 1 ; i < size ; i ++ ) { final int parent = ( i - 1 ) >>> 1 ; if ( comparator . compare ( queue [ parent ] , queue [ i ] ) > 0 ) { return "@" + parent + ": " + queue [ parent ] + " < @" + i + ": " + queue [ i ] ; } } return null ; } | Test whether the heap is still valid . |
157,026 | public void run ( ) { Database db = inputStep . getDatabase ( ) ; hier = db . getHierarchy ( ) ; algorithmStep . runAlgorithms ( db ) ; hier . add ( db , new SettingsResult ( settings ) ) ; evaluationStep . runEvaluators ( hier , db ) ; outputStep . runResultHandlers ( hier , db ) ; } | Method to run the specified algorithm using the specified database connection . |
157,027 | public void set ( SpatialComparable obj ) { final int dim = min . length ; assert ( obj . getDimensionality ( ) == dim ) ; if ( obj instanceof ModifiableHyperBoundingBox ) { ModifiableHyperBoundingBox ho = ( ModifiableHyperBoundingBox ) obj ; System . arraycopy ( ho . getMinRef ( ) , 0 , min , 0 , dim ) ; System . arra... | Set the bounding box to the same as some other spatial object . |
157,028 | public boolean extend ( SpatialComparable obj ) { final int dim = min . length ; assert ( obj . getDimensionality ( ) == dim ) ; boolean extended = false ; for ( int i = 0 ; i < dim ; i ++ ) { final double omin = obj . getMin ( i ) ; final double omax = obj . getMax ( i ) ; if ( omin < min [ i ] ) { min [ i ] = omin ; ... | Extend the bounding box by some other spatial object . |
157,029 | public static int findClassLabelColumn ( MultipleObjectsBundle bundle ) { for ( int i = 0 , l = bundle . metaLength ( ) ; i < l ; ++ i ) { if ( TypeUtil . CLASSLABEL . isAssignableFromType ( bundle . meta ( i ) ) ) { return i ; } } return - 1 ; } | Find the class label column in the given data set . |
157,030 | @ SuppressWarnings ( { "unchecked" , "rawtypes" } ) public int compareTo ( ClassLabel o ) { HierarchicalClassLabel h = ( HierarchicalClassLabel ) o ; for ( int i = 0 ; i < this . levelwiseNames . length && i < h . levelwiseNames . length ; i ++ ) { int comp = 0 ; try { Comparable first = this . levelwiseNames [ i ] ; C... | Compares two HierarchicalClassLabels . Names at higher levels are compared first . Names at a lower level are compared only if their parent - names are equal . Names at a level are tried to be compared as integer values . If this does not succeed both names are compared as Strings . |
157,031 | public String getNameAt ( int level ) { return this . levelwiseNames [ level ] instanceof Integer ? this . levelwiseNames [ level ] . toString ( ) : ( String ) this . levelwiseNames [ level ] ; } | Returns the name at the given level as a String . |
157,032 | private void recursiveLogResult ( StringBuilder buf , Hierarchy < Result > hier , Result result , int depth ) { if ( result == null ) { buf . append ( "null" ) ; LOG . warning ( "null result!" ) ; return ; } if ( depth > 50 ) { LOG . warning ( "Probably infinitely nested results, aborting!" ) ; return ; } for ( int i =... | Recursively walk through the result tree . |
157,033 | public ListParameterization addFlag ( OptionID optionid ) { parameters . add ( new ParameterPair ( optionid , Flag . SET ) ) ; return this ; } | Add a flag to the parameter list |
157,034 | public ArrayList < String > serialize ( ) { ArrayList < String > params = new ArrayList < > ( ) ; for ( ParameterPair pair : parameters ) { params . add ( SerializedParameterization . OPTION_PREFIX + pair . option . toString ( ) ) ; if ( pair . value instanceof String ) { params . add ( ( String ) pair . value ) ; } el... | Serialize parameters . |
157,035 | public OutlierResult run ( Database db , Relation < V > relation ) { DBIDs ids = relation . getDBIDs ( ) ; WritableDoubleDataStore abodvalues = DataStoreUtil . makeDoubleStorage ( ids , DataStoreFactory . HINT_STATIC ) ; DoubleMinMax minmaxabod = new DoubleMinMax ( ) ; if ( kernelFunction . getClass ( ) == LinearKernel... | Run Fast - ABOD on the data set . |
157,036 | private boolean kNNABOD ( Database db , Relation < V > relation , DBIDs ids , WritableDoubleDataStore abodvalues , DoubleMinMax minmaxabod ) { DistanceQuery < V > dq = db . getDistanceQuery ( relation , SquaredEuclideanDistanceFunction . STATIC ) ; KNNQuery < V > knnq = db . getKNNQuery ( dq , DatabaseQuery . HINT_OPTI... | Simpler kNN based can use more indexing . |
157,037 | private void fastABOD ( Database db , Relation < V > relation , DBIDs ids , WritableDoubleDataStore abodvalues , DoubleMinMax minmaxabod ) { SimilarityQuery < V > sq = db . getSimilarityQuery ( relation , kernelFunction ) ; KernelMatrix kernelMatrix = new KernelMatrix ( sq , relation , ids ) ; MeanVariance s = new Mean... | Full kernel - based version . |
157,038 | public double getWeight ( double distance , double max , double stddev ) { if ( stddev <= 0 ) { return 1 ; } return NormalDistribution . erfc ( MathUtil . SQRTHALF * distance / stddev ) ; } | Return Erfc weight scaled by standard deviation . max is ignored . |
157,039 | public OutlierResult run ( Database database , Relation < O > relation ) { StepProgress stepprog = LOG . isVerbose ( ) ? new StepProgress ( "LOF" , 3 ) : null ; DBIDs ids = relation . getDBIDs ( ) ; LOG . beginStep ( stepprog , 1 , "Materializing nearest-neighbor sets." ) ; KNNQuery < O > knnq = DatabaseUtil . precompu... | Runs the LOF algorithm on the given database . |
157,040 | private void computeLRDs ( KNNQuery < O > knnq , DBIDs ids , WritableDoubleDataStore lrds ) { FiniteProgress lrdsProgress = LOG . isVerbose ( ) ? new FiniteProgress ( "Local Reachability Densities (LRD)" , ids . size ( ) , LOG ) : null ; double lrd ; for ( DBIDIter iter = ids . iter ( ) ; iter . valid ( ) ; iter . adva... | Compute local reachability distances . |
157,041 | protected double computeLRD ( KNNQuery < O > knnq , DBIDIter curr ) { final KNNList neighbors = knnq . getKNNForDBID ( curr , k ) ; double sum = 0.0 ; int count = 0 ; for ( DoubleDBIDListIter neighbor = neighbors . iter ( ) ; neighbor . valid ( ) ; neighbor . advance ( ) ) { if ( DBIDUtil . equal ( curr , neighbor ) ) ... | Compute a single local reachability distance . |
157,042 | private void computeLOFScores ( KNNQuery < O > knnq , DBIDs ids , DoubleDataStore lrds , WritableDoubleDataStore lofs , DoubleMinMax lofminmax ) { FiniteProgress progressLOFs = LOG . isVerbose ( ) ? new FiniteProgress ( "Local Outlier Factor (LOF) scores" , ids . size ( ) , LOG ) : null ; double lof ; for ( DBIDIter it... | Compute local outlier factors . |
157,043 | protected double computeLOFScore ( KNNQuery < O > knnq , DBIDRef cur , DoubleDataStore lrds ) { final double lrdp = lrds . doubleValue ( cur ) ; if ( Double . isInfinite ( lrdp ) ) { return 1.0 ; } double sum = 0. ; int count = 0 ; final KNNList neighbors = knnq . getKNNForDBID ( cur , k ) ; for ( DBIDIter neighbor = n... | Compute a single LOF score . |
157,044 | protected double kNNDistance ( ) { double result = getEntry ( 0 ) . getKnnDistance ( ) ; for ( int i = 1 ; i < getNumEntries ( ) ; i ++ ) { double knnDistance = getEntry ( i ) . getKnnDistance ( ) ; result = ( result < knnDistance ) ? knnDistance : result ; } return result ; } | Computes and returns the aggregated knn distance of this node |
157,045 | public boolean readLine ( Appendable buf ) throws IOException { boolean success = false ; while ( true ) { while ( pos < end ) { success = true ; final char c = buffer [ pos ++ ] ; if ( c == '\n' ) { return success ; } if ( c == '\r' ) { continue ; } buf . append ( c ) ; } assert ( pos >= end ) : "Buffer wasn't empty w... | Read a line into the given buffer . |
157,046 | private static final int bestPivot ( int rank , int m1 , int m2 , int m3 , int m4 , int m5 ) { if ( rank < m1 ) { return m1 ; } if ( rank > m5 ) { return m5 ; } if ( rank < m2 ) { return m2 ; } if ( rank > m4 ) { return m4 ; } return m3 ; } | Choose the best pivot for the given rank . |
157,047 | public void writeExternal ( ObjectOutput out ) throws IOException { super . writeExternal ( out ) ; int k_max = knnDistances . length ; out . writeInt ( k_max ) ; for ( int i = 0 ; i < k_max ; i ++ ) { out . writeDouble ( knnDistances [ i ] ) ; } } | Calls the super method and writes the parameter k_max and the knn distances of this entry to the specified stream . |
157,048 | public void readExternal ( ObjectInput in ) throws IOException , ClassNotFoundException { super . readExternal ( in ) ; int k_max = in . readInt ( ) ; knnDistances = new double [ k_max ] ; for ( int i = 0 ; i < k_max ; i ++ ) { knnDistances [ i ] = in . readDouble ( ) ; } } | Calls the super method and reads the parameter k_max and knn distance of this entry from the specified input stream . |
157,049 | public double getValueAt ( int k ) { if ( k < k_0 ) { return Double . POSITIVE_INFINITY ; } return m * FastMath . log ( k ) + t ; } | Returns the function value of the approximation line at the specified k . |
157,050 | public void iterate ( ) { for ( int i = 0 ; i < numfit ; i ++ ) { System . arraycopy ( alpha [ i ] , 0 , covmat [ i ] , 0 , numfit ) ; covmat [ i ] [ i ] *= ( 1.0 + lambda ) ; } LinearEquationSystem ls = new LinearEquationSystem ( covmat , beta ) ; ls . solveByTotalPivotSearch ( ) ; covmat = ls . getCoefficents ( ) ; d... | Perform an iteration of the approximation loop . |
157,051 | public void run ( ) { int maxruns = this . maxruns , maxsmall = this . maxsmall ; double oldchi = getChiSq ( ) ; while ( maxruns -- > 0 ) { iterate ( ) ; double newchi = getChiSq ( ) , deltachi = newchi - oldchi ; oldchi = newchi ; if ( deltachi < 0 && deltachi > - small && -- maxsmall < 0 ) { break ; } } } | Iterate until convergence at most 100 times . |
157,052 | public double [ ] get ( T object ) { double [ ] v = map . get ( object ) ; if ( v == null ) { return null ; } return v . clone ( ) ; } | Get the position data of the object |
157,053 | public double relativeFill ( ) { double acc = 0.0 ; final int cols = widths . size ( ) ; final int rows = heights . size ( ) ; { for ( int y = 0 ; y < rows ; y ++ ) { for ( int x = 0 ; x < cols ; x ++ ) { if ( usage . get ( y ) . get ( x ) != null ) { acc += widths . get ( x ) * heights . get ( y ) ; } } } } return acc... | Compute the relative fill . Useful for triggering a relayout if the relative fill is not satisfactory . |
157,054 | public boolean contains ( NumberVector vector ) { for ( int i = 0 ; i < dims . length ; i ++ ) { final double value = vector . doubleValue ( dims [ i ] ) ; if ( bounds [ i << 1 ] > value || value >= bounds [ ( i << 1 ) + 1 ] ) { return false ; } } return true ; } | Returns true if the intervals of this unit contain the specified feature vector . |
157,055 | public boolean addFeatureVector ( DBIDRef id , NumberVector vector ) { if ( contains ( vector ) ) { ids . add ( id ) ; return true ; } return false ; } | Adds the id of the specified feature vector to this unit if this unit contains the feature vector . |
157,056 | protected boolean containsRightNeighbor ( CLIQUEUnit unit , int d ) { final int e = dims . length - 1 ; return checkDimensions ( unit , e ) && bounds [ e << 1 ] == unit . bounds [ ( e << 1 ) + 1 ] ; } | Returns true if this unit is the right neighbor of the given unit . |
157,057 | protected CLIQUEUnit join ( CLIQUEUnit other , double all , double tau ) { if ( other . dimensionality ( ) != this . dimensionality ( ) ) { return null ; } int e = dims . length - 1 ; if ( ! checkDimensions ( other , e ) ) { return null ; } if ( dims [ e ] >= other . dims [ e ] ) { return null ; } HashSetModifiableDBID... | Joins this unit with the specified unit . |
157,058 | private boolean checkDimensions ( CLIQUEUnit other , int e ) { for ( int i = 0 , j = 0 ; i < e ; i ++ , j += 2 ) { if ( dims [ i ] != other . dims [ i ] || bounds [ j ] != other . bounds [ j ] || bounds [ j + 1 ] != bounds [ j + 1 ] ) { return false ; } } return true ; } | Check that the first e dimensions agree . |
157,059 | protected synchronized void merge ( DoubleMinMax minmax ) { this . minmax . put ( minmax . getMin ( ) ) ; this . minmax . put ( minmax . getMax ( ) ) ; } | Merge the result of an instance . |
157,060 | public void enableStart ( ) { EventTarget targ = ( EventTarget ) element ; targ . addEventListener ( SVGConstants . SVG_EVENT_MOUSEDOWN , this , false ) ; } | Enable capturing of mousedown events . |
157,061 | public void disableStart ( ) { EventTarget targ = ( EventTarget ) element ; targ . removeEventListener ( SVGConstants . SVG_EVENT_MOUSEDOWN , this , false ) ; } | Disable capturing of mousedown events . |
157,062 | protected void enableStop ( ) { EventTarget targ = svgp . getDocument ( ) . getRootElement ( ) ; targ . addEventListener ( SVGConstants . SVG_EVENT_MOUSEMOVE , this , false ) ; targ . addEventListener ( SVGConstants . SVG_EVENT_MOUSEUP , this , false ) ; targ . addEventListener ( SVGConstants . SVG_EVENT_MOUSEOUT , thi... | Enable capturing of mousemove and mouseup events . |
157,063 | protected void disableStop ( ) { EventTarget targ = svgp . getDocument ( ) . getRootElement ( ) ; targ . removeEventListener ( SVGConstants . SVG_EVENT_MOUSEMOVE , this , false ) ; targ . removeEventListener ( SVGConstants . SVG_EVENT_MOUSEUP , this , false ) ; targ . removeEventListener ( SVGConstants . SVG_EVENT_MOUS... | Disable capturing of mousemove and mouseup events . |
157,064 | protected SVGPoint getCoordinates ( Event evt ) { return SVGUtil . elementCoordinatesFromEvent ( this . svgp . getDocument ( ) , this . coordref , evt ) ; } | Return the event coordinates for this event . |
157,065 | protected boolean startDrag ( SVGPoint startPoint , Event evt ) { if ( listener != null ) { return listener . startDrag ( startPoint , evt ) ; } return true ; } | Action to do on drag start . |
157,066 | protected boolean duringDrag ( SVGPoint startPoint , SVGPoint dragPoint , Event evt , boolean inside ) { if ( listener != null ) { return listener . duringDrag ( startPoint , dragPoint , evt , inside ) ; } return true ; } | Method called during drags . |
157,067 | public void makeInvisible ( ) { CSSClass cls = new CSSClass ( this , "unused" ) ; cls . setStatement ( SVGConstants . CSS_FILL_OPACITY_PROPERTY , "0" ) ; cls . setStatement ( SVGConstants . CSS_CURSOR_PROPERTY , SVGConstants . CSS_POINTER_VALUE ) ; SVGUtil . setAtt ( element , SVGConstants . SVG_STYLE_ATTRIBUTE , cls .... | Make the rectangle invisible . |
157,068 | public void makeVisible ( ) { CSSClass cls = new CSSClass ( this , "unused" ) ; cls . setStatement ( SVGConstants . CSS_FILL_PROPERTY , SVGConstants . CSS_GREEN_VALUE ) ; cls . setStatement ( SVGConstants . CSS_FILL_OPACITY_PROPERTY , "0.2" ) ; cls . setStatement ( SVGConstants . CSS_CURSOR_PROPERTY , SVGConstants . CS... | Make the rectangle visible for debug purposes . |
157,069 | public void setFill ( double val , double min , double max ) { this . val = val ; this . min = min ; this . max = max ; } | Set the fill of the score bar . |
157,070 | public Element build ( SVGPlot svgp , double x , double y , double width , double height ) { Element barchart = svgp . svgElement ( SVGConstants . SVG_G_TAG ) ; Element bar = svgp . svgRect ( x , y , width , height ) ; bar . setAttribute ( SVGConstants . SVG_FILL_ATTRIBUTE , "#a0a0a0" ) ; bar . setAttribute ( SVGConsta... | Build the actual element |
157,071 | void openBuffer ( ) { if ( buffer == null ) { try { buffer = input . map ( MapMode . READ_ONLY , 0 , input . size ( ) ) ; } catch ( IOException e ) { throw new AbortException ( "Cannot map input bundle." , e ) ; } } } | Map the input file . |
157,072 | void readMeta ( ) { final int check = buffer . getInt ( ) ; if ( check != MAGIC ) { throw new AbortException ( "File does not start with expected magic." ) ; } final int nummeta = buffer . getInt ( ) ; assert ( nummeta > 0 ) : "Empty bundle?" ; meta = new BundleMeta ( nummeta ) ; sers = new ByteBufferSerializer < ? > [... | Read the metadata . |
157,073 | void readObject ( ) { for ( int i = 0 ; i < sers . length ; ++ i ) { try { data [ i ] = sers [ i ] . fromByteBuffer ( buffer ) ; } catch ( UnsupportedOperationException e ) { throw new AbortException ( "Deserialization failed." , e ) ; } catch ( IOException e ) { throw new AbortException ( "IO error" , e ) ; } } } | Read an object . |
157,074 | public Clustering < PrototypeModel < O > > run ( Relation < O > relation ) { RangeQuery < O > rq = relation . getRangeQuery ( getDistanceFunction ( ) , threshold ) ; ModifiableDBIDs seen = DBIDUtil . newHashSet ( relation . size ( ) ) ; Clustering < PrototypeModel < O > > clustering = new Clustering < > ( "Prototype cl... | Run the leader clustering algorithm . |
157,075 | public void writeToText ( TextWriterStream out , String label ) { String name = getNameAutomatic ( ) ; if ( name != null ) { out . commentPrintLn ( "Cluster name: " + name ) ; } out . commentPrintLn ( "Cluster noise flag: " + isNoise ( ) ) ; out . commentPrintLn ( "Cluster size: " + ids . size ( ) ) ; if ( getModel ( )... | Write to a textual representation . Writing the actual group data will be handled by the caller this is only meant to write the meta information . |
157,076 | private void scheduleSetPlot ( final SVGPlot oldplot , final SVGPlot newplot ) { UpdateManager um = this . getUpdateManager ( ) ; if ( um != null ) { synchronized ( um ) { if ( um . isRunning ( ) ) { final Runnable detach = new Runnable ( ) { public void run ( ) { if ( latest . compareAndSet ( this , null ) ) { detachP... | Schedule a detach . |
157,077 | private void attachPlot ( SVGPlot newplot ) { this . plot = newplot ; if ( newplot == null ) { super . setSVGDocument ( null ) ; return ; } newplot . synchronizeWith ( synchronizer ) ; super . setSVGDocument ( newplot . getDocument ( ) ) ; super . setDisableInteractions ( newplot . getDisableInteractions ( ) ) ; } | Attach to a new plot and display . |
157,078 | private void detachPlot ( SVGPlot oldplot ) { if ( oldplot == null ) { return ; } this . plot = null ; oldplot . unsynchronizeWith ( synchronizer ) ; } | Execute the detaching event . |
157,079 | protected double estimateID ( DBIDRef ignore , DoubleDBIDListIter it , double [ ] p ) { int j = 0 ; for ( it . seek ( 0 ) ; it . valid ( ) ; it . advance ( ) ) { if ( it . doubleValue ( ) == 0. || DBIDUtil . equal ( ignore , it ) ) { continue ; } p [ j ++ ] = it . doubleValue ( ) ; } if ( j < 2 ) { throw new Arithmetic... | Estimate the local intrinsic dimensionality . |
157,080 | public static double logpdf ( double val , double rate ) { return val < 0. ? Double . NEGATIVE_INFINITY : FastMath . log ( rate ) - rate * val ; } | log PDF static version |
157,081 | public static double quantile ( double val , double rate ) { return val >= 0 && val <= 1 ? - FastMath . log ( 1 - val ) / rate : Double . NaN ; } | Quantile function static version |
157,082 | private MarkdownDocStream pendingBreak ( ) { if ( newline == Newline . NONE ) { return this ; } out . append ( newline == Newline . BREAK ? "\\\n" : newline == Newline . PAR ? "\n\n" : "\n" ) ; for ( int i = indent , j = i ; i > 0 ; i -= j ) { out . append ( WHITESPACES , 0 , ( j = i > WHITESPACES . length ( ) ? WHITES... | Output any pending line breaks . |
157,083 | public MarkdownDocStream append ( char c ) { if ( c == '\n' ) { newline = newline == Newline . NONE ? Newline . NEWLINE : Newline . PAR ; return this ; } pendingBreak ( ) ; out . append ( c ) ; return this ; } | Append a single character . |
157,084 | public MarkdownDocStream append ( CharSequence p , int start , int end ) { for ( int pos = start ; pos < end ; ++ pos ) { final char c = p . charAt ( pos ) ; if ( c == '\r' ) { continue ; } append ( c ) ; } return this ; } | Output part of a string . |
157,085 | public MarkdownDocStream indent ( int newindent ) { if ( newindent < indent ) { newline = newline == Newline . BREAK ? Newline . NEWLINE : Newline . PAR ; } indent = newindent ; return this ; } | Set the indent depth . |
157,086 | public final void render ( GL2 gl ) { gl . glMatrixMode ( GL2 . GL_PROJECTION ) ; gl . glPushMatrix ( ) ; gl . glLoadIdentity ( ) ; gl . glMatrixMode ( GL2 . GL_MODELVIEW ) ; gl . glPushMatrix ( ) ; gl . glLoadIdentity ( ) ; gl . glOrtho ( 0 , width , 0 , height , - 1 , + 1 ) ; gl . glColor4f ( 0f , 0f , 0f , .5f ) ; g... | Main render method |
157,087 | public int setPageID ( P page ) { int pageID = page . getPageID ( ) ; if ( pageID == - 1 ) { pageID = getNextEmptyPageID ( ) ; if ( pageID == - 1 ) { pageID = nextPageID ++ ; } page . setPageID ( pageID ) ; } return pageID ; } | Sets the id of the given page . |
157,088 | public StringBuilder appendToBuffer ( StringBuilder buf ) { Iterator < double [ ] > iter = points . iterator ( ) ; while ( iter . hasNext ( ) ) { double [ ] data = iter . next ( ) ; for ( int i = 0 ; i < data . length ; i ++ ) { if ( i > 0 ) { buf . append ( ',' ) ; } buf . append ( data [ i ] ) ; } if ( iter . hasNext... | Append the polygon to the buffer . |
157,089 | public boolean containsPoint2D ( double [ ] v ) { assert ( v . length == 2 ) ; final double testx = v [ 0 ] ; final double testy = v [ 1 ] ; boolean c = false ; Iterator < double [ ] > it = points . iterator ( ) ; double [ ] pre = points . get ( points . size ( ) - 1 ) ; while ( it . hasNext ( ) ) { final double [ ] cu... | Point in polygon test based on |
157,090 | public static AffineTransformation reorderAxesTransformation ( int dim , int ... axes ) { double [ ] [ ] m = zeroMatrix ( dim + 1 ) ; for ( int i = 0 ; i < axes . length ; i ++ ) { assert ( 0 < axes [ i ] && axes [ i ] <= dim ) ; m [ i ] [ axes [ i ] - 1 ] = 1.0 ; } int useddim = 1 ; for ( int i = axes . length ; i < d... | Generate a transformation that reorders axes in the given way . |
157,091 | public void addTranslation ( double [ ] v ) { assert ( v . length == dim ) ; inv = null ; double [ ] [ ] homTrans = unitMatrix ( dim + 1 ) ; for ( int i = 0 ; i < dim ; i ++ ) { homTrans [ i ] [ dim ] = v [ i ] ; } trans = times ( homTrans , trans ) ; } | Add a translation operation to the matrix |
157,092 | public void addMatrix ( double [ ] [ ] m ) { assert ( m . length == dim ) ; assert ( m [ 0 ] . length == dim ) ; inv = null ; double [ ] [ ] ht = new double [ dim + 1 ] [ dim + 1 ] ; for ( int i = 0 ; i < dim ; i ++ ) { for ( int j = 0 ; j < dim ; j ++ ) { ht [ i ] [ j ] = m [ i ] [ j ] ; } } ht [ dim ] [ dim ] = 1.0 ;... | Add a matrix operation to the matrix . |
157,093 | public void addRotation ( int axis1 , int axis2 , double angle ) { assert ( axis1 >= 0 ) ; assert ( axis1 < dim ) ; assert ( axis1 >= 0 ) ; assert ( axis2 < dim ) ; assert ( axis1 != axis2 ) ; inv = null ; double [ ] [ ] ht = new double [ dim + 1 ] [ dim + 1 ] ; for ( int i = 0 ; i < dim + 1 ; i ++ ) { ht [ i ] [ i ] =... | Convenience function to apply a rotation in 2 dimensions . |
157,094 | public void addAxisReflection ( int axis ) { assert ( 0 < axis && axis <= dim ) ; inv = null ; for ( int i = 0 ; i <= dim ; i ++ ) { trans [ axis - 1 ] [ i ] = - trans [ axis - 1 ] [ i ] ; } } | Add a reflection along the given axis . |
157,095 | public double [ ] homogeneVector ( double [ ] v ) { assert ( v . length == dim ) ; double [ ] dv = Arrays . copyOf ( v , dim + 1 ) ; dv [ dim ] = 1.0 ; return dv ; } | Transform an absolute vector into homogeneous coordinates . |
157,096 | public double [ ] homogeneRelativeVector ( double [ ] v ) { assert ( v . length == dim ) ; double [ ] dv = Arrays . copyOf ( v , dim + 1 ) ; dv [ dim ] = 0.0 ; return dv ; } | Transform a relative vector into homogeneous coordinates . |
157,097 | private double computeConfidence ( int support , int samples ) { final double z = NormalDistribution . standardNormalQuantile ( alpha ) ; final double eprob = support / ( double ) samples ; return Math . max ( 0. , eprob - z * FastMath . sqrt ( ( eprob * ( 1 - eprob ) ) / samples ) ) ; } | Estimate the confidence probability of a clustering . |
157,098 | protected Clustering < ? > runClusteringAlgorithm ( ResultHierarchy hierarchy , Result parent , DBIDs ids , DataStore < DoubleVector > store , int dim , String title ) { SimpleTypeInformation < DoubleVector > t = new VectorFieldTypeInformation < > ( DoubleVector . FACTORY , dim ) ; Relation < DoubleVector > sample = ne... | Run a clustering algorithm on a single instance . |
157,099 | public static void load ( Class < ? > parent , ClassLoader cl ) { char [ ] buf = new char [ 0x4000 ] ; try { String fullName = RESOURCE_PREFIX + parent . getName ( ) ; Enumeration < URL > configfiles = cl . getResources ( fullName ) ; while ( configfiles . hasMoreElements ( ) ) { URL nextElement = configfiles . nextEle... | Load the service file . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.