commands

package
v0.0.0-...-030cd51 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2021 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Matrix

type Matrix struct {
}

func (*Matrix) Echo

func (_ *Matrix) Echo(matrix [][]int) (string, error)

Echo returns the matrix as a string in matrix format.

func (*Matrix) Flatten

func (_ *Matrix) Flatten(matrix [][]int) (string, error)

Flatten returns the matrix as a 1 line string, with values separated by commas.

func (*Matrix) Invert

func (m *Matrix) Invert(matrix [][]int) (string, error)

Invert returns the matrix as a string in matrix format where the columns and rows are inverted

func (*Matrix) Multiply

func (_ *Matrix) Multiply(matrix [][]int) (string, error)

Multiply returns the product of the integers in the matrix. Will return multiply overflow if the multiplication overflows.

func (*Matrix) Sum

func (_ *Matrix) Sum(matrix [][]int) (string, error)

Sum returns the sum of the integers in the matrix. Will return sum overflow error if the addition overflows.

type MatrixOperations

type MatrixOperations interface {
	Echo(matrix [][]int) (string, error)
	Flatten(matrix [][]int) (string, error)
	Invert(matrix [][]int) (string, error)
	Multiply(matrix [][]int) (string, error)
	Sum(matrix [][]int) (string, error)
}

Jump to

Keyboard shortcuts

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