Isis Developer Reference
Isis::Matrix Class Reference

Matrix class. More...

#include <Matrix.h>

Collaboration diagram for Isis::Matrix:
Collaboration graph

Public Member Functions

 Matrix (const int n, const int m, const double value=0.0)
 Constructs an n x m Matrix containing the specified default value.
 
 Matrix (TNT::Array2D< double > matrix)
 Constructs a Matrix from the specified TNT Array2D.
 
 ~Matrix ()
 Destroys the Matrix object.
 
int Rows ()
 
int Columns ()
 
double Determinant ()
 Compute the determinant of the matrix.
 
double Trace ()
 Compute the determinant of the matrix.
 
std::vector< double > Eigenvalues ()
 Compute the eigenvalues of the matrix.
 
Matrix Add (Matrix &matrix)
 Add the two matrices.
 
Matrix Subtract (Matrix &matrix)
 Subtract the input matrix from this matrix.
 
Matrix Multiply (Matrix &matrix)
 Multiply the two matrices.
 
Matrix Multiply (double scalar)
 Multiply the matrix by a scalar value.
 
Matrix MultiplyElementWise (Matrix &matrix)
 Multiply the two matrices element-wise (ie compute C such that C[i][j] = A[i][j]*B[i][j])
 
Matrix Transpose ()
 Compute the transpose of the matrix.
 
Matrix Inverse ()
 Compute the inverse of the matrix.
 
Matrix Eigenvectors ()
 Compute the eigenvectors of the matrix and return them as columns of a matrix in ascending order.
 
double * operator[] (int index)
 
Matrix operator+ (Matrix &matrix)
 
Matrix operator- (Matrix &matrix)
 
Matrix operator* (Matrix &matrix)
 
Matrix operator* (double scalar)
 

Static Public Member Functions

static Matrix Identity (const int n)
 Create an n x n identity matrix.
 

Detailed Description

Matrix class.

A Matrix

This class stores a matrix and compute matrix calculations such as addition, subtraction,multiplication, transposes, inverses, and eigenvalues.

Author
2006-05-19 Jacob Danton

Constructor & Destructor Documentation

◆ Matrix() [1/2]

Isis::Matrix::Matrix ( const int n,
const int m,
const double value = 0.0 )

Constructs an n x m Matrix containing the specified default value.

References _FILEINFO_, and Isis::IException::Programmer.

Referenced by Add(), Eigenvectors(), Inverse(), Multiply(), MultiplyElementWise(), Subtract(), and Transpose().

◆ Matrix() [2/2]

Isis::Matrix::Matrix ( TNT::Array2D< double > matrix)

Constructs a Matrix from the specified TNT Array2D.

◆ ~Matrix()

Isis::Matrix::~Matrix ( )

Destroys the Matrix object.

Member Function Documentation

◆ Add()

Matrix Isis::Matrix::Add ( Matrix & matrix)

Add the two matrices.

References _FILEINFO_, Columns(), Matrix(), Isis::IException::Programmer, and Rows().

Referenced by operator+().

◆ Columns()

◆ Determinant()

double Isis::Matrix::Determinant ( )

Compute the determinant of the matrix.

References _FILEINFO_, Columns(), Isis::IException::Programmer, and Rows().

◆ Eigenvalues()

std::vector< double > Isis::Matrix::Eigenvalues ( )

Compute the eigenvalues of the matrix.

References _FILEINFO_, Columns(), Isis::E, Isis::IException::Programmer, and Rows().

◆ Eigenvectors()

Matrix Isis::Matrix::Eigenvectors ( )

Compute the eigenvectors of the matrix and return them as columns of a matrix in ascending order.

References _FILEINFO_, Columns(), Isis::E, Matrix(), Isis::IException::Programmer, and Rows().

◆ Identity()

Matrix Isis::Matrix::Identity ( const int n)
static

Create an n x n identity matrix.

References _FILEINFO_, Isis::IException::Programmer, and Rows().

◆ Inverse()

Matrix Isis::Matrix::Inverse ( )

Compute the inverse of the matrix.

References _FILEINFO_, Columns(), Matrix(), Isis::IException::Programmer, and Rows().

◆ Multiply() [1/2]

Matrix Isis::Matrix::Multiply ( double scalar)

Multiply the matrix by a scalar value.

References Columns(), and Rows().

◆ Multiply() [2/2]

Matrix Isis::Matrix::Multiply ( Matrix & matrix)

Multiply the two matrices.

References _FILEINFO_, Columns(), Matrix(), Isis::IException::Programmer, and Rows().

Referenced by operator*(), and operator*().

◆ MultiplyElementWise()

Matrix Isis::Matrix::MultiplyElementWise ( Matrix & matrix)

Multiply the two matrices element-wise (ie compute C such that C[i][j] = A[i][j]*B[i][j])

References _FILEINFO_, Columns(), Matrix(), Isis::IException::Programmer, and Rows().

◆ operator*() [1/2]

Matrix Isis::Matrix::operator* ( double scalar)
inline

References Multiply().

◆ operator*() [2/2]

Matrix Isis::Matrix::operator* ( Matrix & matrix)
inline

References Multiply().

◆ operator+()

Matrix Isis::Matrix::operator+ ( Matrix & matrix)
inline

References Add().

◆ operator-()

Matrix Isis::Matrix::operator- ( Matrix & matrix)
inline

References Subtract().

◆ operator[]()

double * Isis::Matrix::operator[] ( int index)
inline

◆ Rows()

◆ Subtract()

Matrix Isis::Matrix::Subtract ( Matrix & matrix)

Subtract the input matrix from this matrix.

References _FILEINFO_, Columns(), Matrix(), Isis::IException::Programmer, and Rows().

Referenced by operator-().

◆ Trace()

double Isis::Matrix::Trace ( )

Compute the determinant of the matrix.

References _FILEINFO_, Columns(), Isis::IException::Programmer, and Rows().

◆ Transpose()

Matrix Isis::Matrix::Transpose ( )

Compute the transpose of the matrix.

References Matrix().


The documentation for this class was generated from the following files: