Package org.flag4j.util
Class ErrorMessages
java.lang.Object
org.flag4j.util.ErrorMessages
Contains error messages for common errors which may occur.
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final String
Error message for arrays which were expected to be the same length.private static final String
Error message for disallowed axis.private static final String
Error message for disallowed axis.private static final String
Error message for matrices which do not have equal shape.private static final String
Error message for parameters which are expected to be greater than or equal to some threshold.private static final String
Error message for a number of indices which does not match the rank of the tensor being indexed.private static final String
Error message for parameters which are expected to be less than or equal to some threshold.private static final String
Error message for matrices which do not have valid dimensions for matrix multiplication.private static final String
Error message for names parameter which is expected to be greater than or equal to some threshold.private static final String
Error message for named parameter which is expected to be less than or equal to some threshold.private static final String
Error message for named parameter which is expected to be less than or equal to some threshold.private static final String
Error message for the attempted construction of a tensor with a negative dimension value.private static final String
Error message for a negative value when a non-negative was expected.private static final String
Error message for a non-positive value when a positive non-zero value is expected.private static final String
Error message for a parameter which is not within the expected range.private static final String
Error message for shapes which cannot be broadcast.private static final String
Error message for a shape size which cannot contain a specified number of entries.private static final String
Error message wrong shape.private static final String
Error message for parameters which are expected to be square.private static final String
Error message for arrays which do not have the same total number of entries.private static final String
Error message for attempted instantiation of a utility class.private static final String
Error message for vector which was expected to be a column vector.private static final String
Error message for vector which was expected to be row vector. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
equalShapeErrMsg
(Shape shape1, Shape shape2) Gets an error message for two tensors with mismatching shapes.static String
getArrayLengthsMismatchErr
(int... lengths) Gets an error message for arrays which were expected to be the same length.static String
getAxisErr
(int axis) Gets an error message for a disallowed axis.static String
getAxisErr
(int axis, int... allowedAxes) Gets an error message for a disallowed axis.static String
getGreaterEqErr
(double threshold, double value) Gets an error message for a value which was expected to be greater than of equal to a specified threshold but wasn't.static String
getIndicesRankErr
(int numIndices, int rank) Gets an error message for a tensor being indexed with a number of indices not equal to the rank of the tensor.static String
getLessEqErr
(double threshold, double value) Gets an error message for a value which was expected to be less than of equal to a specified threshold but wasn't.static String
getNamedGreaterEqErr
(double threshold, double value, String name) Gets an error message for a value which was expected to be greater than of equal to a specified threshold but wasn't.static String
getNamedLessEqErr
(double threshold, double value, String name) Gets an error message for a value which was expected to be less than of equal to a specified threshold but wasn't.static String
getNamedLessEqErr
(BigInteger threshold, double value, String name) Gets an error message for a value which was expected to be less than of equal to a specified threshold but wasn't.static String
getNegValueErr
(double value) Gets an error message for a negative value when a non-negative was expected.static String
getNonPosErr
(double value) Gets an error message for a non-positive value when a positive, non-zero value was expected.static String
getRangeErr
(double value, double lowerBound, double upperBound, String paramName) Gets an error message for a value which is not within the expected range.static String
getShapeBroadcastErr
(Shape shape1, Shape shape2) Gets an error message for two shapes which cannot be broadcast together.static String
getSquareShapeErr
(Shape shape) Gets an error message for a shape which was expected to be square but was notstatic String
Gets an error message for arrays which do not have the same total number of entries.static String
Gets an error message for an attempted instantiation of a utility class.static String
matMultShapeErrMsg
(Shape shape1, Shape shape2) Gets an error message for two matrices with shapes not conducive with matrix multiplication.static String
negativeDimErrMsg
(int[] dims) Gets an error message for an attempted construction of a tensor with a negative dimension.static String
shapeEntriesError
(Shape shape, int numEntries) Gets an error message for a shape which cannot hold a specified number of entries.static String
shapeRankErr
(int actRank, int expRank) Gets an error message for an incorrect shape.static String
vecColOrientErrMsg
(Shape shape) Gets an error message for a vector which was expected to be a column vector but was a row vector.static String
vecRowOrientErrMsg
(Shape shape) Gets an error message for a vector which was expected to be a row vector but was a column vector.
-
Field Details
-
EQ_SHAPE_MISMATCH_ERR
Error message for matrices which do not have equal shape.- See Also:
-
MAT_MULT_DIM_MISMATCH_ERR
Error message for matrices which do not have valid dimensions for matrix multiplication.- See Also:
-
VEC_ROW_ORIENTATION_ERR
Error message for vector which was expected to be row vector.- See Also:
-
VEC_COL_ORIENTATION_ERR
Error message for vector which was expected to be a column vector.- See Also:
-
NEG_DIM_ERR
Error message for the attempted construction of a tensor with a negative dimension value.- See Also:
-
UTILITY_CLASS_ERR
Error message for attempted instantiation of a utility class.- See Also:
-
NEG_VALUE_ERR
Error message for a negative value when a non-negative was expected.- See Also:
-
NON_POS_ERR
Error message for a non-positive value when a positive non-zero value is expected.- See Also:
-
AXIS_ERR_RANGE
-
AXIS_ERR
-
SHAPE_RANK_ERR
-
SHAPE_ENTRIES_ERR
Error message for a shape size which cannot contain a specified number of entries.- See Also:
-
ARRAY_LENGTHS_MISMATCH_ERR
Error message for arrays which were expected to be the same length.- See Also:
-
INDICES_RANK_ERR
Error message for a number of indices which does not match the rank of the tensor being indexed.- See Also:
-
SHAPE_BROADCAST_ERR
Error message for shapes which cannot be broadcast.- See Also:
-
TOTAL_ENTRIES_ERR
Error message for arrays which do not have the same total number of entries.- See Also:
-
GREATER_EQ_ERR
Error message for parameters which are expected to be greater than or equal to some threshold.- See Also:
-
NAMED_GREATER_EQ_ERR
Error message for names parameter which is expected to be greater than or equal to some threshold.- See Also:
-
LESS_EQ_ERR
Error message for parameters which are expected to be less than or equal to some threshold.- See Also:
-
NAMED_LESS_EQ_ERR
Error message for named parameter which is expected to be less than or equal to some threshold.- See Also:
-
NAMED_LESS_EQ_BI_ERR
Error message for named parameter which is expected to be less than or equal to some threshold.- See Also:
-
SQUARE_SHAPE_ERR
Error message for parameters which are expected to be square.- See Also:
-
RANGE_ERR
Error message for a parameter which is not within the expected range.- See Also:
-
-
Constructor Details
-
ErrorMessages
private ErrorMessages()Hide default constructor.
-
-
Method Details
-
equalShapeErrMsg
-
matMultShapeErrMsg
Gets an error message for two matrices with shapes not conducive with matrix multiplication.- Parameters:
shape1
- The shape of the first matrix.shape2
- The shape of the second matrix.- Returns:
- An error message for matrices with shapes not conducive with matrix multiplication.
-
vecRowOrientErrMsg
-
vecColOrientErrMsg
-
negativeDimErrMsg
Gets an error message for an attempted construction of a tensor with a negative dimension.- Parameters:
dims
- Shape of the tensor.- Returns:
- An error message for negative dimension.
-
getUtilityClassErrMsg
Gets an error message for an attempted instantiation of a utility class.- Returns:
- An error message for the attempted instantiation of a utility class;
-
getNegValueErr
Gets an error message for a negative value when a non-negative was expected.- Parameters:
value
- Negative value.- Returns:
- An error message for a negative value.
-
getNonPosErr
Gets an error message for a non-positive value when a positive, non-zero value was expected.- Parameters:
value
- Non-positive value.- Returns:
- An error message for a Non-positive value.
-
getAxisErr
Gets an error message for a disallowed axis.- Parameters:
axis
- Negative value.allowedAxes
- An array containing allowed axes.- Returns:
- An error message for a disallowed axis.
-
getAxisErr
Gets an error message for a disallowed axis.- Parameters:
axis
- Negative value.- Returns:
- An error message for a disallowed axis.
-
shapeRankErr
Gets an error message for an incorrect shape.- Parameters:
actRank
- Actual rank of the shape.expRank
- Expected rank of the shape.- Returns:
- An error message for a shape object with wrong shape.
-
shapeEntriesError
Gets an error message for a shape which cannot hold a specified number of entries.- Parameters:
shape
- Shape.numEntries
- Number of entries to hold.- Returns:
- An error message for a shape which cannot hold a specified number of entries.
-
getArrayLengthsMismatchErr
Gets an error message for arrays which were expected to be the same length.- Parameters:
lengths
- Lengths of arrays.- Returns:
- An error message for arrays which were expected to be the same length.
-
getIndicesRankErr
Gets an error message for a tensor being indexed with a number of indices not equal to the rank of the tensor.- Parameters:
numIndices
- Number of indices.rank
- Rank of the tensor.- Returns:
- An error message for a tensor being indexed with a number if indices not equal ot the rank of the tensor.
-
getShapeBroadcastErr
-
getTotalEntriesErr
Gets an error message for arrays which do not have the same total number of entries.- Returns:
- An error message for arrays which do not have the same total number of entries.
-
getGreaterEqErr
Gets an error message for a value which was expected to be greater than of equal to a specified threshold but wasn't.- Parameters:
threshold
- Threshold value.value
- Value expected to be greater than or equal to the threshold value.- Returns:
- An error message for a value which was expected to be greater than of equal to a specified threshold but wasn't.
-
getNamedGreaterEqErr
Gets an error message for a value which was expected to be greater than of equal to a specified threshold but wasn't.- Parameters:
threshold
- Threshold value.value
- Value expected to be greater than or equal to the threshold value.- Returns:
- An error message for a value which was expected to be greater than of equal to a specified threshold but wasn't.
-
getLessEqErr
Gets an error message for a value which was expected to be less than of equal to a specified threshold but wasn't.- Parameters:
threshold
- Threshold value.value
- Value expected to be less than or equal to the threshold value.- Returns:
- An error message for a value which was expected to be greater than of equal to a specified threshold but wasn't.
-
getNamedLessEqErr
Gets an error message for a value which was expected to be less than of equal to a specified threshold but wasn't.- Parameters:
threshold
- Threshold value.value
- Value expected to be less than or equal to the threshold value.- Returns:
- An error message for a value which was expected to be greater than of equal to a specified threshold but wasn't.
-
getNamedLessEqErr
Gets an error message for a value which was expected to be less than of equal to a specified threshold but wasn't.- Parameters:
threshold
- Threshold value.value
- Value expected to be less than or equal to the threshold value.- Returns:
- An error message for a value which was expected to be greater than of equal to a specified threshold but wasn't.
-
getSquareShapeErr
-
getRangeErr
public static String getRangeErr(double value, double lowerBound, double upperBound, String paramName) Gets an error message for a value which is not within the expected range.- Parameters:
value
- Value of interest.lowerBound
- Lower bound of expected range.upperBound
- Upper bound of expected range.paramName
- Name of the parameter which has the specifiedvalue
.- Returns:
- An error message for the parameter being out of the expected range.
-