Main Page | Modules | Class List | File List | Class Members | File Members

2x3matrix.c File Reference

#include <math.h>
#include <gandalf/linalg/2x3matrix.h>
#include <gandalf/common/misc_error.h>
#include <gandalf/common/endian_io.h>

Defines

#define GAN_MATTYPE   Gan_Matrix23
#define GAN_MATRIX_TYPE   Gan_Matrix
#define GAN_SQUMATRIX_TYPE   Gan_SquMatrix
#define GAN_VECTOR_TYPE   Gan_Vector
#define GAN_MAT_ELEMENT_TYPE   GAN_DOUBLE
#define GAN_REALTYPE   double
#define GAN_FWRITE_LENDIAN   gan_fwrite_lendian_f64
#define GAN_FREAD_LENDIAN   gan_fread_lendian_f64
#define GAN_VECTYPE1   Gan_Vector2
#define GAN_VECTYPE2   Gan_Vector3
#define GAN_MATTYPEL   Gan_Matrix22
#define GAN_MATTYPER   Gan_Matrix33
#define GAN_SQUMATTYPEL   Gan_SquMatrix22
#define GAN_SQUMATTYPER   Gan_SquMatrix33
#define GAN_MAT_FPRINT   gan_mat23_fprint
#define GAN_MAT_PRINT   gan_mat23_print
#define GAN_MAT_FSCANF   gan_mat23_fscanf
#define GAN_MAT_FWRITE   gan_mat23_fwrite
#define GAN_MAT_FREAD   gan_mat23_fread
#define GAN_MAT_ZERO_Q   gan_mat23_zero_q
#define GAN_MAT_ZERO_S   gan_mat23_zero_s
#define GAN_MAT_COPY_Q   gan_mat23_copy_q
#define GAN_MAT_COPY_S   gan_mat23_copy_s
#define GAN_MAT_SCALE_Q   gan_mat23_scale_q
#define GAN_MAT_SCALE_I   gan_mat23_scale_i
#define GAN_MAT_SCALE_S   gan_mat23_scale_s
#define GAN_MAT_DIVIDE_Q   gan_mat23_divide_q
#define GAN_MAT_DIVIDE_I   gan_mat23_divide_i
#define GAN_MAT_DIVIDE_S   gan_mat23_divide_s
#define GAN_MAT_NEGATE_Q   gan_mat23_negate_q
#define GAN_MAT_NEGATE_I   gan_mat23_negate_i
#define GAN_MAT_NEGATE_S   gan_mat23_negate_s
#define GAN_MAT_UNIT_Q   gan_mat23_unit_q
#define GAN_MAT_UNIT_I   gan_mat23_unit_i
#define GAN_MAT_UNIT_S   gan_mat23_unit_s
#define GAN_MAT_ADD_Q   gan_mat23_add_q
#define GAN_MAT_ADD_I1   gan_mat23_add_i1
#define GAN_MAT_ADD_I2   gan_mat23_add_i2
#define GAN_MAT_INCREMENT   gan_mat23_increment
#define GAN_MAT_ADD_S   gan_mat23_add_s
#define GAN_MAT_SUB_Q   gan_mat23_sub_q
#define GAN_MAT_SUB_I1   gan_mat23_sub_i1
#define GAN_MAT_SUB_I2   gan_mat23_sub_i2
#define GAN_MAT_DECREMENT   gan_mat23_decrement
#define GAN_MAT_SUB_S   gan_mat23_sub_s
#define GAN_VEC_OUTER_Q   gan_vec23_outer_q
#define GAN_VEC_OUTER_S   gan_vec23_outer_s
#define GAN_MAT_MULTV_Q   gan_mat23_multv3_q
#define GAN_MAT_MULTV_S   gan_mat23_multv3_s
#define GAN_MATT_MULTV_Q   gan_mat23T_multv2_q
#define GAN_MATT_MULTV_S   gan_mat23T_multv2_s
#define GAN_MAT_LMULTM_Q   gan_mat23_lmultm22_q
#define GAN_MAT_LMULTM_S   gan_mat23_lmultm22_s
#define GAN_MAT_LMULTMT_Q   gan_mat23_lmultm22T_q
#define GAN_MAT_LMULTMT_S   gan_mat23_lmultm22T_s
#define GAN_MAT_RMULTM_Q   gan_mat23_rmultm33_q
#define GAN_MAT_RMULTM_S   gan_mat23_rmultm33_s
#define GAN_MAT_RMULTMT_Q   gan_mat23_rmultm33T_q
#define GAN_MAT_RMULTMT_S   gan_mat23_rmultm33T_s
#define GAN_MAT_LMULTMT_SYM_Q   gan_mat23_lmultm23T_sym_q
#define GAN_MAT_LMULTMT_SYM_S   gan_mat23_lmultm23T_sym_s
#define GAN_MAT_RMULTMT_SYM_Q   gan_mat23_rmultm23T_sym_q
#define GAN_MAT_RMULTMT_SYM_S   gan_mat23_rmultm23T_sym_s
#define GAN_MAT_SLMULTT_Q   gan_mat23_slmultT_q
#define GAN_MAT_SLMULTT_S   gan_mat23_slmultT_s
#define GAN_MAT_SRMULTT_Q   gan_mat23_srmultT_q
#define GAN_MAT_SRMULTT_S   gan_mat23_srmultT_s
#define GAN_MAT_LMULTS_Q   gan_mat23_lmults22_q
#define GAN_MAT_LMULTS_S   gan_mat23_lmults22_s
#define GAN_MAT_RMULTS_Q   gan_mat23_rmults33_q
#define GAN_MAT_RMULTS_S   gan_mat23_rmults33_s
#define GAN_SYMMATL_LRMULT_Q   gan_symmat22_lrmultm23T_q
#define GAN_SYMMATL_LRMULT_S   gan_symmat22_lrmultm23T_s
#define GAN_SYMMATR_LRMULT_Q   gan_symmat33_lrmultm23_q
#define GAN_SYMMATR_LRMULT_S   gan_symmat33_lrmultm23_s
#define GAN_MAT_LMULTL_Q   gan_mat23_lmultl22_q
#define GAN_MAT_LMULTL_S   gan_mat23_lmultl22_s
#define GAN_MAT_LMULTL_I   gan_mat23_lmultl22_i
#define GAN_MAT_LMULTLI_Q   gan_mat23_lmultl22I_q
#define GAN_MAT_LMULTLI_S   gan_mat23_lmultl22I_s
#define GAN_MAT_LMULTLI_I   gan_mat23_lmultl22I_i
#define GAN_MAT_LMULTLT_Q   gan_mat23_lmultl22T_q
#define GAN_MAT_LMULTLT_S   gan_mat23_lmultl22T_s
#define GAN_MAT_LMULTLT_I   gan_mat23_lmultl22T_i
#define GAN_MAT_LMULTLIT_Q   gan_mat23_lmultl22IT_q
#define GAN_MAT_LMULTLIT_S   gan_mat23_lmultl22IT_s
#define GAN_MAT_LMULTLIT_I   gan_mat23_lmultl22IT_i
#define GAN_MAT_RMULTL_Q   gan_mat23_rmultl33_q
#define GAN_MAT_RMULTL_S   gan_mat23_rmultl33_s
#define GAN_MAT_RMULTL_I   gan_mat23_rmultl33_i
#define GAN_MAT_RMULTLI_Q   gan_mat23_rmultl33I_q
#define GAN_MAT_RMULTLI_S   gan_mat23_rmultl33I_s
#define GAN_MAT_RMULTLI_I   gan_mat23_rmultl33I_i
#define GAN_MAT_RMULTLT_Q   gan_mat23_rmultl33T_q
#define GAN_MAT_RMULTLT_S   gan_mat23_rmultl33T_s
#define GAN_MAT_RMULTLT_I   gan_mat23_rmultl33T_i
#define GAN_MAT_RMULTLIT_Q   gan_mat23_rmultl33IT_q
#define GAN_MAT_RMULTLIT_S   gan_mat23_rmultl33IT_s
#define GAN_MAT_RMULTLIT_I   gan_mat23_rmultl33IT_i
#define GAN_MAT_SUMSQR_Q   gan_mat23_sumsqr_q
#define GAN_MAT_SUMSQR_S   gan_mat23_sumsqr_s
#define GAN_MAT_FNORM_Q   gan_mat23_Fnorm_q
#define GAN_MAT_FNORM_S   gan_mat23_Fnorm_s
#define GAN_MAT_FROM_MAT_Q   gan_mat23_from_mat_q
#define GAN_MAT_FROM_MAT_S   gan_mat23_from_mat_s

Functions

Gan_Bool gan_mat23_fprint (FILE *fp, const Gan_Matrix23 *A, const char *prefix, int indent, const char *fmt)
 Print 2x3 matrix to file.
Gan_Bool gan_mat23_fscanf (FILE *fp, Gan_Matrix23 *A, char *prefix, int prefix_len)
 Read 2x3 matrix from file.
Gan_Matrix23 gan_mat23_fill_s (double XX, double XY, double XZ, double YX, double YY, double YZ)
 Fill 2x3 matrix with values.
Gan_Matrix22 gan_mat23_rmultm23T_s (const Gan_Matrix23 *A, const Gan_Matrix23 *B)
 Multiply 2x3 matrix by the transpose of 2x3 matrix.
Gan_Vector2 gan_mat23_multv2h_s (const Gan_Matrix23 *A, const Gan_Vector2 *p, double h)
 Multiply 2x3 matrix by homogeneous 2-vector.
Gan_Bool gan_mat23h_invert_q (const Gan_Matrix23 *A, double a, Gan_Matrix23 *B, double *b)
 Compute inverse of completed 3x3 matrix.
Gan_Matrix23 gan_mat23h_invert_s (const Gan_Matrix23 *A, double a, double *b)
 Compute inverse of completed 3x3 matrix.
