Public Member Functions | |
GeneralMatrix (int m, int n) | |
Construct an m-by-n matrix of zeros. | |
GeneralMatrix (int m, int n, double s) | |
Construct an m-by-n constant matrix. | |
GeneralMatrix (double[][] A) | |
Construct a matrix from a 2-D array. | |
GeneralMatrix (double[][] A, int m, int n) | |
Construct a matrix quickly without checking arguments. | |
GeneralMatrix (double[] vals, int m) | |
Construct a matrix from a one-dimensional packed array. | |
virtual GeneralMatrix | Copy () |
Make a deep copy of a matrix. | |
virtual double | GetElement (int i, int j) |
Get a single element. | |
virtual GeneralMatrix | GetMatrix (int i0, int i1, int j0, int j1) |
Get a submatrix. | |
virtual GeneralMatrix | GetMatrix (int[] r, int[] c) |
Get a submatrix. | |
virtual GeneralMatrix | GetMatrix (int i0, int i1, int[] c) |
Get a submatrix. | |
virtual GeneralMatrix | GetMatrix (int[] r, int j0, int j1) |
Get a submatrix. | |
virtual void | SetElement (int i, int j, double s) |
Set a single element. | |
virtual void | SetMatrix (int i0, int i1, int j0, int j1, GeneralMatrix X) |
Set a submatrix. | |
virtual void | SetMatrix (int[] r, int[] c, GeneralMatrix X) |
Set a submatrix. | |
virtual void | SetMatrix (int[] r, int j0, int j1, GeneralMatrix X) |
Set a submatrix. | |
virtual void | SetMatrix (int i0, int i1, int[] c, GeneralMatrix X) |
Set a submatrix. | |
virtual GeneralMatrix | Transpose () |
Matrix transpose. | |
virtual double | Norm1 () |
One norm. | |
virtual double | Norm2 () |
Two norm. | |
virtual double | NormInf () |
Infinity norm. | |
virtual double | NormF () |
Frobenius norm. | |
virtual GeneralMatrix | UnaryMinus () |
Unary minus. | |
virtual GeneralMatrix | Add (GeneralMatrix B) |
C = A + B. | |
virtual GeneralMatrix | AddEquals (GeneralMatrix B) |
A = A + B. | |
virtual GeneralMatrix | Subtract (GeneralMatrix B) |
C = A - B. | |
virtual GeneralMatrix | SubtractEquals (GeneralMatrix B) |
A = A - B. | |
virtual GeneralMatrix | ArrayMultiply (GeneralMatrix B) |
Element-by-element multiplication, C = A.*B. | |
virtual GeneralMatrix | ArrayMultiplyEquals (GeneralMatrix B) |
Element-by-element multiplication in place, A = A.*B. | |
virtual GeneralMatrix | ArrayRightDivide (GeneralMatrix B) |
Element-by-element right division, C = A./B. | |
virtual GeneralMatrix | ArrayRightDivideEquals (GeneralMatrix B) |
Element-by-element right division in place, A = A./B. | |
virtual GeneralMatrix | ArrayLeftDivide (GeneralMatrix B) |
Element-by-element left division, C = A.. | |
virtual GeneralMatrix | ArrayLeftDivideEquals (GeneralMatrix B) |
Element-by-element left division in place, A = A.. | |
virtual GeneralMatrix | Multiply (double s) |
Multiply a matrix by a scalar, C = s*A. | |
virtual GeneralMatrix | MultiplyEquals (double s) |
Multiply a matrix by a scalar in place, A = s*A. | |
virtual GeneralMatrix | Multiply (GeneralMatrix B) |
Linear algebraic matrix multiplication, A * B. | |
virtual LUDecomposition | LUD () |
LU Decomposition. | |
virtual QRDecomposition | QRD () |
QR Decomposition. | |
virtual CholeskyDecomposition | chol () |
Cholesky Decomposition. | |
virtual SingularValueDecomposition | SVD () |
Singular Value Decomposition. | |
virtual EigenvalueDecomposition | Eigen () |
Eigenvalue Decomposition. | |
virtual GeneralMatrix | Solve (GeneralMatrix B) |
Solve A*X = B. | |
virtual GeneralMatrix | SolveTranspose (GeneralMatrix B) |
Solve X*A = B, which is also A'*X' = B'. | |
virtual GeneralMatrix | Inverse () |
Matrix inverse or pseudoinverse. | |
virtual double | Determinant () |
GeneralMatrix determinant. | |
virtual int | Rank () |
GeneralMatrix rank. | |
virtual double | Condition () |
Matrix condition (2 norm). | |
virtual double | Trace () |
Matrix trace. | |
void | Dispose () |
Do not make this method virtual. A derived class should not be able to override this method. | |
System.Object | Clone () |
Clone the GeneralMatrix object. | |
Static Public Member Functions | |
static GeneralMatrix | Create (double[][] A) |
Construct a matrix from a copy of a 2-D array. | |
static GeneralMatrix | operator+ (GeneralMatrix m1, GeneralMatrix m2) |
Addition of matrices. | |
static GeneralMatrix | operator- (GeneralMatrix m1, GeneralMatrix m2) |
Subtraction of matrices. | |
static GeneralMatrix | operator * (GeneralMatrix m1, GeneralMatrix m2) |
Multiplication of matrices. | |
static GeneralMatrix | Random (int m, int n) |
Generate matrix with random elements. | |
static GeneralMatrix | Identity (int m, int n) |
Generate identity matrix. | |
Properties | |
virtual double[][] | Array [get] |
Access the internal two-dimensional array. | |
virtual double[][] | ArrayCopy [get] |
Copy the internal two-dimensional array. | |
virtual double[] | ColumnPackedCopy [get] |
Make a one-dimensional column packed copy of the internal array. | |
virtual double[] | RowPackedCopy [get] |
Make a one-dimensional row packed copy of the internal array. | |
virtual int | RowDimension [get] |
Get row dimension. | |
virtual int | ColumnDimension [get] |
Get column dimension. | |
Private Member Functions | |
void | CheckMatrixDimensions (GeneralMatrix B) |
Check if size(A) == size(B) *. | |
void | Dispose (bool disposing) |
Dispose(bool disposing) executes in two distinct scenarios. If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. If disposing equals false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. | |
~GeneralMatrix () | |
This destructor will run only if the Dispose method does not get called. It gives your base class the opportunity to finalize. Do not provide destructors in types derived from this class. | |
void ISerializable. | GetObjectData (SerializationInfo info, StreamingContext context) |
A method called when serializing this class. | |
Private Attributes | |
double[][] | A |
Array for internal storage of elements. internal array storage. | |
int | m |
Row and column dimensions. row dimension. column dimension. |
double[][] vals = {{1.,2.,3},{4.,5.,6.},{7.,8.,10.}}; GeneralMatrix A = new GeneralMatrix(vals); GeneralMatrix b = GeneralMatrix.Random(3,1); GeneralMatrix x = A.Solve(b); GeneralMatrix r = A.Multiply(x).Subtract(b); double rnorm = r.NormInf();
<author> The MathWorks, Inc. and the National Institute of Standards and Technology. </author> <version> 5 August 1998 </version>
BRISC::Matrix::GeneralMatrix::GeneralMatrix | ( | int | m, | |
int | n | |||
) | [inline] |
Construct an m-by-n matrix of zeros.
m | Number of rows. | |
n | Number of colums. |
BRISC::Matrix::GeneralMatrix::GeneralMatrix | ( | int | m, | |
int | n, | |||
double | s | |||
) | [inline] |
Construct an m-by-n constant matrix.
m | Number of rows. | |
n | Number of colums. | |
s | Fill the matrix with this scalar value. |
BRISC::Matrix::GeneralMatrix::GeneralMatrix | ( | double | A[][] | ) | [inline] |
Construct a matrix from a 2-D array.
A | Two-dimensional array of doubles. |
System.ArgumentException | All rows must have the same length |
BRISC::Matrix::GeneralMatrix::GeneralMatrix | ( | double | A[][], | |
int | m, | |||
int | n | |||
) | [inline] |
Construct a matrix quickly without checking arguments.
A | Two-dimensional array of doubles. | |
m | Number of rows. | |
n | Number of colums. |
BRISC::Matrix::GeneralMatrix::GeneralMatrix | ( | double[] | vals, | |
int | m | |||
) | [inline] |
Construct a matrix from a one-dimensional packed array.
vals | One-dimensional array of doubles, packed by columns (ala Fortran). | |
m | Number of rows. |
System.ArgumentException | Array length must be a multiple of m. |
virtual GeneralMatrix BRISC::Matrix::GeneralMatrix::Add | ( | GeneralMatrix | B | ) | [inline, virtual] |
C = A + B.
B | another matrix |
virtual GeneralMatrix BRISC::Matrix::GeneralMatrix::AddEquals | ( | GeneralMatrix | B | ) | [inline, virtual] |
A = A + B.
B | another matrix |
virtual GeneralMatrix BRISC::Matrix::GeneralMatrix::ArrayLeftDivide | ( | GeneralMatrix | B | ) | [inline, virtual] |
Element-by-element left division, C = A..
B | another matrix |
virtual GeneralMatrix BRISC::Matrix::GeneralMatrix::ArrayLeftDivideEquals | ( | GeneralMatrix | B | ) | [inline, virtual] |
Element-by-element left division in place, A = A..
B | another matrix |
virtual GeneralMatrix BRISC::Matrix::GeneralMatrix::ArrayMultiply | ( | GeneralMatrix | B | ) | [inline, virtual] |
Element-by-element multiplication, C = A.*B.
B | another matrix |
virtual GeneralMatrix BRISC::Matrix::GeneralMatrix::ArrayMultiplyEquals | ( | GeneralMatrix | B | ) | [inline, virtual] |
Element-by-element multiplication in place, A = A.*B.
B | another matrix |
virtual GeneralMatrix BRISC::Matrix::GeneralMatrix::ArrayRightDivide | ( | GeneralMatrix | B | ) | [inline, virtual] |
Element-by-element right division, C = A./B.
B | another matrix |
virtual GeneralMatrix BRISC::Matrix::GeneralMatrix::ArrayRightDivideEquals | ( | GeneralMatrix | B | ) | [inline, virtual] |
Element-by-element right division in place, A = A./B.
B | another matrix |
virtual CholeskyDecomposition BRISC::Matrix::GeneralMatrix::chol | ( | ) | [inline, virtual] |
virtual double BRISC::Matrix::GeneralMatrix::Condition | ( | ) | [inline, virtual] |
static GeneralMatrix BRISC::Matrix::GeneralMatrix::Create | ( | double | A[][] | ) | [inline, static] |
Construct a matrix from a copy of a 2-D array.
A | Two-dimensional array of doubles. |
System.ArgumentException | All rows must have the same length |
virtual double BRISC::Matrix::GeneralMatrix::Determinant | ( | ) | [inline, virtual] |
void BRISC::Matrix::GeneralMatrix::Dispose | ( | bool | disposing | ) | [inline, private] |
Dispose(bool disposing) executes in two distinct scenarios. If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. If disposing equals false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed.
disposing |
virtual EigenvalueDecomposition BRISC::Matrix::GeneralMatrix::Eigen | ( | ) | [inline, virtual] |
virtual double BRISC::Matrix::GeneralMatrix::GetElement | ( | int | i, | |
int | j | |||
) | [inline, virtual] |
Get a single element.
i | Row index. | |
j | Column index. |
System.IndexOutOfRangeException |
virtual GeneralMatrix BRISC::Matrix::GeneralMatrix::GetMatrix | ( | int[] | r, | |
int | j0, | |||
int | j1 | |||
) | [inline, virtual] |
Get a submatrix.
r | Array of row indices. | |
j0 | Initial column index | |
j1 | Final column index |
System.IndexOutOfRangeException | Submatrix indices |
virtual GeneralMatrix BRISC::Matrix::GeneralMatrix::GetMatrix | ( | int | i0, | |
int | i1, | |||
int[] | c | |||
) | [inline, virtual] |
Get a submatrix.
i0 | Initial row index | |
i1 | Final row index | |
c | Array of column indices. |
System.IndexOutOfRangeException | Submatrix indices |
virtual GeneralMatrix BRISC::Matrix::GeneralMatrix::GetMatrix | ( | int[] | r, | |
int[] | c | |||
) | [inline, virtual] |
Get a submatrix.
r | Array of row indices. | |
c | Array of column indices. |
System.IndexOutOfRangeException | Submatrix indices |
virtual GeneralMatrix BRISC::Matrix::GeneralMatrix::GetMatrix | ( | int | i0, | |
int | i1, | |||
int | j0, | |||
int | j1 | |||
) | [inline, virtual] |
Get a submatrix.
i0 | Initial row index | |
i1 | Final row index | |
j0 | Initial column index | |
j1 | Final column index |
System.IndexOutOfRangeException | Submatrix indices |
void ISerializable. BRISC::Matrix::GeneralMatrix::GetObjectData | ( | SerializationInfo | info, | |
StreamingContext | context | |||
) | [inline, private] |
A method called when serializing this class.
info | ||
context |
static GeneralMatrix BRISC::Matrix::GeneralMatrix::Identity | ( | int | m, | |
int | n | |||
) | [inline, static] |
Generate identity matrix.
m | Number of rows. | |
n | Number of colums. |
virtual GeneralMatrix BRISC::Matrix::GeneralMatrix::Inverse | ( | ) | [inline, virtual] |
virtual LUDecomposition BRISC::Matrix::GeneralMatrix::LUD | ( | ) | [inline, virtual] |
virtual GeneralMatrix BRISC::Matrix::GeneralMatrix::Multiply | ( | GeneralMatrix | B | ) | [inline, virtual] |
virtual GeneralMatrix BRISC::Matrix::GeneralMatrix::Multiply | ( | double | s | ) | [inline, virtual] |
Multiply a matrix by a scalar, C = s*A.
s | scalar |
virtual GeneralMatrix BRISC::Matrix::GeneralMatrix::MultiplyEquals | ( | double | s | ) | [inline, virtual] |
Multiply a matrix by a scalar in place, A = s*A.
s | scalar |
virtual double BRISC::Matrix::GeneralMatrix::Norm1 | ( | ) | [inline, virtual] |
One norm.
virtual double BRISC::Matrix::GeneralMatrix::Norm2 | ( | ) | [inline, virtual] |
Two norm.
virtual double BRISC::Matrix::GeneralMatrix::NormF | ( | ) | [inline, virtual] |
Frobenius norm.
virtual double BRISC::Matrix::GeneralMatrix::NormInf | ( | ) | [inline, virtual] |
Infinity norm.
static GeneralMatrix BRISC::Matrix::GeneralMatrix::operator * | ( | GeneralMatrix | m1, | |
GeneralMatrix | m2 | |||
) | [inline, static] |
Multiplication of matrices.
m1 | ||
m2 |
static GeneralMatrix BRISC::Matrix::GeneralMatrix::operator+ | ( | GeneralMatrix | m1, | |
GeneralMatrix | m2 | |||
) | [inline, static] |
Addition of matrices.
m1 | ||
m2 |
static GeneralMatrix BRISC::Matrix::GeneralMatrix::operator- | ( | GeneralMatrix | m1, | |
GeneralMatrix | m2 | |||
) | [inline, static] |
Subtraction of matrices.
m1 | ||
m2 |
virtual QRDecomposition BRISC::Matrix::GeneralMatrix::QRD | ( | ) | [inline, virtual] |
static GeneralMatrix BRISC::Matrix::GeneralMatrix::Random | ( | int | m, | |
int | n | |||
) | [inline, static] |
Generate matrix with random elements.
m | Number of rows. | |
n | Number of colums. |
virtual int BRISC::Matrix::GeneralMatrix::Rank | ( | ) | [inline, virtual] |
virtual void BRISC::Matrix::GeneralMatrix::SetElement | ( | int | i, | |
int | j, | |||
double | s | |||
) | [inline, virtual] |
Set a single element.
i | Row index. | |
j | Column index. | |
s | A(i,j). |
System.IndexOutOfRangeException |
virtual void BRISC::Matrix::GeneralMatrix::SetMatrix | ( | int | i0, | |
int | i1, | |||
int[] | c, | |||
GeneralMatrix | X | |||
) | [inline, virtual] |
Set a submatrix.
i0 | Initial row index | |
i1 | Final row index | |
c | Array of column indices. | |
X | A(i0:i1,c(:)) |
System.IndexOutOfRangeException | Submatrix indices |
virtual void BRISC::Matrix::GeneralMatrix::SetMatrix | ( | int[] | r, | |
int | j0, | |||
int | j1, | |||
GeneralMatrix | X | |||
) | [inline, virtual] |
Set a submatrix.
r | Array of row indices. | |
j0 | Initial column index | |
j1 | Final column index | |
X | A(r(:),j0:j1) |
System.IndexOutOfRangeException | Submatrix indices |
virtual void BRISC::Matrix::GeneralMatrix::SetMatrix | ( | int[] | r, | |
int[] | c, | |||
GeneralMatrix | X | |||
) | [inline, virtual] |
Set a submatrix.
r | Array of row indices. | |
c | Array of column indices. | |
X | A(r(:),c(:)) |
System.IndexOutOfRangeException | Submatrix indices |
virtual void BRISC::Matrix::GeneralMatrix::SetMatrix | ( | int | i0, | |
int | i1, | |||
int | j0, | |||
int | j1, | |||
GeneralMatrix | X | |||
) | [inline, virtual] |
Set a submatrix.
i0 | Initial row index | |
i1 | Final row index | |
j0 | Initial column index | |
j1 | Final column index | |
X | A(i0:i1,j0:j1) |
System.IndexOutOfRangeException | Submatrix indices |
virtual GeneralMatrix BRISC::Matrix::GeneralMatrix::Solve | ( | GeneralMatrix | B | ) | [inline, virtual] |
Solve A*X = B.
B | right hand side |
virtual GeneralMatrix BRISC::Matrix::GeneralMatrix::SolveTranspose | ( | GeneralMatrix | B | ) | [inline, virtual] |
Solve X*A = B, which is also A'*X' = B'.
B | right hand side |
virtual GeneralMatrix BRISC::Matrix::GeneralMatrix::Subtract | ( | GeneralMatrix | B | ) | [inline, virtual] |
C = A - B.
B | another matrix |
virtual GeneralMatrix BRISC::Matrix::GeneralMatrix::SubtractEquals | ( | GeneralMatrix | B | ) | [inline, virtual] |
A = A - B.
B | another matrix |
virtual SingularValueDecomposition BRISC::Matrix::GeneralMatrix::SVD | ( | ) | [inline, virtual] |
Singular Value Decomposition.
virtual double BRISC::Matrix::GeneralMatrix::Trace | ( | ) | [inline, virtual] |
virtual GeneralMatrix BRISC::Matrix::GeneralMatrix::Transpose | ( | ) | [inline, virtual] |
virtual GeneralMatrix BRISC::Matrix::GeneralMatrix::UnaryMinus | ( | ) | [inline, virtual] |
Unary minus.
virtual double [][] BRISC::Matrix::GeneralMatrix::Array [get] |
Access the internal two-dimensional array.
virtual double [][] BRISC::Matrix::GeneralMatrix::ArrayCopy [get] |
Copy the internal two-dimensional array.
virtual int BRISC::Matrix::GeneralMatrix::ColumnDimension [get] |
Get column dimension.
virtual double [] BRISC::Matrix::GeneralMatrix::ColumnPackedCopy [get] |
Make a one-dimensional column packed copy of the internal array.
virtual int BRISC::Matrix::GeneralMatrix::RowDimension [get] |
Get row dimension.
virtual double [] BRISC::Matrix::GeneralMatrix::RowPackedCopy [get] |
Make a one-dimensional row packed copy of the internal array.