smErrors

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckDimensionsInAddition

func CheckDimensionsInAddition(left, right MatrixLike) error

func CheckDimensionsInMultiplication

func CheckDimensionsInMultiplication(left, right MatrixLike) error

CheckDimensionsInMultiplication Description:

This function checks that the dimensions of the left and right expressions
are compatible for multiplication.
We allow:
- Multiplication if Dimensions Match OR
- Multiplication if one of the expressions is a scalar

func CheckIndexOnMatrix

func CheckIndexOnMatrix(rowIndex int, colIndex int, matrix MatrixLike) error

CheckIndexOnMatrix Description:

Checks that the index is valid for the matrix.

func CheckIndexOnVector

func CheckIndexOnVector(index int, vector MatrixLike) error

Explicit Functions

func IsScalarExpression

func IsScalarExpression(e MatrixLike) bool

IsScalarExpression Description:

Determines whether or not an input object is a valid "ScalarExpression" according to Dims().

Types

type CanNotGetLinearCoeffOfConstantError

type CanNotGetLinearCoeffOfConstantError struct {
	Expression interface{}
}

func (CanNotGetLinearCoeffOfConstantError) Error

type DimensionError

type DimensionError struct {
	Arg1      MatrixLike
	Arg2      MatrixLike
	Operation string // Either multiply or Plus
}

DimensionError Description:

func (DimensionError) ArgDimsAsStrings

func (de DimensionError) ArgDimsAsStrings() []string

func (DimensionError) Error

func (de DimensionError) Error() string

type EmptyLinearCoeffsError added in v0.1.1

type EmptyLinearCoeffsError struct {
	Expression interface{}
}

Type

func (EmptyLinearCoeffsError) Error added in v0.1.1

func (elce EmptyLinearCoeffsError) Error() string

Error Function

type EmptyMatrixError

type EmptyMatrixError struct {
	Expression MatrixLike
}

Type

func (EmptyMatrixError) Error

func (eme EmptyMatrixError) Error() string

Error Function

type EmptyVectorError

type EmptyVectorError struct {
	Expression MatrixLike
}

Type

func (EmptyVectorError) Error

func (eve EmptyVectorError) Error() string

Error Function

type InvalidMatrixIndexError

type InvalidMatrixIndexError struct {
	RowIndex   int
	ColIndex   int
	Expression MatrixLike
}

func (InvalidMatrixIndexError) Error

func (imi InvalidMatrixIndexError) Error() string

type InvalidVectorIndexError

type InvalidVectorIndexError struct {
	Index      int
	Expression MatrixLike
}

func (InvalidVectorIndexError) Error

func (ivi InvalidVectorIndexError) Error() string

type MatrixColumnMismatchError

type MatrixColumnMismatchError struct {
	ExpectedNColumns int
	ActualNColumns   int
	Row              int
}

func (MatrixColumnMismatchError) Error

func (mcme MatrixColumnMismatchError) Error() string

type MatrixLike

type MatrixLike interface {
	Dims() []int
}

type UnsupportedInputError

type UnsupportedInputError struct {
	FunctionName string
	Input        interface{}
}

Error Definition

func (UnsupportedInputError) Error

func (uie UnsupportedInputError) Error() string

Jump to

Keyboard shortcuts

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