matrix module
1.00.00
www.protokollkonverter.de
|
Functions | |
VECTOR | vectorNew (const size_t dimension) |
create a new column vector More... | |
void | vectorDelete (VECTOR *v) |
free memory allocated by vectorNew More... | |
bool | vectorGetDimension (VECTOR v, size_t *dimension) |
get dimension of vector More... | |
bool | vectorEquals (VECTOR v, VECTOR w) |
compare two vectors More... | |
bool | vectorSetElement (VECTOR v, const size_t row, MATRIX_VALUE value) |
set one element in vector More... | |
bool | vectorGetElement (VECTOR v, const size_t row, MATRIX_VALUE *value) |
get one element in vector More... | |
bool | vectorSet (VECTOR v, const MATRIX_VALUE values[], const size_t valuesCount) |
set all values of vector More... | |
bool | vectorGet (VECTOR v, MATRIX_VALUE values[], size_t *valuesCount) |
get all values of vector More... | |
VECTOR | vectorAddition (VECTOR v, VECTOR w) |
add two vectors More... | |
VECTOR | vectorSubstraction (VECTOR v, VECTOR w) |
subtract a vector More... | |
VECTOR | vectorMultiplicationScalar (VECTOR v, MATRIX_VALUE scalar) |
multiply a vector with scalar More... | |
bool | vectorDotProduct (VECTOR v, VECTOR w, MATRIX_VALUE *product) |
dot product of two vectors More... | |
VECTOR | vectorCrossProduct (VECTOR v, VECTOR w) |
cross product of two vectors More... | |
bool | vectorScalarTripleProduct (VECTOR v, VECTOR w, VECTOR x, MATRIX_VALUE *product) |
scalar triple product of three vectors More... | |
MATRIX | vectorOuterProduct (VECTOR v, VECTOR w) |
outer product of two vectors More... | |
bool | vectorLength (VECTOR v, MATRIX_VALUE *length) |
calculate length of vector More... | |
VECTOR | vectorClone (VECTOR v) |
clone a vector More... | |
Variables | |
static const size_t | index_a [VECTOR_STANDARD_DIMENSION] = {1, 2, 0} |
static const size_t | index_b [VECTOR_STANDARD_DIMENSION] = {2, 0, 1} |
VECTOR vectorNew | ( | const size_t | dimension | ) |
create a new column vector
Function allocates memory for a new vector of given dimension. All elements are set to 0.
[in] | dimension | rows of vector to create |
void vectorDelete | ( | VECTOR * | v | ) |
free memory allocated by vectorNew
Function frees memory of vector created by vectorNew. The vector pointer v will be set to NULL.
[in,out] | v | pointer to vector do delete |
bool vectorGetDimension | ( | VECTOR | v, |
size_t * | dimension | ||
) |
get dimension of vector
Function sets dimension of vector in parameter dimension.
[out] | dimension | address of variable dimension to insert count of rows of vector |
compare two vectors
Function compares dimensions and values of two vectors.
[in] | v | vector 1 to compare |
[in] | w | vector 2 to compare |
bool vectorSetElement | ( | VECTOR | v, |
const size_t | row, | ||
MATRIX_VALUE | value | ||
) |
set one element in vector
Function sets the value of one element in vector. Rows are count from 0..(dimension of vector - 1).
[in] | v | vector to set value in |
[in] | row | row of element |
[in] | value | value to set to element |
bool vectorGetElement | ( | VECTOR | v, |
const size_t | row, | ||
MATRIX_VALUE * | value | ||
) |
get one element in vector
Function gets the value of one element in vector. Rows are count from 0..(dimension of vector - 1).
[in] | v | vector to get value from |
[in] | row | row of element |
[out] | value | pointer to value to set value to element in |
bool vectorSet | ( | VECTOR | v, |
const MATRIX_VALUE | values[], | ||
const size_t | valuesCount | ||
) |
set all values of vector
Function sets all values of vectors.
[in] | v | vector to set values in |
[in] | values | values to set to element |
[in] | valuesCount | count of values in array |
bool vectorGet | ( | VECTOR | v, |
MATRIX_VALUE | values[], | ||
size_t * | valuesCount | ||
) |
get all values of vector
Function gets all values of vectors.
[in] | v | vector to get values from |
[out] | values | pointer to values to set values in |
[in,out] | valuesCount | count of values in array contains afterwards count of copied values |
add two vectors
Function adds two vectors.
[in] | v | vector 1 to add |
[in] | w | vector 2 to add |
subtract a vector
Function subtract a vector from another vector \(\vec y = \vec v - \vec w\).
[in] | v | vector to subtract from |
[in] | w | vector to subtract |
VECTOR vectorMultiplicationScalar | ( | VECTOR | v, |
MATRIX_VALUE | scalar | ||
) |
multiply a vector with scalar
Function multiplies a vector with scalar value \(\vec y = \vec v * scalar\).
[in] | v | vector to multiply |
[in] | scalar | value to multiply vector with |
bool vectorDotProduct | ( | VECTOR | v, |
VECTOR | w, | ||
MATRIX_VALUE * | product | ||
) |
dot product of two vectors
Function multiplies two vectors to get dot product as scalar \(product = \vec v \cdot \vec w\).
[in] | v | vector to multiply |
[in] | w | vector to multiply |
[out] | product | result value of dot multiplication |
cross product of two vectors
Function multiplies two vectors to get cross product vector \(\vec y = \vec v \times \vec w \).
[in] | v | vector to multiply |
[in] | w | vector to multiply |
bool vectorScalarTripleProduct | ( | VECTOR | v, |
VECTOR | w, | ||
VECTOR | x, | ||
MATRIX_VALUE * | product | ||
) |
scalar triple product of three vectors
Function multiplies three vectors to get the scalar triple product \(product = (\vec v \times \vec w) \cdot \vec x \).
[in] | v | vector to multiply |
[in] | w | vector to multiply |
[in] | x | vector to multiply |
[out] | product | result value of multiplication |
outer product of two vectors
Function multiplies two vectors to get outer product matrix \(A = \vec v \otimes \vec w \).
[in] | v | vector to multiply |
[in] | w | vector to multiply |
bool vectorLength | ( | VECTOR | v, |
MATRIX_VALUE * | length | ||
) |
calculate length of vector
Function calculates length of vector by \(\sqrt{a_{0}^{2} + a_{1}^{2} + ... + a_{(rows-1)}^{2}}\)
[in] | v | vector to multiply |
[in] | w | vector to multiply |
clone a vector
Function clones a vector.
Function creates a new vector with the same dimension and values like given vector.
[in] | v | vector to clone |
|
static |
|
static |