Represents an exception that is thrown when the dimensions
of a matrix or vector are not compatible for the requested operation.
SystemObject SystemException SystemSystemException SystemArgumentException Extreme.MathematicsDimensionMismatchException
Namespace:
Extreme.Mathematics
Assembly:
Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.1
[SerializableAttribute]
public class DimensionMismatchException : ArgumentException
<SerializableAttribute>
Public Class DimensionMismatchException
Inherits ArgumentException
[SerializableAttribute]
public ref class DimensionMismatchException : public ArgumentException
[<SerializableAttribute>]
type DimensionMismatchException =
class
inherit ArgumentException
end
The DimensionMismatchException type exposes the following members.
| Name | Description |
---|
 | DimensionMismatchException |
Constructs a new DimensionMismatchException.
|
 | DimensionMismatchException(String) |
Constructs a new DimensionMismatchException.
|
 | DimensionMismatchException(SerializationInfo, StreamingContext) | |
 | DimensionMismatchException(String, Exception) |
Constructs a new DimensionMismatchException.
|
 | DimensionMismatchException(DimensionType, String, DimensionType) |
Constructs a new DimensionMismatchException.
|
 | DimensionMismatchException(DimensionType, String, String) |
Constructs a new DimensionMismatchException.
|
 | DimensionMismatchException(DimensionType, String, DimensionType, String) |
Constructs a new DimensionMismatchException.
|
 | DimensionMismatchException(String, Exception, DimensionType, String, DimensionType, String) |
Constructs a new DimensionMismatchException.
|
Top
| Name | Description |
---|
 | Data | Gets a collection of key/value pairs that provide additional user-defined information about the exception. (Inherited from Exception.) |
 | FirstDimensionType |
Gets which dimension of the first object was mismatched.
|
 | FirstParameterName |
Gets the name of the first parameter whose dimensions were mismatched.
|
 | HelpLink | Gets or sets a link to the help file associated with this exception. (Inherited from Exception.) |
 | HResult | Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception. (Inherited from Exception.) |
 | InnerException | Gets the Exception instance that caused the current exception. (Inherited from Exception.) |
 | Message | Gets the error message and the parameter name, or only the error message if no parameter name is set. (Inherited from ArgumentException.) |
 | ParamName | Gets the name of the parameter that causes this exception. (Inherited from ArgumentException.) |
 | SecondDimensionType |
Gets which dimension of the second object was mismatched.
|
 | SecondParameterName |
Gets the name of the second parameter whose dimensions were mismatched.
|
 | Source | Gets or sets the name of the application or the object that causes the error. (Inherited from Exception.) |
 | StackTrace | Gets a string representation of the immediate frames on the call stack. (Inherited from Exception.) |
 | TargetSite | Gets the method that throws the current exception. (Inherited from Exception.) |
Top
Top
| Name | Description |
---|
 | SerializeObjectState | Occurs when an exception is serialized to create an exception state object that contains serialized data about the exception. (Inherited from Exception.) |
Top
There are many reasons why a
DimensionMismatchException may be thrown.
In every case, the dimensions of some or all of the
VectorT or MatrixT arguments
involved in an operation are not compatible.
Some examples of requirements that may be violated,
resulting in a DimensionMismatchException, are:
- A method requires a MatrixT to be square.
The matrix that was supplied is rectangular.
- An operation on two VectorT objects
requires that the two vectors have the same length.
Most operations on vectors have this requirement.
- A multiplication of a MatrixT and a
VectorT requires that either the number of
rows or the number of columns in the matrix equals the
length of the vector.
- A multiplication of two matrices requires that the
'inner' dimensions are the same.
A number of properties give more information about
the cause of the exception: FirstDimensionType,
FirstParameterName, SecondDimensionType
and SecondParameterName.
You can avoid this exception by verifying that the dimensions of
the objects (RowCount, ColumnCount and/or
Length) are compatible for the operation you want to perform.
Reference