smErrors

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2025 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 CheckDimensionsInHStack added in v0.1.7

func CheckDimensionsInHStack(sliceToStack ...MatrixLike) error

CheckDimensionsInHStack Description:

This function checks that the dimensions of the left and right expressions
are compatible for horizontal stacking.
We allow:
- Stacking if the number of rows match

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 CheckDimensionsInSubtraction added in v0.1.5

func CheckDimensionsInSubtraction(left, right MatrixLike) error

CheckDimensionsInSubtraction Description:

This function checks that the dimensions of the left and right expressions

func CheckDimensionsInVStack added in v0.1.7

func CheckDimensionsInVStack(sliceToStack ...MatrixLike) error

CheckDimensionsInVStack Description:

This function checks that the dimensions of the left and right expressions
are compatible for vertical stacking.
We allow:
- Stacking if the number of columns match

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 NegativeExponentError added in v0.1.6

type NegativeExponentError struct {
	Exponent int
}

Type Definition

func (NegativeExponentError) Error added in v0.1.6

func (e NegativeExponentError) Error() string

Error

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