GOBNILP  f164d83
Functions
bge_vector.c File Reference

Defines a data structure that represents a vector with values of type double, as well as defining some vector operations. More...

#include <stdio.h>
#include <stdlib.h>
#include "bge_vector.h"
Include dependency graph for bge_vector.c:

Functions

Bge_VectorBgeVectorCreate (int capacity)
 Creates a vector with a given capacity. More...
 
void BgeVectorDelete (Bge_Vector **vec)
 Deallocates the memory associated with a vector. More...
 
double BgeVectorDotProduct (Bge_Vector *vec_1, Bge_Vector *vec_2)
 Computes the dot product between two vectors. More...
 
void BgeVectorScalarMultiplication (double scalar, Bge_Vector *vec)
 Performs The scalar multiplication operation for a vector. More...
 
void BgeVectorSubtraction (Bge_Vector *vec_1, Bge_Vector *vec_2, Bge_Vector *output_vec)
 Performs the vector subtraction operation. More...
 

Detailed Description

Defines a data structure that represents a vector with values of type double, as well as defining some vector operations.

Function Documentation

◆ BgeVectorCreate()

Bge_Vector* BgeVectorCreate ( int  capacity)

Creates a vector with a given capacity.

Parameters
capacityThe maximum capacity of the vector.
Returns
An empty vector.

References Bge_Vector::capacity, and Bge_Vector::items.

Referenced by SetPosteriorParametricMatrix(), and SetSampleVariance().

◆ BgeVectorDelete()

void BgeVectorDelete ( Bge_Vector **  vec)

Deallocates the memory associated with a vector.

Parameters
vecThe vector to free.

Referenced by SetPosteriorParametricMatrix(), and SetSampleVariance().

◆ BgeVectorDotProduct()

double BgeVectorDotProduct ( Bge_Vector vec_1,
Bge_Vector vec_2 
)

Computes the dot product between two vectors.

Parameters
vec_1first input vector
vec_2second input vector
Returns
output result of computing the dot product between vec_1 and vec_2

References Bge_Vector::capacity, and Bge_Vector::items.

◆ BgeVectorScalarMultiplication()

void BgeVectorScalarMultiplication ( double  scalar,
Bge_Vector vec 
)

Performs The scalar multiplication operation for a vector.

Parameters
scalarThat the vector is multiplied by
vecThe input/output vector that is multiplied by the scalar

References Bge_Vector::capacity, and Bge_Vector::items.

◆ BgeVectorSubtraction()

void BgeVectorSubtraction ( Bge_Vector vec_1,
Bge_Vector vec_2,
Bge_Vector output_vec 
)

Performs the vector subtraction operation.

Parameters
vec_1Input vector that has is being subtracted from
vec_2Input vector that is subtracted
output_vecThe result of the subtraction

References Bge_Vector::capacity, and Bge_Vector::items.

Referenced by SetSampleVariance().