Documentation ¶
Index ¶
- type Reader
- type ResultSet
- func (s ResultSet) BlockByteLength() int64
- func (s ResultSet) BlockSize() int64
- func (s ResultSet) DigitsPerWord() int
- func (s ResultSet) FirstDigit() byte
- func (s ResultSet) Len() int
- func (s ResultSet) Less(i, j int) bool
- func (s ResultSet) NewReader(ctx context.Context, bucket obj.Bucket) *Reader
- func (s ResultSet) OffsetToBlockPos(off int64) (blockID, blockOff int64)
- func (s ResultSet) Radix() int
- func (s ResultSet) Swap(i, j int)
- func (s ResultSet) TotalByteLength() int64
- func (s ResultSet) TotalDigits() int64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader is a reader for a ResultSet, starting at the first figit (offset = 0) to the end of the ResultSet. Reader automatically switches to the next object as necessary. Alternatively you can also use ReadAt to read a section of ResultSet. Must be created by NewReader() and the caller must Close() after use.
func (*Reader) Read ¶
Read reads len(p) bytes of packed digits at the current position. Read returns at the end of each block with error == nil. Callers should continue to call Read() if it needs more digits.
func (*Reader) ReadAt ¶
ReadAt reads len(p) bytes of packed digits starting at byte result offset (first byte in the result set is 0). Returns io.EOF at the end of the result set.
type ResultSet ¶
ResultSet is a list of YCD files consisting the same pi calculation result.
func (ResultSet) BlockByteLength ¶
BlockByteLength returns the byte length of each block.
func (ResultSet) DigitsPerWord ¶
DigitsPerWord returns the number of digits per word.
func (ResultSet) FirstDigit ¶
FirstDigit returns the first digit of the result.
func (ResultSet) Less ¶
Less reports whether the element with index i must sort before the element with index j.
func (ResultSet) OffsetToBlockPos ¶
OffSetToBlockPos converts the byte offset off to a set of blockID and blockOff.
func (ResultSet) TotalByteLength ¶
TotalByteLength returns the total byte length of the digits. It doesn't include headers.
func (ResultSet) TotalDigits ¶
TotalDigits returns the total number of digits in the array. y-cruncher doesn't seem to set TotalDigits unless a particular ycd file has a smaller number of digits smaller than the block size. If any file has the total digit field set, this simply returns the value of the field. Otherwise, it returns the sum of block sizes.