Tutorial Toolkit Function Descriptions > Utilities > Math
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX''">XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX''">   
Math
 
math_get_no_data_null
(rval )
Description:
Return the no valid value real number.
Input:
None
Output:
REAL
rval
The value that represents no valid real.
Error Conditions:
None.
Remarks:
None.
Example:
Please see math_get_no_data_null (p. 1430) in the MSC Acumen Toolkit - Code Example.
 
math_is_no_data_null
(rval )
Description:
Return True if the input is the math no data null value, False otherwise.
Input:
REAL
rval
The value to check against the no valid real value.
Output:
REAL
rval
The value to check against the no valid real value.
LOGICAL
<Return Value>
TRUE if value is NULL.
Error Conditions:
None.
Remarks:
Want to pass by address (must be writable).
Example:
Please see math_is_no_data_null (p. 1431) in the MSC Acumen Toolkit - Code Example.
 
math_mat_add
(matrix3, matrix1, matrix2, dim1, dim2)
  
Description:
This function adds the two matrices into the third matrix.
Input:
REAL
matrix1(dim1, dim2)
First matrix to be added.
REAL
matrix2(dim1, dim2)
Second matrix to be added.
INTEGER
dim1
Dimensional values.
INTEGER
dim2
Dimensional values.
Output:
REAL
matrix3(dim1, dim2)
Resultant matrix after the addition
Example:
Please see math_mat_add (p. 1432) in the MSC Acumen Toolkit - Code Example.
  
math_mat_invert
(matrix , dim, tol, i_return_value)
Description:
This function inverts the matrix.
Input:
REAL
matrix(dim, dim)
Matrix to be inverted.
INTEGER
dim
Dimensional value.
REAL
tol
System tolerance for singularity checking.
Output:
REAL
matrix(dim, dim)
Resultant matrix after inversion.
INTEGER
i_return_value
0 for success of function
Example:
Please see math_mat_invert (p. 1433) in the MSC Acumen Toolkit - Code Example.
  
math_mat_mult
(matrix1, matrix2, matrix3, dim1, dim2, dim3)
Description:
This function multiplies two matrices assuming PCL (row, column) array ordering.
Input:
REAL
matrix1(dim1, dim2)
First matrix to be multiplied.
REAL
matrix2(dim2, dim3)
Second matrix to be multiplied.
INTEGER
dim1
Dimensional value.
INTEGER
dim2
Dimensional value.
INTEGER
dim3
Dimensional value.
Output:
REAL
matrix3(dim1, dim3)
Resultant matrix after multipication.
Example:
Please see math_mat_mult (p. 1434) in the MSC Acumen Toolkit - Code Example.
This function assumes PCL array (row, column) ordering. FORTRAN arrays are stored in a (column, row) format.
This function multiplies only 2 dimensional arrays.
Note:  
Not all functions return matrices in PCL row, column format. A PCL interface to a FORTRAN function may return a matrix in a FORTRAN column, row format.
  
math_mat_mult_f
(matrix1, matrix2, matrix3, dim1, dim2, dim3)
Description:
This function multiplies two matrices assuming FORTRAN (column, row) array ordering.
Input:
REAL
matrix1(dim1, dim2)
First matrix to be multiplied.
REAL
matrix2(dim2, dim3)
Second matrix to be multiplied.
INTEGER
dim1
Dimensional value.
INTEGER
dim2
Dimensional value.
INTEGER
dim3
Dimensional value.
Output:
REAL
matrix3(dim1, dim3)
Resultant matrix after multipication.
Example:
This function assumes FORTRAN array (column, row) ordering. PCL arrays are stored in a (row, column) format.
This function multiplies only 2 dimensional arrays.
Note:  
Not all functions return matrices in PCL row, column format. A PCL interface to a FORTRAN function may return a matrix in a FORTRAN column, row format.
 
math_mat_transp_in_place
(matrix, dim)
  
Description:
This function transposes a matrix.
Input:
REAL
matrix(dim, dim)
Matrix to be transposed.
INTEGER
dim
Dimensional value.
Output:
REAL
matrix(dim, dim)
Transposed matrix.
Example:
Please see math_mat_transp_in_place (p. 1438) in the MSC Acumen Toolkit - Code Example.
  
math_vec_len
(vector)
Description:
This function computes the length of a vector.
Input:
REAL ARRAY
vector(3)
Three dimensional vector
Output:
REAL
<Return Value>
Length of the vector
Error Condition:
None
Example:
Please see math_vec_len (p. 1439) in the MSC Acumen Toolkit - Code Example.
  
