package
Version:
v0.0.0-...-1effa6f
Opens a new window with list of versions in this module.
Published: Feb 15, 2021
License: AGPL-3.0, AGPL-3.0-only
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package basic contains common structures, slices and maps used within the jbig2 package.
Abs get the absolute value of the integer 'v'.
func Ceil(numerator, denominator int) int
Ceil gets the 'ceil' value for the provided 'numerator' and 'denominator'.
Max gets the maximum value from the provided 'x', 'y' arguments.
Min gets the minimal value from the provided 'x' and 'y' arguments.
Sign gets the float32 sign of the 'v' value.
If the value 'v' is greater or equal to 0.0 the function returns 1.0.
Otherwise it returns '-1.0'.
IntSlice is the integer slice that contains panic safe methods.
NewIntSlice creates new integer slice.
Add adds the integer 'v' to the slice
Copy creates a copy of given int slice.
Get gets the integer at 'index'.
Returns error if the index is out of range or given integer doesn't exists.
Size returns the size of the int slice.
IntsMap is a wrapper over the map[uint64][]int.
The 'key' collisions are stored under subsequent slice positions.
Add adds the 'value' to the ints map at the 'key'.
Delete delete the 'key' records.
Get gets the first int value at the 'key'.
GetSlice gets the int slice located at the 'key'.
NumSlice is the slice of the numbers that has a panic safe API.
NewNumSlice creates a new NumSlice pointer.
Add adds the float32 'v' value.
AddInt adds the 'v' integer value to the num slice.
Get the float32 value at 'i' index. Returns error if the index 'i' is out of range.
GetInt gets the integer value at the 'i' position.
The functions return errors if the index 'i' is out of range.
Returns '0' on error.
GetIntSlice gets the slice of integers from the provided 'NumSlice' values.
type Stack struct {
Data []interface{}
Aux *Stack
}
Stack is the LIFO data structure implementation
Len returns the size of the stack.
func (s *Stack) Peek() (v interface{}, ok bool)
Peek returns the top element of the stack 's'.
returns false if the stack is zero length.
func (s *Stack) Pop() (v interface{}, ok bool)
Pop the top element of the slack and returns it.
Returns false if the stack is 'zero' length.
func (s *Stack) Push(v interface{})
Push adds the 'v' element to the top of the stack.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.