pairwise

package
v0.72.1 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckSliceItemExistence

func CheckSliceItemExistence(combinsFullValid [][]interface{}, pairWise PairWise) int

func GetFoundPwCount

func GetFoundPwCount(co chan int, wg *sync.WaitGroup, combinsFullValid [][]interface{}, pwLen int,
	indvalue []int, subCombValid []interface{})

func GetMaxPairWiseCombinationNumber

func GetMaxPairWiseCombinationNumber(combs [][]interface{}, PwLength int) int

to get the total number of pairwise combinations

func GetPairIds

func GetPairIds(items []interface{}) []interface{}

func GetPairIdsBk

func GetPairIdsBk(items []interface{}) []interface{}

items -> []Item, return []string -> []Id

func GetPairWise

func GetPairWise(c chan []interface{}, combins [][]interface{}, PwLength int)

here is the entry for pairwise algorithm 1

func GetPairWise12

func GetPairWise12(indexCombs chan []int, combins [][]interface{}, pwLength int)

func GetPairWise2

func GetPairWise2(validVectors [][]interface{}, pwLength int)

func GetPairWise22

func GetPairWise22(validVectors [][]interface{}, pwLength int)

func GetPairWisedTestCases

func GetPairWisedTestCases(combinsFullValidP [][]interface{}, pwLen int, indexPW [][]int)

func GetWorkingItemMatrix

func GetWorkingItemMatrix(combs [][]interface{}) [][]Item

to get the item matrix with type Item

func RemoveSliceItem

func RemoveSliceItem(sourceSlice [][]interface{}, item []interface{}) [][]interface{}

Types

type AllPairs

type AllPairs struct {
	PwLength                     int
	Pairs                        PairsStorage
	MaxPairWiseCombinationNumber int
	WorkingItemMatrix            [][]Item        // [][]Item
	PairWiseTestCaseData         [][]interface{} // [][]Item.Value
}

to define the item for each element

func (AllPairs) NextPairWiseTestCaseData

func (allPairs AllPairs) NextPairWiseTestCaseData() []interface{}

-------------------------------------------------------------------------

type Item

type Item struct {
	Id      string
	Value   interface{}
	Weights []int
}

func (Item) Append

func (item Item) Append(weight int)

type Items

type Items []Item

Implements the Interface in sort package, used for Item sort

type Interface interface {
    Len() int
    Less(i, j int) bool
    Swap(i, j int)
}

func (Items) Len

func (items Items) Len() int

func (Items) Less

func (items Items) Less(i, j int) bool

func (Items) Swap

func (items Items) Swap(i, j int)

type KeyCache

type KeyCache struct {
	PairItems [][]interface{} // [][]Item ->for Item
	PairIds   [][]interface{} // [][]string -> for id
}

Note: in Python, key_cache (KeyCache) is dict, with tuple(items) as key, tuple(ids) is value

{
    (<allpairspy.allpairs.Item object at 0x1015dd2e8>,): ('a0v0',),
    (<allpairspy.allpairs.Item object at 0x1015dd358>,): ('a0v1',),
    (<allpairspy.allpairs.Item object at 0x1015dd3c8>,): ('a0v2',)
}

type Node

type Node struct {
	Id      string
	Counter int
	InIds   []string // ensure no duplicate
	OutIds  []string // ensure no duplicate
}

for the element already added / arranged

type PairWise

type PairWise struct {
	PwLength         int
	PwVectorIndices  []int
	PwElementIndices []int
	PwValues         []interface{}
}

func (PairWise) ContainsVectorIndex

func (pw PairWise) ContainsVectorIndex(pos int) bool

type PairWises

type PairWises struct {
	PairWises map[string][]PairWise
}

Below is for pairwise data

type PairsStorage

type PairsStorage struct {
	PwLength   int
	PwNodes    map[string]Node   // Note: in Python, this is dict -> {'id': Node, ...}
	PwCombsArr [][][]interface{} // ensure no duplicate

}

for the elements already added / arranged

func (PairsStorage) AddCombination

func (pairs PairsStorage) AddCombination(combination []interface{})

combination -> [1]item, ..., [PwLength]item

func (PairsStorage) AddSequence

func (pairs PairsStorage) AddSequence(sequence []interface{})

sequence -> [PwLength]item, which has been choseen for the next test data (case)

func (PairsStorage) GetCombs

func (pairs PairsStorage) GetCombs() [][][]interface{}

func (PairsStorage) GetNodeInfo

func (pairs PairsStorage) GetNodeInfo(item interface{}) Node

func (PairsStorage) Length

func (pairs PairsStorage) Length() int

Jump to

Keyboard shortcuts

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