GIRAFFE Pipeline Reference Manual

Matrix Utilities


Defines

#define PIX_STACK_SIZE   50

Functions

cxdouble giraffe_matrix_sigma_mean (const cpl_matrix *matrix, cxdouble mean)
 Compute sigma of matrix elements, with a given mean value.
cxdouble giraffe_matrix_sigma_fit (const cpl_matrix *matrix, const cpl_matrix *matrix_fit)
 Compute sigma of matrix fit.
cpl_image * giraffe_matrix_create_image (const cpl_matrix *matrix)
 Converts a matrix into an image.
cxint giraffe_matrix_sort (cpl_matrix *mA)
 Sort in place the matrix elements in ascending order.
cpl_matrix * giraffe_matrix_leastsq (const cpl_matrix *mA, const cpl_matrix *mB)
 Computes the solution of an equation using a pseudo-inverse.
cxint giraffe_matrix_clear (cpl_matrix *matrix)
 Set all elements of a matix to zero.
void giraffe_matrix_dump (const cpl_matrix *matrix, cxint max_rows)
 Output a maximum number of rows of the input matrix.

Detailed Description

TBD

Function Documentation

cxint giraffe_matrix_clear ( cpl_matrix *  matrix  ) 

Set all elements of a matix to zero.

Parameters:
matrix The matrix to update.
Returns:
The function returns 0 on success, or a non-zero value otherwise.
The function replaces the value of each matrix element of matrix with 0.

Definition at line 571 of file gimatrix.c.

cpl_image* giraffe_matrix_create_image ( const cpl_matrix *  matrix  ) 

Converts a matrix into an image.

Parameters:
matrix The matrix to convert.
Returns:
The newly image created from the matrix, or NULL if the image cannot be created.
The function converts a CPL matrix into a CPL image. The matrix elements are copied into the image pixel buffer.

Definition at line 344 of file gimatrix.c.

void giraffe_matrix_dump ( const cpl_matrix *  matrix,
cxint  max_rows 
)

Output a maximum number of rows of the input matrix.

Parameters:
matrix Matrix to print.
max_rows Maximum number of rows to print.
Returns:
Nothing.
Function prints part of a matrix. Printed are all columns, but only up to max_rows, number of rows. Each column has the column number printed as a header.

Note:
This function should be moved to CPL proper...

Definition at line 611 of file gimatrix.c.

Referenced by giraffe_slitgeometry_print(), and giraffe_wcalsolution_dump().

cpl_matrix* giraffe_matrix_leastsq ( const cpl_matrix *  mA,
const cpl_matrix *  mB 
)

Computes the solution of an equation using a pseudo-inverse.

Parameters:
mA left hand side [nr, nc] coefficients matrix.
mB right hand side [nr, nc] matrix of the equation.
Returns:
The function returns the solution vector as a [nr, 1] column matrix.
The function solves the linear system
   mX * mA = mB
for the unknown column matrix mX. The solution is given by the expression
   mX = mB * transpose(mA) * inverse(mA * transpose(mA))
The solution matrix is solving the equation according to a least-squares criterion. To destroy this matrix the function cpl_matrix_delete() should be used.

Note:
This function works properly only in the case all the elements of the input matrix do not contain garbage (such as NaN or infinity).

Definition at line 510 of file gimatrix.c.

cxdouble giraffe_matrix_sigma_fit ( const cpl_matrix *  matrix,
const cpl_matrix *  matrix_fit 
)

Compute sigma of matrix fit.

Parameters:
matrix Original matrix
matrix_fit Matrix to compare
Returns:
Sigma of fit
Function computes sigma of fit between two matrixes

Note:
This function may be moved to CPL

Definition at line 282 of file gimatrix.c.

cxdouble giraffe_matrix_sigma_mean ( const cpl_matrix *  matrix,
cxdouble  mean 
)

Compute sigma of matrix elements, with a given mean value.

Parameters:
matrix Input matrix
mean Value to be used as mean value during calculation
Returns:
Sigma of matrix
Function computes sigma of matrix elements, with a given mean value

Note:
This function might be moved to CPL.

Definition at line 236 of file gimatrix.c.

cxint giraffe_matrix_sort ( cpl_matrix *  mA  ) 

Sort in place the matrix elements in ascending order.

Parameters:
mA The matrix to sort.
Returns:
0 on success, -1 on failure
The input matrix mA is sorted in place. On the successfull return the matrix mA contains the original values sorted in ascending order.

Definition at line 387 of file gimatrix.c.

References PIX_STACK_SIZE.


This file is part of the GIRAFFE Pipeline Reference Manual 2.8.
Documentation copyright © 2002-2006 European Southern Observatory.
Generated on Tue Jun 2 07:15:36 2009 by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2004