Adds two GeneralMatrix objects and stores the
result in a third GeneralMatrix.
Namespace: Extreme.Mathematics.LinearAlgebra
Assembly: Extreme.Numerics (Extreme.Numerics)
Syntax
| Visual Basic (Declaration) |
|---|
Public Shared Function Add ( _ matrix1 As GeneralMatrix, _ factor As Double, _ matrix2 As GeneralMatrix, _ resultMatrix As GeneralMatrix _ ) As GeneralMatrix |
| C# |
|---|
public static GeneralMatrix Add ( GeneralMatrix matrix1, double factor, GeneralMatrix matrix2, GeneralMatrix resultMatrix ) |
| C++ |
|---|
public: static GeneralMatrix^ Add ( GeneralMatrix^ matrix1, double factor, GeneralMatrix^ matrix2, GeneralMatrix^ resultMatrix ) |
Parameters
- matrix1 (Extreme.Mathematics.LinearAlgebra.GeneralMatrix)
- The first GeneralMatrix.
- factor (System.Double)
- A Double that specifies the multiplier for the second matrix.
- matrix2 (Extreme.Mathematics.LinearAlgebra.GeneralMatrix)
- The second GeneralMatrix.
- resultMatrix (Extreme.Mathematics.LinearAlgebra.GeneralMatrix)
- A GeneralMatrix that is to receive the result of the multiplication.
Return Value
A reference to resultMatrix.
Remarks
This method uses level 1 BLAS routines to perform the addition. It is the most efficient way
to add matrices of type GeneralMatrix.
The dimensions of the three matrices must be the same. Otherwise, an exception of type DimensionMismatchException is thrown.
Exceptions
| Exception | Condition |
|---|---|
| ArgumentNullException | matrix1 is nullNothingnullptr -or- matrix2 is nullNothingnullptr -or- resultMatrix is nullNothingnullptr |
| DimensionMismatchException |
The dimensions of matrix2 does not
equal the dimensions of matrix1.
-or- The dimensions of resultMatrix does not equal the dimensions of matrix1. |