void gan_mat23_get_rows_s (const Gan_Matrix23 *A, Gan_Vector3 *p, Gan_Vector3 *q)
 Extract rows of 2x3 matrix.
void gan_mat23_get_cols_s (const Gan_Matrix23 *A, Gan_Vector2 *p, Gan_Vector2 *q, Gan_Vector2 *r)
 Extract columns of 2x3 matrix.
Gan_Matrix22 gan_mat23_get_m22l_s (const Gan_Matrix23 *A)
 Extract left-hand 2x2 part of 2x3 matrix.
Gan_Vector2 gan_mat23_get_v2r_s (const Gan_Matrix23 *A)
 Extract right-hand column of 2x3 matrix.
Gan_Matrix23 gan_mat23_set_parts_s (const Gan_Matrix22 *B, const Gan_Vector2 *p)
 Build 2x3 matrix from 2x2 matrix and column 2-vector.
Gan_Matrix23gan_mat23_from_mat_q (const Gan_Matrix *A, Gan_Matrix23 *B)
 Convert generic rectangular matrix to 2x3 matrix structure.
Gan_Bool gan_mat23_print (const Gan_Matrix23 *A, const char *prefix, int indent, const char *fmt)
 Print fixed size matrix to standard output.
Gan_Bool gan_mat23_fwrite (FILE *fp, const Gan_Matrix23 *A, gan_uint32 magic_number)
 Write fixed size matrix to file stream.
Gan_Bool gan_mat23_fread (FILE *fp, Gan_Matrix23 *A, gan_uint32 *magic_number)
 Read fixed size matrix from file stream.
Gan_Matrix23 gan_mat23_zero_s (void)
 Set fixed size matrix to zero.
Gan_Matrix23 gan_mat23_copy_s (const Gan_Matrix23 *A)
 Copy fixed size matrix.
Gan_Matrix23 gan_mat23_scale_s (const Gan_Matrix23 *A, double a)
 Scale fixed size matrix.
Gan_Matrix23 gan_mat23_divide_s (const Gan_Matrix23 *A, double a)
 Divide fixed size matrix by scalar.
Gan_Matrix23 gan_mat23_negate_s (const Gan_Matrix23 *A)
 Negate fixed size matrix.
Gan_Matrix23gan_mat23_unit_q (Gan_Matrix23 *A, Gan_Matrix23 *B)
 Scale matrix to unit norm.
Gan_Matrix23 gan_mat23_unit_s (const Gan_Matrix23 *A)
 Scale matrix to unit norm.
Gan_Matrix23 gan_mat23_add_s (const Gan_Matrix23 *A, const Gan_Matrix23 *B)
 Add two fixed size matrices.
Gan_Matrix23 gan_mat23_sub_s (const Gan_Matrix23 *A, const Gan_Matrix23 *B)
 Subtract two fixed size matrices.
Gan_Matrix23 gan_vec23_outer_s (const Gan_Vector2 *p, const Gan_Vector3 *q)
 Compute the outer product of two fixed size vectors.
Gan_Vector2 gan_mat23_multv3_s (const Gan_Matrix23 *A, const Gan_Vector3 *p)
 Matrix/vector product.
Gan_Vector3 gan_mat23T_multv2_s (const Gan_Matrix23 *A, const Gan_Vector2 *p)
 Matrix/vector product with the matrix transposed.
Gan_Matrix23 gan_mat23_lmultm22_s (const Gan_Matrix23 *A, const Gan_Matrix22 *B)
 Left-multiply a matrix by another matrix.
