GOBNILP
f164d83
|
Implements a Matrix Structure for floating point data and a set of matrix routines for scoring a Gaussian Network. More...
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <assert.h>
#include <lapacke.h>
#include "bge_matrix.h"
#include "bge_vector.h"
Functions | |
void | BgeMatrixAddition (Bge_Matrix *matrix_1, Bge_Matrix *matrix_2, Bge_Matrix *output_matrix) |
Adds two matrices together. More... | |
Bge_Matrix * | BgeMatrixCreate (int cols, int rows) |
Creates a new Matrix to be used by lapack routines. More... | |
void | BgeMatrixDelete (Bge_Matrix **matrix) |
Deletes a particular matrix and frees the memory allocated. More... | |
double | BgeMatrixLogDeterminant (Bge_Matrix *matrix) |
Computes the log determinant of a matrix (Only possible for square matrices) More... | |
void | BgeMatrixScalarMultipliciation (double scalar, Bge_Matrix *matrix) |
Multiples a given matrix be a scalar (Real number) More... | |
void | BgeMatrixSetPosteriorParentMatrix (Bge_Matrix *sub_posterior, Bge_Matrix *parent_posterior) |
Sets the posterior submatrix for a parent set of a node. More... | |
void | BgeMatrixSetPosteriorSubMatrix (unsigned int *family, int no_nodes, Bge_Matrix *posterior_matrix, Bge_Matrix *submatrix) |
Returns the Posterior matrix restricted to a family of a node. More... | |
void | BgeVectorOuterProduct (Bge_Vector *row_vector, Bge_Vector *col_vector, Bge_Matrix *output_matrix) |
Takes two vectors and computes their outer product. More... | |
Implements a Matrix Structure for floating point data and a set of matrix routines for scoring a Gaussian Network.
void BgeMatrixAddition | ( | Bge_Matrix * | matrix_1, |
Bge_Matrix * | matrix_2, | ||
Bge_Matrix * | output_matrix | ||
) |
Adds two matrices together.
matrix_1 | matrix to be added |
matrix_2 | matrix to be added |
Referenced by SetPosteriorParametricMatrix(), and SetSampleVariance().
Bge_Matrix* BgeMatrixCreate | ( | int | cols, |
int | rows | ||
) |
Creates a new Matrix to be used by lapack routines.
col_dimension | The number of columns of the matrix |
row_dimension | The number of rows of the matrix |
Referenced by lookup(), SetPosteriorParametricMatrix(), and SetSampleVariance().
void BgeMatrixDelete | ( | Bge_Matrix ** | matrix | ) |
Deletes a particular matrix and frees the memory allocated.
matrix | The matrix to be deleted |
Referenced by SetPosteriorParametricMatrix(), and SetSampleVariance().
double BgeMatrixLogDeterminant | ( | Bge_Matrix * | matrix | ) |
Computes the log determinant of a matrix (Only possible for square matrices)
Bge_Matrix** | The matrix for which the log determinant is to be calculated |
void BgeMatrixScalarMultipliciation | ( | double | scalar, |
Bge_Matrix * | matrix | ||
) |
Multiples a given matrix be a scalar (Real number)
scalar | Each item in the matrix is mulitlplied by this number |
Bge_Matrix* | The matrix that is to be multiplied by the scalar |
Referenced by SetPosteriorParametricMatrix().
void BgeMatrixSetPosteriorParentMatrix | ( | Bge_Matrix * | sub_posterior, |
Bge_Matrix * | parent_posterior | ||
) |
Sets the posterior submatrix for a parent set of a node.
Bge_Matrix* | the posterior matrix restricted to the node and its parents |
Bge_Matrix* | the posterior matrix restricted to the parents (output) |
void BgeMatrixSetPosteriorSubMatrix | ( | unsigned int * | family, |
int | no_nodes, | ||
Bge_Matrix * | posterior_matrix, | ||
Bge_Matrix * | submatrix | ||
) |
Returns the Posterior matrix restricted to a family of a node.
family | A set of nodes that contains a node and its parents |
no_nodes | The number of nodes in the family |
Bge_Matrix* | Posterior_matrix the posterior matrix |
Bge_Matrix* | Submatrix the posterior matrix restricted to the variables in the family set |
void BgeVectorOuterProduct | ( | Bge_Vector * | row_vector, |
Bge_Vector * | col_vector, | ||
Bge_Matrix * | output_matrix | ||
) |
Takes two vectors and computes their outer product.
row_vector | First vector |
col_vector | Second vector |
References Bge_Vector::capacity, and Bge_Vector::items.
Referenced by SetPosteriorParametricMatrix(), and SetSampleVariance().