proost opened a new issue, #79:
URL: https://github.com/apache/datasketches-go/issues/79

   # Summary
   
   Add Go version ArrayOfDouble Tuple Sketch.
   
   # Design
   
   ## ArrayOfDouble Tuple Sketch
   
   ```go
   // Number constraint for types that can be used in ArrayOfNumberSummary.
   // NOTE: Only allowed fixed-size type.
   type Number interface {
        ~int8 | ~int16 | ~int32 | ~int64 |
                ~uint8 | ~uint16 | ~uint32 | ~uint64 |
                ~float32 | ~float64
   }
   
   type ArrayOfNumberSketch[V Number] interface {
        Sketch[*ArrayOfNumberSummary[V]]
   
        // NumValuesInSummary returns the number of values in 
ArrayOfNumberSummary.
        NumValuesInSummary() uint8
   }
   
   // ArrayOfNumberSummary is a fixed-size array of numeric values used as a 
summary in tuple sketches.
   type ArrayOfNumberSummary[T Number] struct {
        values []T
        size   uint8
   }
   
   // Reset clears the content of the summary, restoring it to its initial 
state.
   func (s *ArrayOfNumberSummary[T]) Reset()
   
   // Clone creates and returns a deep copy of the current Summary instance.
   func (s *ArrayOfNumberSummary[T]) Clone() Summary
   
   // Update incorporates a new value into the summary, modifying its internal 
state based on the given input value.
   func (s *ArrayOfNumberSummary[T]) Update(values []T)
   
   // Values returns the values in the summary.
   func (s *ArrayOfNumberSummary[T]) Values() []T
   
   ```
   
   I’ve found that ArrayOfDouble sketch can be numeric array sketch. So i 
expand original one. Because of serialization, i decide to accept fixed size 
number type element array.
   
   - `ArrayOfNumberSketch`  inherit and extend `Sketch` to support numeric 
array summary sketch.
   - `ArrayOfNumberSummary` will do same thing ArrayOfDouble Sketch Summary. So 
will add given `values` when `Update` method is called.
   
   ## ArrayOfNumberUpdateSketch
   
   ```go
   // ArrayOfNumberUpdateSketch builds Tuple sketch from input data via update 
methods.
   // This is a wrapper around a tuple sketch to match the functionality
   // and serialization format of ArrayOfDoublesSketch in Java.
   type ArrayOfNumberUpdateSketch[V Number] struct {
        table                   *hashtable[*ArrayOfNumberSummary[V]]
        numberOfValuesInSummary uint8
   }
   ```
   
   `ArrayOfNumberUpdateSketch` implements `ArrayOfNumberSketch` 
   
   ## ArrayOfNumberCompactSketch
   
   ```go
   // ArrayOfNumberCompactSketch is the immutable, serializable form of an 
array of number tuple sketch.
   type ArrayOfNumberCompactSketch[V Number] struct {
        theta                   uint64
        entries                 []entry[*ArrayOfNumberSummary[V]]
        seedHash                uint16
        numberOfValuesInSummary uint8
        isEmpty                 bool
        isOrdered               bool
   }
   ```
   
   - `ArrayOfNumberCompactSketch` implements `ArrayOfNumberSketch`
   - serialization and deserialization follows encoder & decoder pattern.
   
   # Release Schedule
   
   I will upload 3 PRs.
   
   1. A PR for `ArrayOfNumberUpdateSketch` and interfaces.
   2. A PR for `ArrayOfNumberCompactSketch` and serialization / deserialization.
   3. Set Operations.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to