IGLib
1.7.2
The IGLib base library for development of numerical, technical and business applications.
|
3D matrix, struct implementation. More...
Public Member Functions | |
mat3 (mat3 m) | |
Copy constructor. Initializes components of a 3D matrix with components of the specified matrix. More... | |
mat3 (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. More... | |
mat3 (double component) | |
Initializes 3D with the specified component. More... | |
mat3 (vec3 xrow, vec3 yrow, vec3 zrow) | |
Initializes 3D matrix structure with the specified components. More... | |
void | Zero () |
Sets components of the vector to 0.0. More... | |
void | Set (double comp) |
Sets components of the vector to the specified value. More... | |
override int | GetHashCode () |
Returns the hashRet code (hashRet function) of the current matrix. More... | |
override bool | Equals (Object obj) |
Returns a value indicating whether the specified object is equal to the current matrix. More... | |
mat3 | NormalizedEuclidean () |
Returns this matrix normalized with Euclidean norm. More... | |
mat3 | NormalizedForbenius () |
Returns this matrix normalized with Euclidean norm. More... | |
mat3 | Normalized1 () |
Returns this matrix normalized with 1 norm. More... | |
mat3 | NormalizedInfinity () |
Returns this matrix normalized with infinity norm. More... | |
vec3 | Solve (vec3 b) |
Returns solution of system of equations with the current system matrix and the specified right-hand sides. More... | |
mat3 | Add (mat3 a) |
Returns sum of the current matrix and the specified matrix. More... | |
mat3 | Subtract (mat3 a) |
Returns difference between the current matrix and the specified matrix. More... | |
mat3 | MultiplyRight (mat3 b) |
Right-multiplies the current 3D matrix with the specified matrix and returns the product. More... | |
mat3 | MultiplyLeft (mat3 b) |
Left-multiplies the current 3D matrix with the specified matrix and returns the product. More... | |
vec3 | Multiply (vec3 b) |
Right-multiplies the current 3D matrix with the specified 3D vector and returns the product. More... | |
mat3 | Multiply (double b) |
Multiplies the current 3D matrix with the specified scalar and returns the product. More... | |
override string | ToString () |
Returns a string representation of this 3D matrix. More... | |
void | Read () |
Reads this 3D matrix components from a console. More... | |
void | Read (string name) |
Reads this 3D matrix components from a console. More... | |
Static Public Member Functions | |
static mat3 | Copy (mat3 m) |
Returns a copy of the specified 3D matrix. More... | |
static void | Negate (mat3 m, ref mat3 res) |
Negates the specified 3D matrix and stores its copy in the resulting matrix. More... | |
static int | EigenSystem2d (mat3 a, ref mat3 eigenvec, ref vec3 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! More... | |
static mat3 | operator+ (mat3 m) |
Unary plus for 3D matrices, returns the operand. More... | |
static mat3 | operator- (mat3 a) |
Unary negation for 3D matrices, returns the negative operand. More... | |
static mat3 | operator+ (mat3 a, mat3 b) |
Matrix addition in 3D. More... | |
static mat3 | operator- (mat3 a, mat3 b) |
Matrix subtraction in 3D. More... | |
static mat3 | operator* (mat3 a, mat3 b) |
Matrix multiplication in 3D. More... | |
static vec3 | operator* (mat3 a, vec3 b) |
Matrix with vector multiplication in 3D. More... | |
static mat3 | operator* (mat3 a, double b) |
Product of a 3D matrix by a scalar. More... | |
static mat3 | operator* (double a, mat3 b) |
Product of a 3D matrix by a scalar. More... | |
static mat3 | operator/ (mat3 a, double b) |
Division of a 3D matrix by a scalar. More... | |
static bool | operator== (mat3 a, mat3 b) |
Vector comparison. More... | |
static bool | operator!= (mat3 a, mat3 b) |
Vector comparison, returns true if vectors are different. More... | |
static void | Example () |
A short example of how to use mat3 and vec3 structs. More... | |
Public Attributes | |
double | xx |
double | xy |
double | xz |
double | yx |
double | yy |
double | yz |
double | zx |
double | zy |
double | zz |
Properties | |
double | this[int i, int j] [get, set] |
Index operator. More... | |
vec3 | rowx [get, set] |
Gets or sets the x-row of the 3D matrix. More... | |
vec3 | rowy [get, set] |
Gets or sets the y-row of the 3D matrix. More... | |
vec3 | rowz [get, set] |
Gets or sets the z-row of the 3D matrix. More... | |
vec3 | columnx [get, set] |
Gets or sets the x-column of the 3D matrix. More... | |
vec3 | columny [get, set] |
Gets or sets the y-column of the 3D matrix. More... | |
vec3 | columnz [get, set] |
Gets or sets the z-column of the 3D matrix. More... | |
double | NormForbenius [get] |
Get Forbenius (or euclidean) norm of the matrix - square root of sum of squares of components. More... | |
double | NormEuclidean [get] |
Get Forbenius (or euclidean) norm of the matrix - square root of sum of squares of components. More... | |
double | Norm [get] |
Get Forbenius (or euclidean) norm of the matrix - square root of sum of squares of components. More... | |
double | Norm1 [get] |
Get the 1 norm of the matrix - maximum over columns of sum of absolute values of components. More... | |
double | NormInfinity [get] |
Get the infinity norm of the matrix - maximum over rows of sum of absolute values of components. More... | |
double | Determinant [get] |
Gets matrix determinant. More... | |
double | Det [get] |
Gets matrix determinant. More... | |
double | Trace [get] |
Gets matrix trace (sum of diagonal elements). More... | |
mat3 | Transpose [get] |
Gets transpose of the current matrix. More... | |
mat3 | T [get] |
Gets transpose of the current matrix. More... | |
mat3 | Inverse [get] |
Gets inverse of the current matrix. More... | |
mat3 | Inv [get] |
Gets inverse of the current matrix. More... | |
3D matrix, struct implementation.
Name of this struct is not in line with conventions. This is intentional in order to prevent mistaking struct implementation for class interpretation.
$A Igor Jul08, Oct10;
|
inline |
Copy constructor. Initializes components of a 3D matrix with components of the specified matrix.
m | Matrix whose components are copied to the initialized matrix. |
References IG.Num.mat3.xx, IG.Num.mat3.xy, IG.Num.mat3.xz, IG.Num.mat3.yx, IG.Num.mat3.yy, IG.Num.mat3.yz, IG.Num.mat3.zx, IG.Num.mat3.zy, and IG.Num.mat3.zz.
|
inline |
Initializes 3D matrix structure with the specified components.
|
inline |
Initializes 3D with the specified component.
component | Value that is assigned to all matrix components. |
Initializes 3D matrix structure with the specified components.
References IG.Num.vec3.x, IG.Num.vec3.y, and IG.Num.vec3.z.
|
inline |
Sets components of the vector to 0.0.
|
inline |
Sets components of the vector to the specified value.
|
inline |
Returns the hashRet code (hashRet function) of the current matrix.
This method should be consistent with the MatrixBase.GetHashCode() method, which is standard for implementations of the IMatrix interface.
Two matrices that have the same equal all elements will produce the same hashRet codes.
Probability that two different matrixes will produce the same hashRet code is small but it exists.
Overrides the object.GetHashCode method.
|
inline |
Returns a value indicating whether the specified object is equal to the current matrix.
True is returned if the object is of type mat3) and has equal elements as the current matrix.
Overrides the object.Equals(object) method.
|
inline |
Returns this matrix normalized with Euclidean norm.
|
inline |
Returns this matrix normalized with Euclidean norm.
|
inline |
Returns this matrix normalized with 1 norm.
|
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.
References IG.Num.mat3.xx, IG.Num.mat3.xy, IG.Num.mat3.xz, IG.Num.mat3.yx, IG.Num.mat3.yy, IG.Num.mat3.yz, IG.Num.mat3.zx, IG.Num.mat3.zy, and IG.Num.mat3.zz.
Referenced by IG.Num.mat3.operator+().
Returns difference between the current matrix and the specified matrix.
References IG.Num.mat3.xx, IG.Num.mat3.xy, IG.Num.mat3.xz, IG.Num.mat3.yx, IG.Num.mat3.yy, IG.Num.mat3.yz, IG.Num.mat3.zx, IG.Num.mat3.zy, and IG.Num.mat3.zz.
Referenced by IG.Num.mat3.operator-().
Right-multiplies the current 3D matrix with the specified matrix and returns the product.
b | Right-hand side factor of multiplication. |
References IG.Num.mat3.xx, IG.Num.mat3.xy, IG.Num.mat3.xz, IG.Num.mat3.yx, IG.Num.mat3.yy, IG.Num.mat3.yz, IG.Num.mat3.zx, IG.Num.mat3.zy, and IG.Num.mat3.zz.
Referenced by IG.Num.mat3.MultiplyLeft(), and IG.Num.mat3.operator*().
Left-multiplies the current 3D matrix with the specified matrix and returns the product.
b | Left-hand side factor of multiplication. |
References IG.Num.mat3.MultiplyRight().
Right-multiplies the current 3D matrix with the specified 3D vector and returns the product.
b | Right-hand side factor of multiplication. |
References IG.Num.vec3.x, IG.Num.vec3.y, and IG.Num.vec3.z.
Referenced by IG.Num.mat3.operator*(), and IG.Num.mat3.operator/().
|
inline |
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. |
Referenced by IG.Num.mat3.operator+().
Negates the specified 3D matrix and stores its copy in the resulting matrix.
References IG.Num.mat3.xx, IG.Num.mat3.xy, IG.Num.mat3.xz, IG.Num.mat3.yx, IG.Num.mat3.yy, IG.Num.mat3.yz, IG.Num.mat3.zx, IG.Num.mat3.zy, and IG.Num.mat3.zz.
Referenced by IG.Num.Matrix3d.Negate().
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;
References IG.Num.mat3.xx, IG.Num.mat3.xy, IG.Num.mat3.yx, and IG.Num.mat3.yy.
Referenced by IG.Num.Matrix3d.EigenSystem2d().
Unary plus for 3D matrices, returns the operand.
References IG.Num.mat3.Copy().
Unary negation for 3D matrices, returns the negative operand.
References IG.Num.mat3.xx, IG.Num.mat3.xy, IG.Num.mat3.xz, IG.Num.mat3.yx, IG.Num.mat3.yy, IG.Num.mat3.yz, IG.Num.mat3.zx, IG.Num.mat3.zy, and IG.Num.mat3.zz.
Matrix addition in 3D.
References IG.Num.mat3.Add().
Matrix subtraction in 3D.
References IG.Num.mat3.Subtract().
Matrix multiplication in 3D.
References IG.Num.mat3.MultiplyRight().
Matrix with vector multiplication in 3D.
References IG.Num.mat3.Multiply().
Product of a 3D matrix by a scalar.
References IG.Num.mat3.Multiply().
Product of a 3D matrix by a scalar.
References IG.Num.mat3.Multiply().
Division of a 3D matrix by a scalar.
References IG.Num.mat3.Multiply().
Vector comparison.
References IG.Num.mat3.xx, IG.Num.mat3.xy, IG.Num.mat3.xz, IG.Num.mat3.yx, IG.Num.mat3.yy, IG.Num.mat3.yz, IG.Num.mat3.zx, IG.Num.mat3.zy, and IG.Num.mat3.zz.
Vector comparison, returns true if vectors are different.
References IG.Num.mat3.xx, IG.Num.mat3.xy, IG.Num.mat3.xz, IG.Num.mat3.yx, IG.Num.mat3.yy, IG.Num.mat3.yz, IG.Num.mat3.zx, IG.Num.mat3.zy, and IG.Num.mat3.zz.
|
inline |
Returns a string representation of this 3D matrix.
|
inline |
Reads this 3D matrix components from a console.
Referenced by IG.Num.mat3.Example(), and IG.Num.Matrix3d.Read().
|
inline |
Reads this 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. |
References IG.Lib.UtilConsole.Read().
|
inlinestatic |
A short example of how to use mat3 and vec3 structs.
References IG.Num.A, IG.Num.mat3.Determinant, IG.Num.mat3.Inv, IG.Num.mat3.Inverse, IG.Lib.UtilConsole.Read(), IG.Num.vec3.Read(), IG.Num.mat3.Read(), and IG.Num.mat3.T.
double IG.Num.mat3.xx |
double IG.Num.mat3.xy |
double IG.Num.mat3.xz |
double IG.Num.mat3.yx |
double IG.Num.mat3.yy |
double IG.Num.mat3.yz |
double IG.Num.mat3.zx |
double IG.Num.mat3.zy |
double IG.Num.mat3.zz |
|
getset |
Index operator.
i | Component index 1. |
j | Component index 2. |
|
getset |
Gets or sets the x-row of the 3D matrix.
|
getset |
Gets or sets the y-row of the 3D matrix.
|
getset |
Gets or sets the z-row of the 3D matrix.
|
getset |
Gets or sets the x-column of the 3D matrix.
|
getset |
Gets or sets the y-column of the 3D matrix.
|
getset |
Gets or sets the z-column of the 3D matrix.
|
get |
Get Forbenius (or euclidean) norm of the matrix - square root of sum of squares of components.
|
get |
Get Forbenius (or euclidean) norm of the matrix - square root of sum of squares of components.
|
get |
Get Forbenius (or euclidean) norm of the matrix - square root of sum of squares of components.
|
get |
Get the 1 norm of the matrix - maximum over columns of sum of absolute values of components.
|
get |
Get the infinity norm of the matrix - maximum over rows of sum of absolute values of components.
|
get |
Gets matrix determinant.
Referenced by IG.Num.mat3.Example().
|
get |
Gets matrix determinant.
|
get |
Gets matrix trace (sum of diagonal elements).
|
get |
Gets transpose of the current matrix.
|
get |
Gets transpose of the current matrix.
Referenced by IG.Num.mat3.Example().
|
get |
Gets inverse of the current matrix.
Referenced by IG.Num.mat3.Example().
|
get |
Gets inverse of the current matrix.
Referenced by IG.Num.mat3.Example().