Метод | Описание | |
---|---|---|
Add ( string s, ulong amountToAdd = 1 ) : ResultOfUpdate |
An Add function that is equivalent to calling
|
|
ConservativeAdd ( string s, ulong amountToAdd = 1 ) : ResultOfUpdate |
An Add function that is equivalent to calling
|
|
ConservativeIncrement ( string s ) : ResultOfUpdate |
Count the observation of the string s by adding one to those values indexed by calling
|
|
Get ( long elementIndexes ) : ResultOfGet |
Get the current state of the sketch for a value's row indexes into each column.
|
|
Get ( string s ) : ResultOfGet |
Get the current state of the sketch for a value's row indexes into each column.
|
|
GetColumnTotal ( int column ) : ulong |
Get the total value stored in a columnn
|
|
GetMin ( string s ) : ulong |
Get the minimum of all the values at the indexes identified for the string s with the sketch. This is a lower bound on the number of times the string s has been witnessed by the sketch via a call to increment(s) and/or conservativeIncrement(s). However, counting stops when the maximum value storable in the sketch is reached.
|
|
Increment ( string s ) : ResultOfUpdate |
Count the observation of the string s by adding one to the value in each table indexed by calling
|
|
IsNonZero ( string s ) : bool |
Test whether a string s has never be witnessed before by seeing if
|
|
Sketch ( long numberOfColumns, long numberOfRows, int bitsPerElement ) : System |
A sketch can be viewed as either having k tables (one for each hash) of n elements or as a two-dimensional array of k columns * n rows. This constructor creates a Sketch of size specified by k, n, and the number of bits per element.
|
|
this ( long elementIndexes ) : ulong |
A shortcut to set all the elements of the sketch identified by an array of indexes, or to Get the minimum of all the values at the indexes identified by the array of indexes.
|
|
this ( string s ) : ulong |
A shortcut to set all the elements of the sketch identified by indexes for the string s or to Get the minimum of all the values at the indexes identified for the string s (equivalent to calling
|
Метод | Описание | |
---|---|---|
Add ( long elementIndexForEachColumn, ulong amountToAdd = 1 ) : ResultOfUpdate |
Add to the the value at each [column,index] pair, where the index into elementIndexForEachColumnis the column number and the value is the row (element) index. If adding would cause the value to exceed MaxValue, MaxValue will be stored instead.
|
|
ConservativeAdd ( long elementIndexForEachColumn, ulong amountToAdd = 1 ) : ResultOfUpdate |
Use the conservative algorithm to Add to the data structure such that for each [column][row], the value stored is no less than
|
|
GetIndexesForString ( string s ) : long[] |
Given a string s, provides an index into each column of the sketch. Each index identifies a row (element) to which one can write (if adding members/counts) or read (if testing membership or min counts). SECURITY NOTE: This indexes can be predicted by an adversary. If using the sketch in a scenario in which an adversary may cause harm by targeting certain indexes, include as a prefix of the parameter s a key that is not publicly-known (and hopefully can be kept secret from any adversaries). In other words, ulong[] indexesIntoSketch = getIndexesForString( key + s ).
|
|
Read ( long column, long row ) : ulong |
Read from the underlying sketch data structure (two-dimensional array) at column (Table) column and row (element) row.
|
|
Write ( long column, long row, ulong value ) : void |
WriteAccountToStableStoreAsync value to the underlying sketch data structure (two-dimensional array) at column (Table) column and row (element) row.
|
protected Add ( long elementIndexForEachColumn, ulong amountToAdd = 1 ) : ResultOfUpdate | ||
elementIndexForEachColumn | long | An array for which the index is a columnn number and the value /// is the row (element) index. |
amountToAdd | ulong | The amount to Add to each of the indexed elements. |
Результат | ResultOfUpdate |
public Add ( string s, ulong amountToAdd = 1 ) : ResultOfUpdate | ||
s | string | The string to witness. |
amountToAdd | ulong | The number of times to witness it. /// that would result before the Add. |
Результат | ResultOfUpdate |
protected ConservativeAdd ( long elementIndexForEachColumn, ulong amountToAdd = 1 ) : ResultOfUpdate | ||
elementIndexForEachColumn | long | An array for which the index is a columnn number and the value /// is the row (element) index. |
amountToAdd | ulong | The desired increase such that getMin(
/// after the operation returns is getMin(
/// (unless doing so would cause the result to exceed MaxValue). |
Результат | ResultOfUpdate |
public ConservativeAdd ( string s, ulong amountToAdd = 1 ) : ResultOfUpdate | ||
s | string | The string to witness. |
amountToAdd | ulong | The number of times to witness it. /// that would result before the Add. |
Результат | ResultOfUpdate |
public ConservativeIncrement ( string s ) : ResultOfUpdate | ||
s | string | The string to witness. |
Результат | ResultOfUpdate |
public Get ( long elementIndexes ) : ResultOfGet | ||
elementIndexes | long | The row indexes into each column of the sketch |
Результат | ResultOfGet |
public Get ( string s ) : ResultOfGet | ||
s | string | The string to query the sketch for occurrence/frequency information. |
Результат | ResultOfGet |
public GetColumnTotal ( int column ) : ulong | ||
column | int | The column |
Результат | ulong |
protected GetIndexesForString ( string s ) : long[] | ||
s | string | A string to map to indexes pointing into each column (table) of the sketch. /// If used in adversarial contexts, create a key string and include /// prefix all calls to this method with that key. /// |
Результат | long[] |
public GetMin ( string s ) : ulong | ||
s | string | The string to query for the minimum occurrence count of. |
Результат | ulong |
public Increment ( string s ) : ResultOfUpdate | ||
s | string | The string to witness. |
Результат | ResultOfUpdate |
public IsNonZero ( string s ) : bool | ||
s | string | The string to test. |
Результат | bool |
protected Read ( long column, long row ) : ulong | ||
column | long | The column (table) to read from. |
row | long | The row (element) within the table (column). |
Результат | ulong |
public Sketch ( long numberOfColumns, long numberOfRows, int bitsPerElement ) : System | ||
numberOfColumns | long | The number of columns in the sketch, which is equivalent to the number of tables (one table per hash index). |
numberOfRows | long | The number of rows, which is equivalent to the number of elements per table. |
bitsPerElement | int | The size of each element, in bits, such that the maximum value that can be stored (MaxValue) /// in the sketch elements is 2^(n)-1. |
Результат | System |
protected Write ( long column, long row, ulong value ) : void | ||
column | long | The column (table) to write to. |
row | long | The row (element) within the column (table). |
value | ulong | The value to write. |
Результат | void |
public this ( long elementIndexes ) : ulong | ||
elementIndexes | long | An array of indexes into the sketch, one for each column (table). |
Результат | ulong |
public this ( string s ) : ulong | ||
s | string | A string to map to indexes pointing into each column (table) of the sketch. |
Результат | ulong |