IGLib 1.4
The IGLib base library for development of numerical, technical and business applications.
|
Matrix in a 3 dimensional space. More...
Public Member Functions | |
Matrix3d (Matrix3d m) | |
Copy constructor. Initializes components of a 3D matrix with components of another 3D matrix. | |
Matrix3d (IMatrix m) | |
Constructor. Initializes components of a 3D matrix with components of another matrix. The specified matrix should be 3*3. | |
Matrix3d (Vector3d rowx, Vector3d rowy, Vector3d rowz) | |
Initializes 3D matrix structure with the specified components. | |
Matrix3d (mat3 m) | |
Initializes components of a 3D matrix with components of the specified matrix. | |
Matrix3d (double xx, double xy, double xz, double yx, double yy, double yz, double zx, double zy, double zz) | |
Initializes 3D matrix structure with the specified components. | |
Matrix3d (double component) | |
Initializes 3D with the specified component. | |
Matrix3d (vec3 xrow, vec3 yrow, vec3 zrow) | |
Initializes 3D matrix structure with the specified components. | |
Matrix3d (double[][] A) | |
Initializes a 3D matrix with elements of a jagged array. | |
Matrix3d (double[,] A) | |
Initializes a 3D matrix with elements of a rectangular array. | |
virtual Matrix3d | GetCopyThis () |
Returns a copy of the current 3D matrix. | |
override MatrixBase | GetCopyBase () |
Returns a deep copy of the current 3D matrix. | |
Matrix3d | GetNewThis (int rowCount, int ColumnCount) |
Returns a copy of the current 3D matrix. | |
override MatrixBase | GetNewBase (int rowCount, int columnCount) |
Creates and returns a new 3D matrix with the specified dimensions, and of the same type as the current matrix. | |
Matrix3d | GetNewThis () |
Creates and returns a new matrix with the same dimensions and of the same type as the current matrix. | |
override MatrixBase | GetNewBase () |
Creates and returns a new matrix with the same dimensions and of the same type as the current matrix. | |
Vector3d | GetNewVectorThis (int length) |
Creates and returns a new 3D vector with the specified dimension (which must be null), and of the type that is consistent with the type of the current matrix. | |
override VectorBase | GetNewVectorBase (int length) |
Creates and returns a new vector with the specified dimension, and of the type that is consistent with the type of the current matrix. | |
override int | GetHashCode () |
Returns the hash code (hash function) of the current matrix. | |
override bool | Equals (Object obj) |
Returns a value indicating whether the specified object is equal to the current matrix. True is returned if the object is a non-null matrix (i.e. it implements the IMatrix interface), and has the same dimension and equal elements as the current matrix. | |
Matrix3d | NormalizedEuclidean () |
Returns this matrix normalized with Euclidean norm. | |
Matrix3d | NormalizedForbenius () |
Returns this matrix normalized with Euclidean norm. | |
Matrix3d | Normalized1 () |
Returns this matrix normalized with 1 norm. | |
Matrix3d | NormalizedInfinity () |
Returns this matrix normalized with infinity norm. | |
void | Read () |
Reads 3D matrix components from a console. | |
void | Read (string name) |
Reads 3D matrix components from a console. | |
Static Public Member Functions | |
static Matrix3d | Create (Matrix3d mat) |
Creates and returns a 3D matrix that is a copy of another 3D matrix. | |
static Matrix3d | Create (IMatrix mat) |
Creates and returns a 3D matrix that is a copy of another (general) matrix. That matrix should be a 3*3 matrix, otherwise exception is thrown. | |
static Matrix3d | Create (double[][] A) |
Constructs a matrix from a copy of a 2-D array by deep-copy. | |
static Matrix3d | Create (double[,] A) |
Constructs a 3D matrix from a copy of a 2-D array by deep-copy. | |
static Matrix3d | CreateFromColumns (IList< IVector > columnVectors) |
Construct a complex matrix from a set of real column vectors. | |
static Matrix3d | CreateFromRows (IList< Vector > rowVectors) |
Construct a complex matrix from a set of real row vectors. | |
static Matrix3d | Identity () |
Creates a d1*d2 identity matrix. | |
static Matrix3d | Zeros () |
Creates a 3D matrix filled with 0. | |
static Matrix3d | Ones () |
Creates a 3D matrix filled with 1. | |
static Matrix3d | Diagonal (IVector diagonalVector) |
Creates a new diagonal d1*d2 matrix based on the diagonal vector. | |
static Matrix3d | Random () |
Creates and returns a 3D matrix with uniformly distributed random elements in the [0, 1) interval. | |
static Matrix3d | Random (IRandomGenerator rnd) |
Creates and returns a 3D matrix with uniformly distributed random elements in the [0, 1) interval. | |
static Matrix3d | Copy (Matrix3d m) |
Returns a copy of the specified 3D matrix. | |
static void | Negate (Matrix3d m, ref Matrix3d res) |
Negates the specified 3D matrix and stores its copy in the resulting matrix. | |
static int | EigenSystem2d (Matrix3d a, ref Matrix3d eigenvec, ref Vector3d eigenval) |
Calculates eigenvectors and eigenvalues of a 2x2 matrix a and stores eigenvectors to lines of eigenvec and eigenvalues to eigenval. eigenvec can be the same matrix as a. The number of different real eigenvalues is returned. Ref.: linalg.nb Not tested yet! | |
static Matrix3d | operator+ (Matrix3d m) |
Unary plus for 3D matrices, returns the operand. | |
static Matrix3d | operator- (Matrix3d a) |
Unary negation for 3D matrices, returns the negative operand. | |
static Matrix3d | operator+ (Matrix3d a, Matrix3d b) |
Matrix addition in 3D. | |
static Matrix3d | operator- (Matrix3d a, Matrix3d b) |
Matrix subtraction in 3D. | |
static Matrix3d | operator* (Matrix3d a, Matrix3d b) |
Matrix multiplication in 3D. | |
static Vector3d | operator* (Matrix3d a, Vector3d b) |
Matrix with vector multiplication in 3D. | |
static Matrix3d | operator* (Matrix3d a, double b) |
Product of a 3D matrix by a scalar. | |
static Matrix3d | operator* (double a, Matrix3d b) |
Product of a 3D matrix by a scalar. | |
static Matrix3d | operator/ (Matrix3d a, double b) |
Division of a 3D matrix by a scalar. | |
Properties | |
override int | RowCount [get] |
Gets the first dimension (number of rows) of the 3D matrix, i.e. 3. | |
override int | ColumnCount [get] |
Gets the second dimension (number of columns) of the 3D matrix, i.e. 3. | |
mat3 | Mat [get, set] |
Gets the struct representation of this 3D matrix. | |
double | XX [get, set] |
XX component. | |
double | XY [get, set] |
XY component. | |
double | XZ [get, set] |
XZ component. | |
double | YX [get, set] |
YX component. | |
double | YY [get, set] |
YY component. | |
double | YZ [get, set] |
YZ component. | |
double | ZX [get, set] |
ZX component. | |
double | ZY [get, set] |
ZY component. | |
double | ZZ [get, set] |
ZZ component. | |
override double | this [int i, int j] [get, set] |
Index operator. | |
Vector3d | RowX [get, set] |
Gets or sets the x-row of the 3D matrix. | |
Vector3d | RowY [get, set] |
Gets or sets the y-row of the 3D matrix. | |
Vector3d | RowZ [get, set] |
Gets or sets the z-row of the 3D matrix. | |
Vector3d | ColumnX [get, set] |
Gets or sets the x-column of the 3D matrix. | |
Vector3d | ColumnY [get, set] |
Gets or sets the y-column of the 3D matrix. | |
Vector3d | ColumnZ [get, set] |
Gets or sets the z-column of the 3D matrix. | |
override double | NormForbenius [get] |
Get Forbenius (or euclidean) norm of the matrix - square root of sum of squares of components. | |
override double | NormEuclidean [get] |
Get Forbenius (or euclidean) norm of the matrix - square root of sum of squares of components. | |
override double | Norm [get] |
Get Forbenius (or euclidean) norm of the matrix - square root of sum of squares of components. | |
double | Norm1 [get] |
Get the 1 norm of the matrix - maximum over columns of sum of absolute values of components. | |
double | NormInfinity [get] |
Get the infinity norm of the matrix - maximum over rows of sum of absolute values of components. | |
double | Determinant [get] |
Gets matrix determinant. | |
double | Det [get] |
Gets matrix determinant. | |
override double | Trace [get] |
Gets matrix trace (sum of diagonal elements). | |
new Matrix3d | T [get] |
Gets transpose of the current matrix. | |
Matrix3d | Inverse [get] |
Gets inverse of the current matrix. | |
Matrix3d | Inv [get] |
Gets inverse of the current matrix. | |
Private Member Functions | |
Vector3d | Solve (Vector3d b) |
Returns solution of system of equations with the current system matrix and the specified right-hand sides. | |
Matrix3d | Add (Matrix3d a) |
Returns sum of the current matrix and the specified matrix. | |
Matrix3d | Subtract (Matrix3d a) |
Returns difference between the current matrix and the specified matrix. | |
Matrix3d | MultiplyRight (Matrix3d b) |
Right-multiplies the current 3D matrix with the specified matrix and returns the product. | |
Matrix3d | MultiplyLeft (Matrix3d b) |
Left-multiplies the current 3D matrix with the specified matrix and returns the product. | |
Vector3d | Multiply (Vector3d b) |
Right-multiplies the current 3D matrix with the specified 3D vector and returns the product. | |
Matrix3d | Multiply (double b) |
Multiplies the current 3D matrix with the specified scalar and returns the product. | |
Private Attributes | |
mat3 | _m |
Matrix in a 3 dimensional space.
$A Igor Jul08; Oct10;
IG::Num::Matrix3d::Matrix3d | ( | Matrix3d | m | ) | [inline] |
Copy constructor. Initializes components of a 3D matrix with components of another 3D matrix.
m | Matrix whose components are copied to the initialized matrix. |
IG::Num::Matrix3d::Matrix3d | ( | IMatrix | m | ) | [inline] |
Constructor. Initializes components of a 3D matrix with components of another matrix. The specified matrix should be 3*3.
m | Matrix whose components are copied to the initialized matrix (should be 3*3). |
Initializes 3D matrix structure with the specified components.
IG::Num::Matrix3d::Matrix3d | ( | mat3 | m | ) | [inline] |
Initializes components of a 3D matrix with components of the specified matrix.
v | Matrix whose components are copied to the initialized matrix. |
IG::Num::Matrix3d::Matrix3d | ( | double | xx, |
double | xy, | ||
double | xz, | ||
double | yx, | ||
double | yy, | ||
double | yz, | ||
double | zx, | ||
double | zy, | ||
double | zz | ||
) | [inline] |
Initializes 3D matrix structure with the specified components.
IG::Num::Matrix3d::Matrix3d | ( | double | component | ) | [inline] |
Initializes 3D with the specified component.
component | Value that is assigned to all matrix components. |
Initializes 3D matrix structure with the specified components.
IG::Num::Matrix3d::Matrix3d | ( | double | A[][] | ) | [inline] |
Initializes a 3D matrix with elements of a jagged array.
A | Array from which a 3D matrix is constructed. |
IG::Num::Matrix3d::Matrix3d | ( | double | A[,] | ) | [inline] |
Initializes a 3D matrix with elements of a rectangular array.
A | Array from which a 3D matrix is constructed. |
Creates and returns a 3D matrix that is a copy of another 3D matrix.
mat |
Creates and returns a 3D matrix that is a copy of another (general) matrix. That matrix should be a 3*3 matrix, otherwise exception is thrown.
mat | Matrix whose components are copied to the created matrix. Should be a 3*3 matrix, otherwisee exception is thrown. |
static Matrix3d IG::Num::Matrix3d::Create | ( | double | A[][] | ) | [inline, static] |
Constructs a matrix from a copy of a 2-D array by deep-copy.
A | Two-dimensional array of doubles. |
static Matrix3d IG::Num::Matrix3d::Create | ( | double | A[,] | ) | [inline, static] |
Constructs a 3D matrix from a copy of a 2-D array by deep-copy.
A | Two-dimensional array of doubles. |
static Matrix3d IG::Num::Matrix3d::CreateFromColumns | ( | IList< IVector > | columnVectors | ) | [inline, static] |
Construct a complex matrix from a set of real column vectors.
Construct a complex matrix from a set of real row vectors.
static Matrix3d IG::Num::Matrix3d::Identity | ( | ) | [inline, static] |
Creates a d1*d2 identity matrix.
d1 | Number of rows. |
d2 | Number of columns. |
static Matrix3d IG::Num::Matrix3d::Zeros | ( | ) | [inline, static] |
Creates a 3D matrix filled with 0.
d1 | Number of rows. |
d2 | Number of columns. |
static Matrix3d IG::Num::Matrix3d::Ones | ( | ) | [inline, static] |
Creates a 3D matrix filled with 1.
d1 | Number of rows. |
d2 | Number of columns. |
Creates a new diagonal d1*d2 matrix based on the diagonal vector.
diagonalVector | The values of the matrix diagonal. |
d1 | Number of rows. |
d2 | Number of columns. |
static Matrix3d IG::Num::Matrix3d::Random | ( | ) | [inline, static] |
Creates and returns a 3D matrix with uniformly distributed random elements in the [0, 1) interval.
[0, 1)
interval.static Matrix3d IG::Num::Matrix3d::Random | ( | IRandomGenerator | rnd | ) | [inline, static] |
Creates and returns a 3D matrix with uniformly distributed random elements in the [0, 1) interval.
rnd | Random generator that is used for generation of elements. |
[0, 1)
interval.virtual Matrix3d IG::Num::Matrix3d::GetCopyThis | ( | ) | [inline, virtual] |
Returns a copy of the current 3D matrix.
override MatrixBase IG::Num::Matrix3d::GetCopyBase | ( | ) | [inline, virtual] |
Returns a deep copy of the current 3D matrix.
Implements IG::Num::MatrixBase.
Matrix3d IG::Num::Matrix3d::GetNewThis | ( | int | rowCount, |
int | ColumnCount | ||
) | [inline] |
Returns a copy of the current 3D matrix.
override MatrixBase IG::Num::Matrix3d::GetNewBase | ( | int | rowCount, |
int | columnCount | ||
) | [inline, virtual] |
Creates and returns a new 3D matrix with the specified dimensions, and of the same type as the current matrix.
rowCount | Number fo rows of the newly created matrix. Must be 3. |
columnCount | Number of columns of the newly created matrix. Must be 3. |
Implements IG::Num::MatrixBase.
Matrix3d IG::Num::Matrix3d::GetNewThis | ( | ) | [inline] |
Creates and returns a new matrix with the same dimensions and of the same type as the current matrix.
override MatrixBase IG::Num::Matrix3d::GetNewBase | ( | ) | [inline, virtual] |
Creates and returns a new matrix with the same dimensions and of the same type as the current matrix.
Implements IG::Num::MatrixBase.
Vector3d IG::Num::Matrix3d::GetNewVectorThis | ( | int | length | ) | [inline] |
Creates and returns a new 3D vector with the specified dimension (which must be null), and of the type that is consistent with the type of the current matrix.
length | Dimension of the newly created vector. |
override VectorBase IG::Num::Matrix3d::GetNewVectorBase | ( | int | length | ) | [inline, virtual] |
Creates and returns a new vector with the specified dimension, and of the type that is consistent with the type of the current matrix.
length | Dimension of the newly created vector. |
Implements IG::Num::MatrixBase.
override int IG::Num::Matrix3d::GetHashCode | ( | ) | [inline] |
Returns the hash code (hash function) of the current matrix.
This method calls the MatrixBase.GetHashCode to calculate the hash code, which is standard for all implementations of the IMatrix interface.
Two matrices that have the same dimensions and equal elements will produce the same hash codes.
Probability that two different matrices will produce the same hash code is small but it exists.
Overrides the object.GetHashCode method.
Reimplemented from IG::Num::MatrixBase.
override bool IG::Num::Matrix3d::Equals | ( | Object | obj | ) | [inline] |
Returns a value indicating whether the specified object is equal to the current matrix. True is returned if the object is a non-null matrix (i.e. it implements the IMatrix interface), and has the same dimension and equal elements as the current matrix.
This method calls the MatrixBase.Equals to obtain the returned value, which is standard for all implementations of the IMatrix interface.
Overrides the object.Equals method.
Reimplemented from IG::Num::MatrixBase.
Matrix3d IG::Num::Matrix3d::NormalizedEuclidean | ( | ) | [inline] |
Returns this matrix normalized with Euclidean norm.
Matrix3d IG::Num::Matrix3d::NormalizedForbenius | ( | ) | [inline] |
Returns this matrix normalized with Euclidean norm.
Matrix3d IG::Num::Matrix3d::Normalized1 | ( | ) | [inline] |
Returns this matrix normalized with 1 norm.
Matrix3d IG::Num::Matrix3d::NormalizedInfinity | ( | ) | [inline] |
Returns this matrix normalized with infinity norm.
Returns solution of system of equations with the current system matrix and the specified right-hand sides.
b | Vector of right-hand sides of equations. |
Returns sum of the current matrix and the specified matrix.
Returns difference between the current matrix and the specified matrix.
Right-multiplies the current 3D matrix with the specified matrix and returns the product.
b | Right-hand side factor of multiplication. |
Left-multiplies the current 3D matrix with the specified matrix and returns the product.
b | Left-hand side factor of multiplication. |
Right-multiplies the current 3D matrix with the specified 3D vector and returns the product.
b | Right-hand side factor of multiplication. |
Matrix3d IG::Num::Matrix3d::Multiply | ( | double | b | ) | [inline, private] |
Multiplies the current 3D matrix with the specified scalar and returns the product.
b | Factor of multiplication. |
Returns a copy of the specified 3D matrix.
m | Matrix whose copy is returned. |
static int IG::Num::Matrix3d::EigenSystem2d | ( | Matrix3d | a, |
ref Matrix3d | eigenvec, | ||
ref Vector3d | eigenval | ||
) | [inline, static] |
Calculates eigenvectors and eigenvalues of a 2x2 matrix a and stores eigenvectors to lines of eigenvec and eigenvalues to eigenval. eigenvec can be the same matrix as a. The number of different real eigenvalues is returned. Ref.: linalg.nb Not tested yet!
a | 2D Matrix whose eigenvalues and eigenvectors are calculated. |
eigenvec | Matrix where eigenvectors are stored as rows. |
eigenval | Vector where eigenvalues are stored. |
$A Igor Aug08, Oct10;
Unary plus for 3D matrices, returns the operand.
Unary negation for 3D matrices, returns the negative operand.
Matrix addition in 3D.
Matrix subtraction in 3D.
Matrix multiplication in 3D.
Matrix with vector multiplication in 3D.
Product of a 3D matrix by a scalar.
Product of a 3D matrix by a scalar.
Division of a 3D matrix by a scalar.
void IG::Num::Matrix3d::Read | ( | ) | [inline] |
Reads 3D matrix components from a console.
void IG::Num::Matrix3d::Read | ( | string | name | ) | [inline] |
Reads 3D matrix components from a console.
name | Name of the matrix to be read; it is written as orientation to the user and can be null. |
mat3 IG::Num::Matrix3d::_m [private] |
override int IG::Num::Matrix3d::RowCount [get] |
Gets the first dimension (number of rows) of the 3D matrix, i.e. 3.
Reimplemented from IG::Num::MatrixBase.
override int IG::Num::Matrix3d::ColumnCount [get] |
Gets the second dimension (number of columns) of the 3D matrix, i.e. 3.
Reimplemented from IG::Num::MatrixBase.
mat3 IG::Num::Matrix3d::Mat [get, set, protected] |
Gets the struct representation of this 3D matrix.
double IG::Num::Matrix3d::XX [get, set] |
XX component.
double IG::Num::Matrix3d::XY [get, set] |
XY component.
double IG::Num::Matrix3d::XZ [get, set] |
XZ component.
double IG::Num::Matrix3d::YX [get, set] |
YX component.
double IG::Num::Matrix3d::YY [get, set] |
YY component.
double IG::Num::Matrix3d::YZ [get, set] |
YZ component.
double IG::Num::Matrix3d::ZX [get, set] |
ZX component.
double IG::Num::Matrix3d::ZY [get, set] |
ZY component.
double IG::Num::Matrix3d::ZZ [get, set] |
ZZ component.
override double IG::Num::Matrix3d::this[int i, int j] [get, set] |
Index operator.
i | Component index. |
Reimplemented from IG::Num::MatrixBase.
Vector3d IG::Num::Matrix3d::RowX [get, set] |
Gets or sets the x-row of the 3D matrix.
Vector3d IG::Num::Matrix3d::RowY [get, set] |
Gets or sets the y-row of the 3D matrix.
Vector3d IG::Num::Matrix3d::RowZ [get, set] |
Gets or sets the z-row of the 3D matrix.
Vector3d IG::Num::Matrix3d::ColumnX [get, set] |
Gets or sets the x-column of the 3D matrix.
Vector3d IG::Num::Matrix3d::ColumnY [get, set] |
Gets or sets the y-column of the 3D matrix.
Vector3d IG::Num::Matrix3d::ColumnZ [get, set] |
Gets or sets the z-column of the 3D matrix.
override double IG::Num::Matrix3d::NormForbenius [get] |
Get Forbenius (or euclidean) norm of the matrix - square root of sum of squares of components.
Reimplemented from IG::Num::MatrixBase.
override double IG::Num::Matrix3d::NormEuclidean [get] |
Get Forbenius (or euclidean) norm of the matrix - square root of sum of squares of components.
Reimplemented from IG::Num::MatrixBase.
override double IG::Num::Matrix3d::Norm [get] |
Get Forbenius (or euclidean) norm of the matrix - square root of sum of squares of components.
Reimplemented from IG::Num::MatrixBase.
double IG::Num::Matrix3d::Norm1 [get] |
Get the 1 norm of the matrix - maximum over columns of sum of absolute values of components.
double IG::Num::Matrix3d::NormInfinity [get] |
Get the infinity norm of the matrix - maximum over rows of sum of absolute values of components.
double IG::Num::Matrix3d::Determinant [get, private] |
Gets matrix determinant.
double IG::Num::Matrix3d::Det [get, private] |
Gets matrix determinant.
override double IG::Num::Matrix3d::Trace [get] |
Gets matrix trace (sum of diagonal elements).
Reimplemented from IG::Num::MatrixBase.
new Matrix3d IG::Num::Matrix3d::T [get] |
Gets transpose of the current matrix.
Reimplemented from IG::Num::MatrixBase.
Matrix3d IG::Num::Matrix3d::Inverse [get, private] |
Gets inverse of the current matrix.
Matrix3d IG::Num::Matrix3d::Inv [get, private] |
Gets inverse of the current matrix.