precalcul

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StirlingMatrix [2000][2000]*big.Int

_____________________________PRE CALCULS____________________________________

Functions

func S3v2pre added in v1.1.0

func S3v2pre(n, k, d int) *big.Int

func S3v4pre added in v1.1.0

func S3v4pre(n, k, d int) *big.Int
    Implementation of the s3 formula (read the readme section Related proposition 9 for more details)
	n - number of elements in the set
	k - number of blocks desired
	d - last element of the unranked prefix

func S3v5pre added in v1.1.0

func S3v5pre(n, k, d int) *big.Int

func UnrankDichoPre

func UnrankDichoPre(n, k int, rank big.Int, vs3 int) [][]int
Unrank set partition lexicographicaly.

This function is the main function of the package and takes 4 arguments as parameters : - n : int, the cardinal of the set to be partitioned. n must be < 2000 - k : int, the number of desired blocks in the result. k must be < 2000 - rank : big.Int, the rank of the desired set partition in the lexicographical order. - whichS3: [|0,2|], the desired version of S3 formula to use (2 is the fastest, 0 is the slowest). For the time complexity, read the README section Related, theorem 12 of the article Example usage:

result := parallelunranking.UnrankDicho(5, 3, *big.NewInt(10), 4)
fmt.Println(result) // Output: [[1 2 3] [4] [5]]

Types

This section is empty.

Jump to

Keyboard shortcuts

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