vpcv1

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GeneratePermutations

func GeneratePermutations(numElems int) [][]bool

GeneratePermutations returns all the orderings (of booleans) for a given number of elements

Params

numElems - the number of elements

Returns

an array of boolean arrays

func GenerateSomePermutations

func GenerateSomePermutations(numElems int, returnSize int, randAll bool) [][]bool

GenerateSomePermutations returns "some" permutations (of booleans) for a given number of elements. Eg if numElems == 3, 9 (ie 3^2) permutations will be returned...

Params

	  numElems - the number of elements of each array.. in the return array
   returnSize - size of each return array (may require padding. Which can be with random vars or not...)
   randAll - randomize the elements that "fill" the random array (we pad at the beginning). false = no randomization => deterministic values

Returns

an array of boolean arrays (each of the given size), containing the combinations

func GetBinaryRep

func GetBinaryRep(i int, size int) string

GetBinaryRep generates a binary representation in string format

Params

i  - an integer >= 0
size  >= 2^i

Returns

a string with binary representation of the integer, of length == size

func TypeVal

func TypeVal(value interface{}) interface{}

TypeVal converts an interface to a type (for string, *string, bool, *bool, map[string]string, *map[string]string)

Params

value - a value. Cannot be nil

Returns

the value of the parameter (of the appopriate type, dereferenced if a pointer), or nil

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL