IGLib 1.4
The IGLib base library for development of numerical, technical and business applications.

IG::Num::mat3 Struct Reference

3D matrix, struct implementation. More...

Collaboration diagram for IG::Num::mat3:

List of all members.

Public Member Functions

 mat3 (mat3 m)
 Copy constructor. Initializes components of a 3D matrix with components of the specified matrix.
 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.
 mat3 (double component)
 Initializes 3D with the specified component.
 mat3 (vec3 xrow, vec3 yrow, vec3 zrow)
 Initializes 3D matrix structure with the specified components.
void Zero ()
 Sets components of the vector to 0.0.
void Set (double comp)
 Sets components of the vector to the specified value.
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 of type mat3) and has equal elements as the current matrix.
mat3 NormalizedEuclidean ()
 Returns this matrix normalized with Euclidean norm.
mat3 NormalizedForbenius ()
 Returns this matrix normalized with Euclidean norm.
mat3 Normalized1 ()
 Returns this matrix normalized with 1 norm.
mat3 NormalizedInfinity ()
 Returns this matrix normalized with infinity norm.
vec3 Solve (vec3 b)
 Returns solution of system of equations with the current system matrix and the specified right-hand sides.
mat3 Add (mat3 a)
 Returns sum of the current matrix and the specified matrix.
mat3 Subtract (mat3 a)
 Returns difference between the current matrix and the specified matrix.
mat3 MultiplyRight (mat3 b)
 Right-multiplies the current 3D matrix with the specified matrix and returns the product.
mat3 MultiplyLeft (mat3 b)
 Left-multiplies the current 3D matrix with the specified matrix and returns the product.
vec3 Multiply (vec3 b)
 Right-multiplies the current 3D matrix with the specified 3D vector and returns the product.
mat3 Multiply (double b)
 Multiplies the current 3D matrix with the specified scalar and returns the product.
override string ToString ()
 Returns a string representation of this 3D matrix.
void Read ()
 Reads this 3D matrix components from a console.
void Read (string name)
 Reads this 3D matrix components from a console.

Static Public Member Functions

static mat3 Copy (mat3 m)
 Returns a copy of the specified 3D matrix.
static void Negate (mat3 m, ref mat3 res)
 Negates the specified 3D matrix and stores its copy in the resulting matrix.
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!
static mat3 operator+ (mat3 m)
 Unary plus for 3D matrices, returns the operand.
static mat3 operator- (mat3 a)
 Unary negation for 3D matrices, returns the negative operand.
static mat3 operator+ (mat3 a, mat3 b)
 Matrix addition in 3D.
static mat3 operator- (mat3 a, mat3 b)
 Matrix subtraction in 3D.
static mat3 operator* (mat3 a, mat3 b)
 Matrix multiplication in 3D.
static vec3 operator* (mat3 a, vec3 b)
 Matrix with vector multiplication in 3D.
static mat3 operator* (mat3 a, double b)
 Product of a 3D matrix by a scalar.
static mat3 operator* (double a, mat3 b)
 Product of a 3D matrix by a scalar.
static mat3 operator/ (mat3 a, double b)
 Division of a 3D matrix by a scalar.
static bool operator== (mat3 a, mat3 b)
 Vector comparison.
static bool operator!= (mat3 a, mat3 b)
 Vector comparison, returns true if vectors are different.
static void Example ()
 A short example of how to use mat3 and vec3 structs.

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.
vec3 rowx [get, set]
 Gets or sets the x-row of the 3D matrix.
vec3 rowy [get, set]
 Gets or sets the y-row of the 3D matrix.
vec3 rowz [get, set]
 Gets or sets the z-row of the 3D matrix.
vec3 columnx [get, set]
 Gets or sets the x-column of the 3D matrix.
vec3 columny [get, set]
 Gets or sets the y-column of the 3D matrix.
vec3 columnz [get, set]
 Gets or sets the z-column of the 3D matrix.
double NormForbenius [get]
 Get Forbenius (or euclidean) norm of the matrix - square root of sum of squares of components.
double NormEuclidean [get]
 Get Forbenius (or euclidean) norm of the matrix - square root of sum of squares of components.
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.
double Trace [get]
 Gets matrix trace (sum of diagonal elements).