math_vec_norm
(syseps, vector)
Description:
This function normalizes a three dimensional vector.
Input:
REAL
syseps
The system epsilon, used to determine when a floating point number is essentially zero, as far as the system is concerned.
REAL ARRAY
vector(3)
Three dimensional vector
Output:
REAL ARRAY
vector(3)
The normalized three dimensional vector
INTEGER
<Return Value>
Return value is 1 if the length of the vector is zero, otherwise 0.
Error Condition:
None
Example:
Please see math_vec_norm (p. 1440) in the MSC Acumen Toolkit - Code Example.
 
mth_vec_add
(dim, vector1, vector2, vector3)
  
Description:
This function computes the sum of two n-dimensional vectors.
Input:
INTEGER
dim
Dimensional value of vectors.
REAL ARRAY
vector1(dim)
First vector to be added
REAL ARRAY
vector2(dim)
Second vector to be added
Output:
REAL ARRAY
vector3(dim)
Resultant vector
Error Condition:
None
Example:
Please see mth_vec_add (p. 1441) in the MSC Acumen Toolkit - Code Example.
  
mth_vec_cross_prod
(vector1, vector2, vector3, dim)
Description:
This function computes the cross product of two 3-dimensional vector arrays.
Input:
INTEGER
dim
Dimensional value of vectors.
REAL ARRAY
vector1(dim, 3)
First vector.
REAL ARRAY
vector2(dim, 3)
Second vector.
Output:
REAL
vector3(dim, 3)
Resultant cross product vector.
Error Condition:
None
Example:
Please see mth_vec_cross_prod (p. 1442) in the MSC Acumen Toolkit - Code Example.
  
mth_vec_dot_prod
(vector1, vector2)
Description:
This function computes the dot product of two 3-dimensional vectors.
Input:
REAL ARRAY
vector1(3)
First vector.
REAL ARRAY
vector2(3)
Second vector.
Output:
REAL
<Return Value>
Resultant dot product real value.
Error Condition:
None
 
 
Example:
Please see mth_vec_dot_prod (p. 1444) in the MSC Acumen Toolkit - Code Example.
 
mth_vec_length
(vector)
  
Description:
This function computes the length of a vector.
Input:
REAL ARRAY
vector(3)
Three dimensional vector.
Output:
REAL
<Return Value>
Length of the vector.
Error Condition:
None
Example:
Please see mth_vec_length (p. 1445) in the MSC Acumen Toolkit - Code Example.
  
mth_vec_scale
(scale_factor, n, vector)
Description:
This function scales a vector by a scale factor.
Input:
REAL
scale_factor
Scale factor value.
REAL ARRAY
vector(n)
Three dimensional vector.
INTEGER
n
Dimensional value.
Output:
REAL
vector(n)
The scaled vector.
Error Condition:
None
Example:
Please see mth_vec_scale (p. 1446) in the MSC Acumen Toolkit - Code Example.
 
util_equal_real
(a, b, nsig )
Description:
Determine if a and b are equal out to NSIG significant digits.
Input:
REAL
a
Test values.
REAL
b
Comparison value.
INTEGER
nsig
Number of significant digits.
Output:
LOGICAL
<Return Value>
Returns TRUE if a and b are equal to the nsig significant digit, FALSE otherwise.
Error Conditions:
None.
Remarks:
None.
Example:
Please see util_equal_real (p. 1509) in the MSC Acumen Toolkit - Code Example.
 
util_real_equal_null
(val)
 
Description:
Test if a real value is null.
Input:
REAL
val
Value to test.
Output:
LOGICAL
<Return Value>
Returns TRUE if input value is null.
Error Conditions:
None.
Remarks:
None.
Example:
Please see util_real_equal_null (p. 1511) in the MSC Acumen Toolkit - Code Example.
 
util_rounder
(rval, nsigd, rout )
Description:
Round off RVAL to NSIGD significant digits in ROUT.
Input:
REAL
rval
The value to be rounded.
INTEGER
nsigd
Number of significant digits NSIGD must be positive to get a meaningful answer. If it is not, a warning will be issued that NSIGD will be assumed to be one.
Output:
REAL
rout
Rounded value of RVAL.
INTEGER
<Return Value>
Return status ( =0 if no error ).
Error Conditions:
None.
Remarks:
None.
Example:
Please see util_rounder (p. 1512) in the MSC Acumen Toolkit - Code Example.