Gan_Matrix23 gan_mat23_lmultm22T_s (const Gan_Matrix23 *A, const Gan_Matrix22 *B)
 Left-multiply a matrix by the transpose of another matrix.
Gan_Matrix23 gan_mat23_rmultm33_s (const Gan_Matrix23 *A, const Gan_Matrix33 *B)
 Right-multiply a matrix by another matrix.
Gan_Matrix23 gan_mat23_rmultm33T_s (const Gan_Matrix23 *A, const Gan_Matrix33 *B)
 Right-multiply a matrix by the transpose of another matrix.
Gan_SquMatrix33 gan_mat23_lmultm23T_sym_s (const Gan_Matrix23 *A, const Gan_Matrix23 *B)
 Matrix product producing a symmetric matrix.
Gan_SquMatrix22 gan_mat23_rmultm23T_sym_s (const Gan_Matrix23 *A, const Gan_Matrix23 *B)
 Matrix product producing a symmetric matrix.
Gan_SquMatrix33 gan_mat23_slmultT_s (const Gan_Matrix23 *A)
 Left-multiply a matrix by its own transpose, producing a symmetric matrix.
Gan_SquMatrix22 gan_mat23_srmultT_s (const Gan_Matrix23 *A)
 Right-multiply a matrix by its own transpose, producing a symmetric matrix.
Gan_Matrix23 gan_mat23_lmults22_s (const Gan_Matrix23 *A, const Gan_SquMatrix22 *B)
 Left-multiply a matrix by a symmetric matrix.
Gan_Matrix23 gan_mat23_rmults33_s (const Gan_Matrix23 *A, const Gan_SquMatrix33 *B)
 Right-multiply a matrix by a symmetric matrix.
Gan_SquMatrix33 gan_symmat22_lrmultm23T_s (const Gan_SquMatrix22 *A, const Gan_Matrix23 *B, Gan_Matrix23 *C)
 Matrix triple product involving symmetric matrices.
Gan_SquMatrix22 gan_symmat33_lrmultm23_s (const Gan_SquMatrix33 *A, const Gan_Matrix23 *B, Gan_Matrix23 *C)
 Matrix triple product involving symmetric matrices.
Gan_Matrix23 gan_mat23_lmultl22_s (const Gan_Matrix23 *A, const Gan_SquMatrix22 *B)
 Left-multiply a matrix by a lower-triangular matrix.
Gan_Matrix23 gan_mat23_lmultl22I_s (const Gan_Matrix23 *A, const Gan_SquMatrix22 *B)
 Left-multiply a matrix by the inverse of a lower-triangular matrix.
Gan_Matrix23 gan_mat23_lmultl22T_s (const Gan_Matrix23 *A, const Gan_SquMatrix22 *B)
 Left-multiply a matrix by the transpose of a lower-triangular matrix.
Gan_Matrix23 gan_mat23_lmultl22IT_s (const Gan_Matrix23 *A, const Gan_SquMatrix22 *B)
 Left-multiply a matrix by the inverse transpose of a lower-triangular matrix.
Gan_Matrix23 gan_mat23_rmultl33_s (const Gan_Matrix23 *A, const Gan_SquMatrix33 *B)
 Right-multiply a matrix by a lower-triangular matrix.
Gan_Matrix23 gan_mat23_rmultl33I_s (const Gan_Matrix23 *A, const Gan_SquMatrix33 *B)
 Right-multiply a matrix by the inverse of a lower-triangular matrix.
Gan_Matrix23 gan_mat23_rmultl33T_s (const Gan_Matrix23 *A, const Gan_SquMatrix33 *B)
 Right-multiply a matrix by the transpose of a lower-triangular matrix.
Gan_Matrix23 gan_mat23_rmultl33IT_s (const Gan_Matrix23 *A, const Gan_SquMatrix33 *B)
 Right-multiply a matrix by the inverse transpose of a lower-triangular matrix.
double gan_mat23_sumsqr_s (const Gan_Matrix23 *A)
 Returns sum of squares of matrix elements.
double gan_mat23_Fnorm_s (const Gan_Matrix23 *A)
 Frobenius norm of matrix.
Gan_Matrix23 gan_mat23_from_mat_s (const Gan_Matrix *A)
 Convert generic rectangular matrix to fixed size matrix structure.

Detailed Description

Module: 2x3 matrices (double precision)

Part of: Gandalf Library

Version:
1.17
Date:
2004/03/18 18:26:15
Author:
pm
Copyright: (c) 2000 Imagineer Software Limited
Generated on Fri Mar 17 12:44:48 2006 by  doxygen 1.3.9.1