mat3 Transpose [get]
 Gets transpose of the current matrix.
mat3 T [get]
 Gets transpose of the current matrix.
mat3 Inverse [get]
 Gets inverse of the current matrix.
mat3 Inv [get]
 Gets inverse of the current matrix.

Detailed Description

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;


Constructor & Destructor Documentation

IG::Num::mat3::mat3 ( mat3  m) [inline]

Copy constructor. Initializes components of a 3D matrix with components of the specified matrix.

Parameters:
mMatrix whose components are copied to the initialized matrix.
IG::Num::mat3::mat3 ( 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::mat3::mat3 ( double  component) [inline]

Initializes 3D with the specified component.

Parameters:
componentValue that is assigned to all matrix components.
IG::Num::mat3::mat3 ( vec3  xrow,
vec3  yrow,
vec3  zrow 
) [inline]

Initializes 3D matrix structure with the specified components.


Member Function Documentation

void IG::Num::mat3::Zero ( ) [inline]

Sets components of the vector to 0.0.

void IG::Num::mat3::Set ( double  comp) [inline]

Sets components of the vector to the specified value.

override int IG::Num::mat3::GetHashCode ( ) [inline]

Returns the hash code (hash 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 hash codes.

Probability that two different matrixes will produce the same hash code is small but it exists.

Overrides the object.GetHashCode method.

override bool IG::Num::mat3::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 of type mat3) and has equal elements as the current matrix.

Overrides the object.Equals method.

mat3 IG::Num::mat3::NormalizedEuclidean ( ) [inline]

Returns this matrix normalized with Euclidean norm.

mat3 IG::Num::mat3::NormalizedForbenius ( ) [inline]

Returns this matrix normalized with Euclidean norm.

mat3 IG::Num::mat3::Normalized1 ( ) [inline]

Returns this matrix normalized with 1 norm.

mat3 IG::Num::mat3::NormalizedInfinity ( ) [inline]

Returns this matrix normalized with infinity norm.

vec3 IG::Num::mat3::Solve ( vec3  b) [inline]

Returns solution of system of equations with the current system matrix and the specified right-hand sides.

Parameters:
bVector of right-hand sides of equations.
Returns:
mat3 IG::Num::mat3::Add ( mat3  a) [inline]

Returns sum of the current matrix and the specified matrix.

mat3 IG::Num::mat3::Subtract ( mat3  a) [inline]

Returns difference between the current matrix and the specified matrix.

mat3 IG::Num::mat3::MultiplyRight ( mat3  b) [inline]

Right-multiplies the current 3D matrix with the specified matrix and returns the product.

Parameters:
bRight-hand side factor of multiplication.
Returns:
this*b
mat3 IG::Num::mat3::MultiplyLeft ( mat3  b) [inline]

Left-multiplies the current 3D matrix with the specified matrix and returns the product.

Parameters:
bLeft-hand side factor of multiplication.
Returns:
b*this
vec3 IG::Num::mat3::Multiply ( vec3  b) [inline]

Right-multiplies the current 3D matrix with the specified 3D vector and returns the product.

Parameters:
bRight-hand side factor of multiplication.
Returns:
this*b
mat3 IG::Num::mat3::Multiply ( double  b) [inline]

Multiplies the current 3D matrix with the specified scalar and returns the product.

Parameters:
bFactor of multiplication.
Returns:
this*b
static mat3 IG::Num::mat3::Copy ( mat3  m) [inline, static]

Returns a copy of the specified 3D matrix.

Parameters:
mMatrix whose copy is returned.
static void IG::Num::mat3::Negate ( mat3  m,
ref mat3  res 
) [inline, static]

Negates the specified 3D matrix and stores its copy in the resulting matrix.

Parameters:
vMatrix to be negated.
resMatrix where the result is stored.
static int IG::Num::mat3::EigenSystem2d ( mat3  a,
ref mat3  eigenvec,
ref vec3  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!

Parameters:
a2D Matrix whose eigenvalues and eigenvectors are calculated.
eigenvecMatrix where eigenvectors are stored as rows.
eigenvalVector where eigenvalues are stored.
Returns:
The number of different real eigenvalues.

$A Igor Aug08, Oct10;

static mat3 IG::Num::mat3::operator+ ( mat3  m) [inline, static]

Unary plus for 3D matrices, returns the operand.

static mat3 IG::Num::mat3::operator- ( mat3  a) [inline, static]

Unary negation for 3D matrices, returns the negative operand.

static mat3 IG::Num::mat3::operator+ ( mat3  a,
mat3  b 
) [inline, static]

Matrix addition in 3D.

static mat3 IG::Num::mat3::operator- ( mat3  a,
mat3  b 
) [inline, static]

Matrix subtraction in 3D.

static mat3 IG::Num::mat3::operator* ( mat3  a,
mat3  b 
) [inline, static]

Matrix multiplication in 3D.

static vec3 IG::Num::mat3::operator* ( mat3  a,
vec3  b 
) [inline, static]

Matrix with vector multiplication in 3D.

static mat3 IG::Num::mat3::operator* ( mat3  a,
double  b 
) [inline, static]

Product of a 3D matrix by a scalar.

static mat3 IG::Num::mat3::operator* ( double  a,
mat3  b 
) [inline, static]

Product of a 3D matrix by a scalar.

static mat3 IG::Num::mat3::operator/ ( mat3  a,
double  b 
) [inline, static]

Division of a 3D matrix by a scalar.

static bool IG::Num::mat3::operator== ( mat3  a,
mat3  b 
) [inline, static]

Vector comparison.

static bool IG::Num::mat3::operator!= ( mat3  a,
mat3  b 
) [inline, static]

Vector comparison, returns true if vectors are different.

override string IG::Num::mat3::ToString ( ) [inline]

Returns a string representation of this 3D matrix.

void IG::Num::mat3::Read ( ) [inline]

Reads this 3D matrix components from a console.

void IG::Num::mat3::Read ( string  name) [inline]

Reads this 3D matrix components from a console.

Parameters:
nameName of the matrix to be read; it is written as orientation to the user and can be null.
static void IG::Num::mat3::Example ( ) [inline, static]

A short example of how to use mat3 and vec3 structs.


Member Data Documentation


Property Documentation

double IG::Num::mat3::this[int i, int j] [get, set]

Index operator.

Parameters:
iComponent index.
Returns:
The specified component of a 3D vector.
vec3 IG::Num::mat3::rowx [get, set]

Gets or sets the x-row of the 3D matrix.

vec3 IG::Num::mat3::rowy [get, set]

Gets or sets the y-row of the 3D matrix.

vec3 IG::Num::mat3::rowz [get, set]

Gets or sets the z-row of the 3D matrix.

vec3 IG::Num::mat3::columnx [get, set]

Gets or sets the x-column of the 3D matrix.

vec3 IG::Num::mat3::columny [get, set]

Gets or sets the y-column of the 3D matrix.

vec3 IG::Num::mat3::columnz [get, set]

Gets or sets the z-column of the 3D matrix.

double IG::Num::mat3::NormForbenius [get]

Get Forbenius (or euclidean) norm of the matrix - square root of sum of squares of components.

double IG::Num::mat3::NormEuclidean [get]

Get Forbenius (or euclidean) norm of the matrix - square root of sum of squares of components.

double IG::Num::mat3::Norm [get]

Get Forbenius (or euclidean) norm of the matrix - square root of sum of squares of components.

double IG::Num::mat3::Norm1 [get]

Get the 1 norm of the matrix - maximum over columns of sum of absolute values of components.

double IG::Num::mat3::NormInfinity [get]

Get the infinity norm of the matrix - maximum over rows of sum of absolute values of components.

double IG::Num::mat3::Determinant [get]

Gets matrix determinant.

double IG::Num::mat3::Det [get]

Gets matrix determinant.

double IG::Num::mat3::Trace [get]

Gets matrix trace (sum of diagonal elements).

mat3 IG::Num::mat3::Transpose [get]

Gets transpose of the current matrix.

mat3 IG::Num::mat3::T [get]

Gets transpose of the current matrix.

mat3 IG::Num::mat3::Inverse [get]

Gets inverse of the current matrix.

mat3 IG::Num::mat3::Inv [get]

Gets inverse of the current matrix.


The documentation for this struct was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties Events