README
¶
Quickstart
Below an example main.go
:
package main
import (
"fmt"
"github.com/maxgio92/krawler/pkg/matrix"
)
var (
columns = []matrix.Column{
{OrdinateIndex: 0, Points: []string{"A", "B"}}, // part
{OrdinateIndex: 0, Points: []string{"1", "2", "3", "4", "5"}}, // part
{OrdinateIndex: 0, Points: []string{"w", "x", "y", "z"}}, // part
{OrdinateIndex: 0, Points: []string{"E", "F", "G", "H"}}, // part
{OrdinateIndex: 0, Points: []string{"A", "B"}}, // part
}
)
func main() {
for _, v := range columns {
fmt.Println(v.Points)
}
combinations, err := matrix.GetColumnOrderedCombinationRows(columns)
if err != nil {
panic(err)
}
fmt.Println(combinations)
}
Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetColumnOrderedCombinationRows ¶
The combinations are built concatenating one element per column into a row, and traversing all the columns' elements by shifting them from the last to the first columns (decremental abscissa order).
(ordinate) y ^ | 4 | 3 Z |B 2 Y |A 1 X -----------> x (abscissa)
Provided the sample scenario above, this function should combine the elements in the order below:
A + 1 + X A + 1 + Y A + 1 + Z A + 2 + X ... B + 4 + Z
Types ¶
type ErrUnsopportedPointType ¶
type ErrUnsopportedPointType struct {
// contains filtered or unexported fields
}
func NewErrUnsopportedPointType ¶
func NewErrUnsopportedPointType() *ErrUnsopportedPointType
func (*ErrUnsopportedPointType) Error ¶
func (e *ErrUnsopportedPointType) Error() string
Click to show internal directories.
Click to hide internal directories.