smErrors

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 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 CheckDimensionsInComparison added in v0.2.0

func CheckDimensionsInComparison(arg1, arg2 MatrixLike, comparisonType string) 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 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 EqualityConstraintRequiredError added in v0.2.0

type EqualityConstraintRequiredError struct {
	Operation string
}

func (EqualityConstraintRequiredError) Error added in v0.2.0

type InequalityConstraintRequiredError added in v0.2.0

type InequalityConstraintRequiredError struct {
	Operation string
}

func (InequalityConstraintRequiredError) Error added in v0.2.0

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 LinearExpressionRequiredError added in v0.2.0

type LinearExpressionRequiredError struct {
	Operation  string
	Expression interface{}
}

func (LinearExpressionRequiredError) Error added in v0.2.0

type MatrixColumnMismatchError

type MatrixColumnMismatchError struct {
	ExpectedNColumns int
	ActualNColumns   int
	Row              int
}

func (MatrixColumnMismatchError) Error

func (mcme MatrixColumnMismatchError) Error() string

type MatrixDimensionError added in v0.2.0

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

MatrixDimensionError Description:

This error is thrown when two matrices do not have the appropriate dimensions
for a given operation.

func (MatrixDimensionError) ArgDimsAsStrings added in v0.2.0

func (de MatrixDimensionError) ArgDimsAsStrings() []string

func (MatrixDimensionError) Error added in v0.2.0

func (de MatrixDimensionError) 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

type VectorDimensionError added in v0.2.0

type VectorDimensionError struct {
	Arg1      VectorLike
	Arg2      VectorLike
	Operation string
}

VectorDimensionError Description:

This error is thrown when two matrices do not have the appropriate dimensions
for a given operation.

func (VectorDimensionError) Error added in v0.2.0

func (de VectorDimensionError) Error() string

type VectorLike added in v0.2.0

type VectorLike interface {
	Len() int
	Dims() []int
}

VectorLike Description:

An interface for all objects that can be treated as vectors.

Jump to

Keyboard shortcuts

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