enum matrixOrder |
enum MatrixType |
Calculate A + lambda * B = C
[in] | A | A matrix. |
[in] | B | A matrix. |
[in] | lambda | A scalar value. |
[in,out] | C | The result matrix. |
Calculate by solving BF = V for F then solving system of linear equations k times where k is the number of columns in V.
[in] | B | A matrix. |
[in] | V | A matrix. |
Cholesky factorization of a symmetric, positive, definite matrix.
[in] | m | is a matrix to factor. |
Take the complex conjugate of a matrix. Returns a new matrix.
[in] | m | Take complex conjugate of this matrix. |
Convert a real matrix to a complex matrix.
[in] | m | A real matrix. |
Convert a complex matrix to a real matrix. If the imaginary part of the complex matrix elements is nearly zero, the conversion proceeds. Otherwise, an error is thrown.
[in] | m | A complex matrix. |
Expand a compact representation of a diagonal matrix.
[in] | v | A vector containing the diagonal elements of a matrix. |
fftwReverse Performs an inverse Fourier transform using the Fasted Fourier Transform in the West (FFTW) library.
[in] | function | A MATRIX object which contains data values for a function to transform. |
[in] | shift | A boolean value whether to shift the data values. TRUE means shift the values. FALSE means no shift. |
void freeMatrix | ( | MATRIX | m | ) |
Free memory that stores matrix data. The matrix structure is not released.
[in] | m | matrix with data to free. |
void freeVector | ( | VECTOR | v | ) |
Free memory that stores vector data. The vector structure is not released.
[in] | v | Vector with data to free. |
void insertVector | ( | double * | to, | |
VECTOR | from | |||
) |
Insert a vector into an array.
[in,out] | to | An array. |
[in] | from | A vector of data to insert. |
Inverse of a general matrix.
[in] | m | A matrix. |
Inverse of a diagonal matrix is 1/aii, where aii are the diagonal elements
[in] | m | A diagonal matrix. |
Solve Ax=B for x.
[in] | A | Matrix |
[in] | B | Matrix |
void linearEqSolveCleanup | ( | ) |
Free memory allocated for LUDecomp and IPiv intermediate values.
Using this function requires first calling linearEqSolve to calculate the LUDecomp of Matrix A. Solves set of linear equations with multiple right-hand sides, i.e. the number of columns of matrix B.
[in] | A | Matrix |
[in] | B | Matrix |
Return a copy of a matrix. Returns a new matrix.
[in] | m | A matrix. |
Same as above except, by changing nrhs to the number of columns in v, we can use this to solve many systems of linear equations or invert a matrix. Solves A * X = B for X
[in] | A | Matrix |
[in] | B | Matrix |
Convert a matrix where one dimension is unity to a vector.
[in] | m | A matrix with either 1 row or 1 column. |
Build a complex matrix from separate real and imaginary parts.
[in,out] | m | A complex matrix. |
[in] | real | A matrix containing real part. |
[in] | imag | A matrix containing imaginary part. |
Multiply two matrices and return a new matrix containing the product of AB. data.
[in] | TransA | Letter 'N', 'T', or 'C', for no transpose, transpose, and conjugate transpose. |
[in] | TransB | Letter 'N', 'T', or 'C', for no transpose, transpose, and conjugate transpose. |
[in] | A | Matrix A |
[in] | B | Matrix B |
Multiply two matrices and return a new matrix containing the product of AB. data.
[in] | TransA | Letter 'N', 'T', or 'C', for no transpose, transpose, and conjugate transpose. |
[in] | TransB | Letter 'N', 'T', or 'C', for no transpose, transpose, and conjugate transpose. |
[in] | A | Matrix A |
[in] | B | Matrix B |
Multiply two matrices and return a new matrix containing the product of AB. data. C = alpha A x B + beta C
[in] | TransA | Letter 'N', 'T', or 'C', for no transpose, transpose, and conjugate transpose. |
[in] | TransB | Letter 'N', 'T', or 'C', for no transpose, transpose, and conjugate transpose. |
[in] | alpha | Multiply matrix A by scalar alpha. |
[in] | beta | Multiply matrix C by scalar beta. |
[in] | A | Matrix A |
[in] | B | Matrix B |
multiply matrix by a scalar value
[in] | m | A Matrix. |
[in] | scalar | A single value. |
multiply matrix by a scalar value
[in] | m | A Matrix. |
[in] | scalar | A single value. |
MATRIX newComplexMatrix | ( | int | r, | |
int | c | |||
) |
Creates a new matrix of double complex values and allocates space for data.
[in] | r | The number of rows |
[in] | c | The number of columns |
MATRIX newMatrix | ( | int | r, | |
int | c | |||
) |
Creates a new matrix and allocates space for the data of type double
[in] | r | number of rows |
[in] | c | number of columns |
MATRIX newMatrixI | ( | int | r, | |
int | c, | |||
double * | Idata | |||
) |
Creates a new matrix and initializes the data to array sent
[in] | r | number of rows |
[in] | c | number of columns |
[in] | Idata | point to initial data values |
MATRIX newRandomMatrix | ( | int | r, | |
int | c | |||
) |
Creates a new matrix of random numbers and allocates space for the data of type double complex. NOTE: the seed for the random number generator is set separately.
[in] | r | number of rows |
[in] | c | number of columns |
VECTOR newVector | ( | int | n | ) |
double complex Norm2 | ( | MATRIX | m | ) |
Calculate the ||M||_2 of a matrix, M.
[in] | m | A matrix. |
void print_matrix | ( | char * | desc, | |
int | m, | |||
int | n, | |||
double * | a, | |||
int | lda, | |||
enum matrixOrder | order | |||
) |
Print a matrix.
[in] | desc | A description or name of the matrix. |
[in] | m | The number of rows in the matrix. |
[in] | n | The number of columns in the matrix. |
[in] | a | An array of the data in the matrix. |
[in] | lda | Leading dimension of the matrix. |
[in] | order | Layout of the matrix data, either row-major or column-major. |
void print_matrix2 | ( | char * | desc, | |
MATRIX | m, | |||
enum matrixOrder | order | |||
) |
Print a matrix.
[in] | desc | A description or name of the matrix. |
[in] | m | A matrix. |
[in] | order | Layout of the matrix data, either row-major or column-major. |
void print_matrix2toFile | ( | char * | desc, | |
MATRIX | m, | |||
enum matrixOrder | order | |||
) |
Print a matrix to a file.
[in] | desc | A description or name of the matrix. This is also the name of the file. |
[in] | m | A matrix. |
[in] | order | Layout of the matrix data, either row-major or column-major. |
VECTOR readText | ( | char * | inputFilename | ) |
Read a vector from a file Format of the file can be eol, tab, comma, space, separated list of numbers
[in] | inputFilename | Name of file to read. |
void setToNaN | ( | VECTOR | v | ) |
Set a vector to NaN.
[in,out] | v | A vector. |
void setToNaNMatrix | ( | MATRIX | m | ) |
Set a matrix to NaN.
[in,out] | m | A matrix. |
Split a complex matrix into real and imaginary parts.
[in] | m | A complex matrix. |
[in,out] | real | A matrix containing real part. |
[in,out] | imag | A matrix containing imaginary part. |
void tdCleanup | ( | ) |
free memory used by static variables internal to inversion
void tdinvert1dFinish | ( | double | lambda, | |
int | nStep, | |||
Model * | model, | |||
BOOLEAN | debug, | |||
BaseDirectory * | debugFilename | |||
) |
Completes the inversion calculation. By sending the individual lambda values the inversion calculation is finished.
[in] | lambda | regularization parameter |
[in] | nStep | Nth step in lambda-parameter range |
[in] | debug | Flag to print intermediate matrices during inversion |
[in] | debugFilename | Base directory and filename for intermediate, debug values. |
[in,out] | model | Model structure contains all calculated solutions including averaging kernel and error covariance. |
void tdinvert3dFinish | ( | double | lambda, | |
TempData * | tempData, | |||
BOOLEAN | debug, | |||
BaseDirectory * | debugFilename | |||
) |
Completes the inversion calculation. By sending the individual lambda values the inversion calculation is finished.
[in] | lambda | regularization parameter |
[in] | debug | Flag to print intermediate matrices during inversion |
[in] | debugFilename | Base directory and filename for intermediate, debug values. |
[in,out] | tempData | TempData structure contains all calculated solutions including averaging kernel and error covariance for one wave number. |
tdSetup calculates all the non-changing, static matrices
[in] | aM | Kernel matrix |
[in] | ad | map data |
[in] | aR | Regularization matrix; symmetric positive-definite matrix |
[in] | aCI | Inverse of matrix C, a noise covariance matrix |
[in] | aC | matrix C, a noise covariance matrix |
double* toColumnMajor | ( | double * | AT, | |
int | R, | |||
int | C | |||
) |
Copy a 2D array in row-major layout return the copy in column-major layout.
[in] | AT | The array of data in row-major layout. |
[in] | R | The number of rows. |
[in] | C | The number of columns. |
Copy a matrix stored in row-major order and convert it to column-major order.
[in] | m | A row-major matrix |
end ORIGINAL Attempt to generalize matrix multiplication and make this really a facade for the lapack library dgemm and zgemm Convert a fits2d object to a Matrix object.
[in] | f | A fits2d object; i.e. a 2-d array with different member names and always data of type double. |
double* toRowMajor | ( | double * | A, | |
int | R, | |||
int | C | |||
) |
Copy a 2D array in column-major layout return the copy in row-major layout.
[in] | A | The array of data in column-major layout. |
[in] | R | The number of rows. |
[in] | C | The number of columns. |
Copy a matrix stored in column-major order and convert it to row-major order.
[in] | m | A column-major matrix |
Transpose a matrix.
[in] | m | A matrix. |