View lcov test coverage results on http://www.ufoot.org/liquidwar/v6/doc/coverage/src/lib/mat/index.html.
dmat2: the matrix to initialize.
Fills the matrix with zeros, regardless of what was there before. Internally, does a memset the only advantage is that this function should use the right sizeof and therefore avoids typo errors.
Return value: none.
dmat2: the matrix to initialize.
Loads the matrix with the identity matrix, that is, zero everywhere but one on the main diag.
Return value: none.
dmat2_a: 1st matrix to compare
dmat2_b: 2nd matrix to compare
Compares two matrix, returns true if they are equal.
Return value: 1 if equal, 0 if different.
dmat2: the matrix to transpose
Transposes the matrix, that is, inverts rows and columns.
Return value: none.
dmat2: the matrix used to calculate the determinant
Calulates the determinant of the matrix.
Return value: the determinant.
dmat2: matrix to modify
f: scale factor
Scales the matrix by multiplying all its members by a scalar value.
Return value: none
dmat2_dst: the matrix inverted
dmat2_src: the matrix to invert
Inverts a matrix. Probably not the fastest implementation, but should work in all cases. Use hardware accelerated API such as OpenGL on dedicated hardware if you want power.
Return value: 1 if inverted, 0 if error, typically if determinant was 0, matrix can not be inverted.
dmat2: the result matrix
dmat2_a: the 1st matrix to multiply, on the left
dmat2_b: the 2nd matrix to multiply, on the right
Classic matrix multiplication.
Return value: none.
dvec2_dst: the result vector
dvec2_src: the source vector
Multiplication of matrix by vector. The result is a vector, the convention used is that of OpenGL, matrix are column major and vector are columns, that is, should you do it on a paper, vector is placed vertically, on the right of matrix. The other multiplication is not implemented, transposing the matrix will do it the other way if you wish.
Return value: none.
Gives a readable version of the matrix, the representation uses newlines, with a different line for each row
Return value: newly allocated string
dmat3: the matrix to initialize.
Fills the matrix with zeros, regardless of what was there before. Internally, does a memset the only advantage is that this function should use the right sizeof and therefore avoids typo errors.
Return value: none.
dmat3: the matrix to initialize.
Loads the matrix with the identity matrix, that is, zero everywhere but one on the main diag.
Return value: none.
dmat3_a: 1st matrix to compare
dmat3_b: 2nd matrix to compare
Compares two matrix, returns true if they are equal.
Return value: 1 if equal, 0 if different.
dmat3: the matrix to transpose
Transposes the matrix, that is, inverts rows and columns.
Return value: none.
dmat3: the matrix used to calculate the determinant
Calulates the determinant of the matrix.
Return value: the determinant.
dmat3: matrix to modify
f: scale factor
Scales the matrix by multiplying all its members by a scalar value.
Return value: none
dmat3_dst: the matrix inverted
dmat3_src: the matrix to invert
Inverts a matrix. Probably not the fastest implementation, but should work in all cases. Use hardware accelerated API such as OpenGL on dedicated hardware if you want power.
Return value: 1 if inverted, 0 if error, typically if determinant was 0, matrix can not be inverted.
dmat3: the result matrix
dmat3_a: the 1st matrix to multiply, on the left
dmat3_b: the 2nd matrix to multiply, on the right
Classic matrix multiplication.
Return value: none.
dvec3_dst: the result vector
dvec3_src: the source vector
Multiplication of matrix by vector. The result is a vector, the convention used is that of OpenGL, matrix are column major and vector are columns, that is, should you do it on a paper, vector is placed vertically, on the right of matrix. The other multiplication is not implemented, transposing the matrix will do it the other way if you wish.
Return value: none.
dvec2_dst: the result vector
Multiplication of matrix by vector. The result is a vector, the convention used is that of OpenGL, matrix are column major and vector are columns, that is, should you do it on a paper, vector is placed vertically, on the right of matrix. The other multiplication is not implemented, transposing the matrix will do it the other way if you wish. The vector, here, is smaller than the matrix, the last element is supposed to be 1, this is how one implements translation through multiplication.
Return value: none.
Gives a readable version of the matrix, the representation uses newlines, with a different line for each row
Return value: newly allocated string
dmat4: the matrix to initialize.
Fills the matrix with zeros, regardless of what was there before. Internally, does a memset the only advantage is that this function should use the right sizeof and therefore avoids typo errors.
Return value: none.
dmat4: the matrix to initialize.
Loads the matrix with the identity matrix, that is, zero everywhere but one on the main diag.
Return value: none.
dmat4_a: 1st matrix to compare
dmat4_b: 2nd matrix to compare
Compares two matrix, returns true if they are equal.
Return value: 1 if equal, 0 if different.
dmat4: the matrix to transpose
Transposes the matrix, that is, inverts rows and columns.
Return value: none.
dmat4: the matrix used to calculate the determinant
Calulates the determinant of the matrix.
Return value: the determinant.
dmat4: matrix to modify
f: scale factor
Scales the matrix by multiplying all its members by a scalar value.
Return value: none
dmat4_dst: the matrix inverted
dmat4_src: the matrix to invert
Inverts a matrix. Probably not the fastest implementation, but should work in all cases. Use hardware accelerated API such as OpenGL on dedicated hardware if you want power.
Return value: 1 if inverted, 0 if error, typically if determinant was 0, matrix can not be inverted.
dmat4: the result matrix
dmat4_a: the 1st matrix to multiply, on the left
dmat4_b: the 2nd matrix to multiply, on the right
Classic matrix multiplication.
Return value: none.
dvec4_dst: the result vector
dmat4: the matrix to use
dvec4_src: the source vector
Multiplication of matrix by vector. The result is a vector, the convention used is that of OpenGL, matrix are column major and vector are columns, that is, should you do it on a paper, vector is placed vertically, on the right of matrix. The other multiplication is not implemented, transposing the matrix will do it the other way if you wish.
Return value: none.
dvec3_dst: the result vector
dmat4: the matrix to use
dvec3_src: the source vector
Multiplication of matrix by vector. The result is a vector, the convention used is that of OpenGL, matrix are column major and vector are columns, that is, should you do it on a paper, vector is placed vertically, on the right of matrix. The other multiplication is not implemented, transposing the matrix will do it the other way if you wish. The vector, here, is smaller than the matrix, the last element is supposed to be 1, this is how one implements translation through multiplication.
Return value: none.
Gives a readable version of the matrix, the representation uses newlines, with a different line for each row
Return value: newly allocated string
dvec2: the vector to initialize.
Fills the vector with zeros, regardless of what was there before. Internally, does a memset the only advantage is that this function should use the right sizeof and therefore avoids typo errors.
Return value: none.
dvec2_a: 1st vector to compare
dvec2_b: 2nd vector to compare
Compares two vectors, returns true if they are equal.
Return value: 1 if equal, 0 if different.
dvec2: the vector to query.
Returns the square of a vector length. To get the real length one should then apply a square root but at this stage one has at least an idea about vector length, and this information is enough to compare them.
Return value: sigma(coord*coord)
dvec2: the vector to query.
Returns the size/length of a vector, this is the distance of the point from origin, not the number of elements.
Return value: the length of the vector.
dvec2: the vector to normalize.
Normalizes a vector, that is, make its length be 1.
Return value: 1 if OK, 0 if error, such as trying to normalize vector zero.
dvec2: vector to modify
Calcs the opposite vector, by making a negation on all its members
Return value: none
dvec2: result vector
dvec2_a: 1st vector to add
dvec2_b: 2nd vector to add
Adds two vectors.
Return value: none
dvec2: result vector
dvec2_a: 1st vector
dvec2_b: 2nd vector, will be substracted to 1st vector
Substracts vector b from vector a.
Return value: none
dvec2_a: 1st vector
dvec2_b: 2nd vector
Calculates the dot AKA scalar product of the two vectors.
Return value: none
dvec3: result vector
dvec2_a: 1st vector
dvec2_b: 2nd vector
Calculates the cross AKA vectorial product of the two vectors. Since cross product only really makes sense in 3D, this function will interpret the 2D vectors as 3D vectors with z set t zero, that is, a vector in the xy plane.
Return value: none
dvec2: vector to modify
f: scale factor
Scales the vector by multiplying all its members by a scalar value.
Return value: none
dmat2: result matrix
dvec2_a: 1st row vector
dvec2_b: 2nd column vector
Multiplication of a row vector by a column vector to give a matrix.
Return value: none
Gives a readable version of the vector
Return value: newly allocated string
dvec3: the vector to initialize.
Fills the vector with zeros, regardless of what was there before. Internally, does a memset the only advantage is that this function should use the right sizeof and therefore avoids typo errors.
Return value: none.
dvec3_a: 1st vector to compare
dvec3_b: 2nd vector to compare
Compares two vectors, returns true if they are equal.
Return value: 1 if equal, 0 if different.
dvec3: the vector to query.
Returns the square of a vector length. To get the real length one should then apply a square root but at this stage one has at least an idea about vector length, and this information is enough to compare them.
Return value: sigma(coord*coord)
dvec3: the vector to query.
Returns the size/length of a vector, this is the distance of the point from origin, not the number of elements.
Return value: the length of the vector.
dvec3: the vector to normalize.
Normalizes a vector, that is, make its length be 1.
Return value: 1 if OK, 0 if error, such as trying to normalize vector zero.
dvec3: vector to modify
Calcs the opposite vector, by making a negation on all its members
Return value: none
dvec3: result vector
dvec3_a: 1st vector to add
dvec3_b: 2nd vector to add
Adds two vectors.
Return value: none
dvec3: result vector
dvec3_a: 1st vector
dvec3_b: 2nd vector, will be substracted to 1st vector
Substracts vector b from vector a.
Return value: none
dvec3_a: 1st vector
dvec3_b: 2nd vector
Calculates the dot AKA scalar product of the two vectors.
Return value: none
dvec3: result vector
dvec3_a: 1st vector
dvec3_b: 2nd vector
Calculates the cross AKA vectorial product of the two vectors.
Return value: none
dvec3: vector to modify
f: scale factor
Scales the vector by multiplying all its members by a scalar value.
Return value: none
dmat3: result matrix
dvec3_a: 1st row vector
dvec3_b: 3nd column vector
Multiplication of a row vector by a column vector to give a matrix.
Return value: none
Gives a readable version of the vector
Return value: newly allocated string
dvec4: the vector to initialize.
Fills the vector with zeros, regardless of what was there before. Internally, does a memset the only advantage is that this function should use the right sizeof and therefore avoids typo errors.
Return value: none.
dvec4_a: 1st vector to compare
dvec4_b: 2nd vector to compare
Compares two vectors, returns true if they are equal.
Return value: 1 if equal, 0 if different.
dvec4: the vector to query.
Returns the square of a vector length. To get the real length one should then apply a square root but at this stage one has at least an idea about vector length, and this information is enough to compare them.
Return value: sigma(coord*coord)
dvec4: the vector to query.
Returns the size/length of a vector, this is the distance of the point from origin, not the number of elements.
Return value: the length of the vector.
dvec4: the vector to normalize.
Normalizes a vector, that is, make its length be 1.
Return value: 1 if OK, 0 if error, such as trying to normalize vector zero.
dvec4: vector to modify
Calcs the opposite vector, by making a negation on all its members
Return value: none
dvec4: result vector
dvec4_a: 1st vector to add
dvec4_b: 2nd vector to add
Adds two vectors.
Return value: none
dvec4: result vector
dvec4_a: 1st vector
dvec4_b: 2nd vector, will be substracted to 1st vector
Substracts vector b from vector a.
Return value: none
dvec4_a: 1st vector
dvec4_b: 2nd vector
Calculates the dot AKA scalar product of the two vectors.
Return value: none
dvec3: result vector
dvec4_a: 1st vector
dvec4_b: 2nd vector
Calculates the cross AKA vectorial product of the two vectors. Since cross product only really makes sense in 3D, this function will interpret the 4D vectors as 3D vectors only, ignoring the last value.
Return value: none
dvec4: vector to modify
f: scale factor
Scales the vector by multiplying all its members by a scalar value.
Return value: none
dmat4: result matrix
dvec4_a: 1st row vector
dvec4_b: 4nd column vector
Multiplication of a row vector by a column vector to give a matrix.
Return value: none
Gives a readable version of the vector
Return value: newly allocated string
fmat2: the matrix to initialize.
Fills the matrix with zeros, regardless of what was there before. Internally, does a memset the only advantage is that this function should use the right sizeof and therefore avoids typo errors.
Return value: none.
fmat2: the matrix to initialize.
Loads the matrix with the identity matrix, that is, zero everywhere but one on the main diag.
Return value: none.
fmat2_a: 1st matrix to compare
fmat2_b: 2nd matrix to compare
Compares two matrix, returns true if they are equal.
Return value: 1 if equal, 0 if different.
fmat2: the matrix to transpose
Transposes the matrix, that is, inverts rows and columns.
Return value: none.
fmat2: the matrix used to calculate the determinant
Calulates the determinant of the matrix.
Return value: the determinant.
fmat2: matrix to modify
f: scale factor
Scales the matrix by multiplying all its members by a scalar value.
Return value: none
fmat2_dst: the matrix inverted
fmat2_src: the matrix to invert
Inverts a matrix. Probably not the fastest implementation, but should work in all cases. Use hardware accelerated API such as OpenGL on dedicated hardware if you want power.
Return value: 1 if inverted, 0 if error, typically if determinant was 0, matrix can not be inverted.
fmat2: the result matrix
fmat2_a: the 1st matrix to multiply, on the left
fmat2_b: the 2nd matrix to multiply, on the right
Classic matrix multiplication.
Return value: none.
fvec2_dst: the result vector
fvec2_src: the source vector
Multiplication of matrix by vector. The result is a vector, the convention used is that of OpenGL, matrix are column major and vector are columns, that is, should you do it on a paper, vector is placed vertically, on the right of matrix. The other multiplication is not implemented, transposing the matrix will do it the other way if you wish.
Return value: none.
Gives a readable version of the matrix, the representation uses newlines, with a different line for each row
Return value: newly allocated string
fmat3: the matrix to initialize.
Fills the matrix with zeros, regardless of what was there before. Internally, does a memset the only advantage is that this function should use the right sizeof and therefore avoids typo errors.
Return value: none.
fmat3: the matrix to initialize.
Loads the matrix with the identity matrix, that is, zero everywhere but one on the main diag.
Return value: none.
fmat3_a: 1st matrix to compare
fmat3_b: 2nd matrix to compare
Compares two matrix, returns true if they are equal.
Return value: 1 if equal, 0 if different.
fmat3: the matrix to transpose
Transposes the matrix, that is, inverts rows and columns.
Return value: none.
fmat3: the matrix used to calculate the determinant
Calulates the determinant of the matrix.
Return value: the determinant.
fmat3: matrix to modify
f: scale factor
Scales the matrix by multiplying all its members by a scalar value.
Return value: none
fmat3_dst: the matrix inverted
fmat3_src: the matrix to invert
Inverts a matrix. Probably not the fastest implementation, but should work in all cases. Use hardware accelerated API such as OpenGL on dedicated hardware if you want power.
Return value: 1 if inverted, 0 if error, typically if determinant was 0, matrix can not be inverted.
fmat3: the result matrix
fmat3_a: the 1st matrix to multiply, on the left
fmat3_b: the 2nd matrix to multiply, on the right
Classic matrix multiplication.
Return value: none.
fvec3_dst: the result vector
fvec3_src: the source vector
Multiplication of matrix by vector. The result is a vector, the convention used is that of OpenGL, matrix are column major and vector are columns, that is, should you do it on a paper, vector is placed vertically, on the right of matrix. The other multiplication is not implemented, transposing the matrix will do it the other way if you wish.
Return value: none.
fvec2_dst: the result vector
Multiplication of matrix by vector. The result is a vector, the convention used is that of OpenGL, matrix are column major and vector are columns, that is, should you do it on a paper, vector is placed vertically, on the right of matrix. The other multiplication is not implemented, transposing the matrix will do it the other way if you wish. The vector, here, is smaller than the matrix, the last element is supposed to be 1, this is how one implements translation through multiplication.
Return value: none.
Gives a readable version of the matrix, the representation uses newlines, with a different line for each row
Return value: newly allocated string
fmat4: the matrix to initialize.
Fills the matrix with zeros, regardless of what was there before. Internally, does a memset the only advantage is that this function should use the right sizeof and therefore avoids typo errors.
Return value: none.
fmat4: the matrix to initialize.
Loads the matrix with the identity matrix, that is, zero everywhere but one on the main diag.
Return value: none.
fmat4_a: 1st matrix to compare
fmat4_b: 2nd matrix to compare
Compares two matrix, returns true if they are equal.
Return value: 1 if equal, 0 if different.
fmat4: the matrix to transpose
Transposes the matrix, that is, inverts rows and columns.
Return value: none.
fmat4: the matrix used to calculate the determinant
Calulates the determinant of the matrix.
Return value: the determinant.
fmat4: matrix to modify
f: scale factor
Scales the matrix by multiplying all its members by a scalar value.
Return value: none
fmat4_dst: the matrix inverted
fmat4_src: the matrix to invert
Inverts a matrix. Probably not the fastest implementation, but should work in all cases. Use hardware accelerated API such as OpenGL on dedicated hardware if you want power.
Return value: 1 if inverted, 0 if error, typically if determinant was 0, matrix can not be inverted.
fmat4: the result matrix
fmat4_a: the 1st matrix to multiply, on the left
fmat4_b: the 2nd matrix to multiply, on the right
Classic matrix multiplication.
Return value: none.
fvec4_dst: the result vector
fmat4: the matrix to use
fvec4_src: the source vector
Multiplication of matrix by vector. The result is a vector, the convention used is that of OpenGL, matrix are column major and vector are columns, that is, should you do it on a paper, vector is placed vertically, on the right of matrix. The other multiplication is not implemented, transposing the matrix will do it the other way if you wish.
Return value: none.
fvec3_dst: the result vector
fmat4: the matrix to use
fvec3_src: the source vector
Multiplication of matrix by vector. The result is a vector, the convention used is that of OpenGL, matrix are column major and vector are columns, that is, should you do it on a paper, vector is placed vertically, on the right of matrix. The other multiplication is not implemented, transposing the matrix will do it the other way if you wish. The vector, here, is smaller than the matrix, the last element is supposed to be 1, this is how one implements translation through multiplication.
Return value: none.
Gives a readable version of the matrix, the representation uses newlines, with a different line for each row
Return value: newly allocated string
fvec2: the vector to initialize.
Fills the vector with zeros, regardless of what was there before. Internally, does a memset the only advantage is that this function should use the right sizeof and therefore avoids typo errors.
Return value: none.
fvec2_a: 1st vector to compare
fvec2_b: 2nd vector to compare
Compares two vectors, returns true if they are equal.
Return value: 1 if equal, 0 if different.
fvec2: the vector to query.
Returns the square of a vector length. To get the real length one should then apply a square root but at this stage one has at least an idea about vector length, and this information is enough to compare them.
Return value: sigma(coord*coord)
fvec2: the vector to query.
Returns the size/length of a vector, this is the distance of the point from origin, not the number of elements.
Return value: the length of the vector.
fvec2: the vector to normalize.
Normalizes a vector, that is, make its length be 1.
Return value: 1 if OK, 0 if error, such as trying to normalize vector zero.
fvec2: vector to modify
Calcs the opposite vector, by making a negation on all its members
Return value: none
fvec2: result vector
fvec2_a: 1st vector to add
fvec2_b: 2nd vector to add
Adds two vectors.
Return value: none
fvec2: result vector
fvec2_a: 1st vector
fvec2_b: 2nd vector, will be substracted to 1st vector
Substracts vector b from vector a.
Return value: none
fvec2_a: 1st vector
fvec2_b: 2nd vector
Calculates the dot AKA scalar product of the two vectors.
Return value: none
fvec3: result vector
fvec2_a: 1st vector
fvec2_b: 2nd vector
Calculates the cross AKA vectorial product of the two vectors. Since cross product only really makes sense in 3D, this function will interpret the 2D vectors as 3D vectors with z set t zero, that is, a vector in the xy plane.
Return value: none
fvec2: vector to modify
f: scale factor
Scales the vector by multiplying all its members by a scalar value.
Return value: none
fmat2: result matrix
fvec2_a: 1st row vector
fvec2_b: 2nd column vector
Multiplication of a row vector by a column vector to give a matrix.
Return value: none
Gives a readable version of the vector
Return value: newly allocated string
fvec3: the vector to initialize.
Fills the vector with zeros, regardless of what was there before. Internally, does a memset the only advantage is that this function should use the right sizeof and therefore avoids typo errors.
Return value: none.
fvec3_a: 1st vector to compare
fvec3_b: 2nd vector to compare
Compares two vectors, returns true if they are equal.
Return value: 1 if equal, 0 if different.
fvec3: the vector to query.
Returns the square of a vector length. To get the real length one should then apply a square root but at this stage one has at least an idea about vector length, and this information is enough to compare them.
Return value: sigma(coord*coord)
fvec3: the vector to query.
Returns the size/length of a vector, this is the distance of the point from origin, not the number of elements.
Return value: the length of the vector.
fvec3: the vector to normalize.
Normalizes a vector, that is, make its length be 1.
Return value: 1 if OK, 0 if error, such as trying to normalize vector zero.
fvec3: vector to modify
Calcs the opposite vector, by making a negation on all its members
Return value: none
fvec3: result vector
fvec3_a: 1st vector to add
fvec3_b: 2nd vector to add
Adds two vectors.
Return value: none
fvec3: result vector
fvec3_a: 1st vector
fvec3_b: 2nd vector, will be substracted to 1st vector
Substracts vector b from vector a.
Return value: none
fvec3_a: 1st vector
fvec3_b: 2nd vector
Calculates the dot AKA scalar product of the two vectors.
Return value: none
fvec3: result vector
fvec3_a: 1st vector
fvec3_b: 2nd vector
Calculates the cross AKA vectorial product of the two vectors.
Return value: none
fvec3: vector to modify
f: scale factor
Scales the vector by multiplying all its members by a scalar value.
Return value: none
fmat3: result matrix
fvec3_a: 1st row vector
fvec3_b: 3nd column vector
Multiplication of a row vector by a column vector to give a matrix.
Return value: none
Gives a readable version of the vector
Return value: newly allocated string
fvec4: the vector to initialize.
Fills the vector with zeros, regardless of what was there before. Internally, does a memset the only advantage is that this function should use the right sizeof and therefore avoids typo errors.
Return value: none.
fvec4_a: 1st vector to compare
fvec4_b: 2nd vector to compare
Compares two vectors, returns true if they are equal.
Return value: 1 if equal, 0 if different.
fvec4: the vector to query.
Returns the square of a vector length. To get the real length one should then apply a square root but at this stage one has at least an idea about vector length, and this information is enough to compare them.
Return value: sigma(coord*coord)
fvec4: the vector to query.
Returns the size/length of a vector, this is the distance of the point from origin, not the number of elements.
Return value: the length of the vector.
fvec4: the vector to normalize.
Normalizes a vector, that is, make its length be 1.
Return value: 1 if OK, 0 if error, such as trying to normalize vector zero.
fvec4: vector to modify
Calcs the opposite vector, by making a negation on all its members
Return value: none
fvec4: result vector
fvec4_a: 1st vector to add
fvec4_b: 2nd vector to add
Adds two vectors.
Return value: none
fvec4: result vector
fvec4_a: 1st vector
fvec4_b: 2nd vector, will be substracted to 1st vector
Substracts vector b from vector a.
Return value: none
fvec4_a: 1st vector
fvec4_b: 2nd vector
Calculates the dot AKA scalar product of the two vectors.
Return value: none
fvec3: result vector
fvec4_a: 1st vector
fvec4_b: 2nd vector
Calculates the cross AKA vectorial product of the two vectors. Since cross product only really makes sense in 3D, this function will interpret the 4D vectors as 3D vectors only, ignoring the last value.
Return value: none
fvec4: vector to modify
f: scale factor
Scales the vector by multiplying all its members by a scalar value.
Return value: none
fmat4: result matrix
fvec4_a: 1st row vector
fvec4_b: 4nd column vector
Multiplication of a row vector by a column vector to give a matrix.
Return value: none
Gives a readable version of the vector
Return value: newly allocated string
f_a: 1st value to compare
f_b: 2nd value to compare
Compares two value, and returns true if they look the same. This similarity is based on a percentage of difference for big enough values, and for very small values, they are just considered equal whatever happens. This is far from perfect but the purpose is usually just to track blunders in matrix code.
Return value: 1 if similar, 0 if not.
i_a: 1st value to compare
i_b: 2nd value to compare
Compares two value, and returns true if they look the same. This similarity is based on a percentage of difference for big enough values, and for very small values, they are just considered equal whatever happens. This is far from perfect but the purpose is usually just to track blunders in matrix code.
Return value: 1 if similar, 0 if not.
d_a: 1st value to compare
d_b: 2nd value to compare
Compares two value, and returns true if they look the same. This similarity is based on a percentage of difference for big enough values, and for very small values, they are just considered equal whatever happens. This is far from perfect but the purpose is usually just to track blunders in matrix code.
Return value: 1 if similar, 0 if not.
x_a: 1st value to compare
x_b: 2nd value to compare
Compares two value, and returns true if they look the same. This similarity is based on a percentage of difference for big enough values, and for very small values, they are just considered equal whatever happens. This is far from perfect but the purpose is usually just to track blunders in matrix code.
Return value: 1 if similar, 0 if not.
mode: test mode (bitmask)
Registers all tests for the libmat module.
Return value: 1 if test is successfull, 0 on error.
mode: test mode (bitmask)
Runs the
mat
module test suite, testing most (if not all...) functions.Return value: 1 if test is successfull, 0 on error.
Type:
double
Definition:
double lw6mat_dmat2_t::m[LW6MAT_MAT2_M_SIZE][LW6MAT_MAT2_M_SIZE]
Accessor with 2 dimensions array index. The convention is column-major mode as done in OpenGL so that m[i][j] is element at column i and row j. Beware, this is not the most natural order for a C programmer.
Type:
double
Definition:
double lw6mat_dmat2_t::v[LW6MAT_MAT2_V_SIZE_X_SIZE]
Accessor with flat array index. To access element a column i and row j, use i*2+j.
Type:
double
Definition:
double lw6mat_dmat3_t::m[LW6MAT_MAT3_M_SIZE][LW6MAT_MAT3_M_SIZE]
Accessor with 2 dimensions array index. The convention is column-major mode as done in OpenGL so that m[i][j] is element at column i and row j. Beware, this is not the most natural order for a C programmer.
Type:
double
Definition:
double lw6mat_dmat3_t::v[LW6MAT_MAT3_V_SIZE_X_SIZE]
Accessor with flat array index. To access element a column i and row j, use i*3+j.
Type:
double
Definition:
double lw6mat_dmat4_t::m[LW6MAT_MAT4_M_SIZE][LW6MAT_MAT4_M_SIZE]
Accessor with 2 dimensions array index. The convention is column-major mode as done in OpenGL so that m[i][j] is element at column i and row j. Beware, this is not the most natural order for a C programmer.
Type:
double
Definition:
double lw6mat_dmat4_t::v[LW6MAT_MAT4_V_SIZE_X_SIZE]
Accessor with flat array index. To access element a column i and row j, use i*4+j.
Type:
struct lw6mat_dvec2_t::16
Definition:
struct lw6mat_dvec2_t::16 lw6mat_dvec2_t::p
Accessor with named/point coords.
Type:
struct lw6mat_dvec2_t::17
Definition:
struct lw6mat_dvec2_t::17 lw6mat_dvec2_t::t
Accessor with texture-like name.
Type:
double
Definition:
double lw6mat_dvec2_t::v[LW6MAT_VEC2_V_SIZE]
Accessor with array index.
Type:
struct lw6mat_dvec3_t::18
Definition:
struct lw6mat_dvec3_t::18 lw6mat_dvec3_t::p
Accessor with named/point coords.
Type:
struct lw6mat_dvec3_t::19
Definition:
struct lw6mat_dvec3_t::19 lw6mat_dvec3_t::c
Accessor with color-like name.
Type:
struct lw6mat_dvec3_t::20
Definition:
struct lw6mat_dvec3_t::20 lw6mat_dvec3_t::t
Accessor with texture-like name.
Type:
double
Definition:
double lw6mat_dvec3_t::v[LW6MAT_VEC3_V_SIZE]
Accessor with array index.
Type:
lw6mat_dvec2_t
Definition:
lw6mat_dvec2_t lw6mat_dvec3_t::v2
Accessor with smaller-sized vector, only 2 dimensions.
Type:
struct lw6mat_dvec4_t::21
Definition:
struct lw6mat_dvec4_t::21 lw6mat_dvec4_t::p
Accessor with named/point coords.
Type:
struct lw6mat_dvec4_t::22
Definition:
struct lw6mat_dvec4_t::22 lw6mat_dvec4_t::c
Accessor with color-like name.
Type:
struct lw6mat_dvec4_t::23
Definition:
struct lw6mat_dvec4_t::23 lw6mat_dvec4_t::t
Accessor with texture-like name.
Type:
double
Definition:
double lw6mat_dvec4_t::v[LW6MAT_VEC4_V_SIZE]
Accessor with array index.
Type:
lw6mat_dvec2_t
Definition:
lw6mat_dvec2_t lw6mat_dvec4_t::v2
Accessor with smaller-sized vector, only 2 dimensions.
Type:
lw6mat_dvec3_t
Definition:
lw6mat_dvec3_t lw6mat_dvec4_t::v3
Accessor with smaller-sized vector, only 3 dimensions.
Type:
float
Definition:
float lw6mat_fmat2_t::m[LW6MAT_MAT2_M_SIZE][LW6MAT_MAT2_M_SIZE]
Accessor with 2 dimensions array index. The convention is column-major mode as done in OpenGL so that m[i][j] is element at column i and row j. Beware, this is not the most natural order for a C programmer.
Type:
float
Definition:
float lw6mat_fmat2_t::v[LW6MAT_MAT2_V_SIZE_X_SIZE]
Accessor with flat array index. To access element a column i and row j, use i*4+j.
Type:
float
Definition:
float lw6mat_fmat3_t::m[LW6MAT_MAT3_M_SIZE][LW6MAT_MAT3_M_SIZE]
Accessor with 2 dimensions array index. The convention is column-major mode as done in OpenGL so that m[i][j] is element at column i and row j. Beware, this is not the most natural order for a C programmer.
Type:
float
Definition:
float lw6mat_fmat3_t::v[LW6MAT_MAT3_V_SIZE_X_SIZE]
Accessor with flat array index. To access element a column i and row j, use i*3+j.
Type:
float
Definition:
float lw6mat_fmat4_t::m[LW6MAT_MAT4_M_SIZE][LW6MAT_MAT4_M_SIZE]
Accessor with 2 dimensions array index. The convention is column-major mode as done in OpenGL so that m[i][j] is element at column i and row j. Beware, this is not the most natural order for a C programmer.
Type:
float
Definition:
float lw6mat_fmat4_t::v[LW6MAT_MAT4_V_SIZE_X_SIZE]
Accessor with flat array index. To access element a column i and row j, use i*4+j.
Type:
struct lw6mat_fvec2_t::0
Definition:
struct lw6mat_fvec2_t::0 lw6mat_fvec2_t::p
Accessor with named/point coords.
Type:
struct lw6mat_fvec2_t::1
Definition:
struct lw6mat_fvec2_t::1 lw6mat_fvec2_t::t
Accessor with texture-like name.
Type:
float
Definition:
float lw6mat_fvec2_t::v[LW6MAT_VEC2_V_SIZE]
Accessor with array index.
Type:
struct lw6mat_fvec3_t::2
Definition:
struct lw6mat_fvec3_t::2 lw6mat_fvec3_t::p
Accessor with named/point coords.
Type:
struct lw6mat_fvec3_t::3
Definition:
struct lw6mat_fvec3_t::3 lw6mat_fvec3_t::c
Accessor with color-like name.
Type:
struct lw6mat_fvec3_t::4
Definition:
struct lw6mat_fvec3_t::4 lw6mat_fvec3_t::t
Accessor with texture-like name.
Type:
float
Definition:
float lw6mat_fvec3_t::v[LW6MAT_VEC3_V_SIZE]
Accessor with array index.
Type:
lw6mat_fvec2_t
Definition:
lw6mat_fvec2_t lw6mat_fvec3_t::v2
Accessor with smaller-sized vector, only 2 dimensions.
Type:
struct lw6mat_fvec4_t::5
Definition:
struct lw6mat_fvec4_t::5 lw6mat_fvec4_t::p
Accessor with named/point coords.
Type:
struct lw6mat_fvec4_t::6
Definition:
struct lw6mat_fvec4_t::6 lw6mat_fvec4_t::c
Accessor with color-like name.
Type:
struct lw6mat_fvec4_t::7
Definition:
struct lw6mat_fvec4_t::7 lw6mat_fvec4_t::t
Accessor with texture-like name.
Type:
float
Definition:
float lw6mat_fvec4_t::v[LW6MAT_VEC4_V_SIZE]
Accessor with array index.
Type:
lw6mat_fvec2_t
Definition:
lw6mat_fvec2_t lw6mat_fvec4_t::v2
Accessor with smaller-sized vector, only 2 dimensions.
Type:
lw6mat_fvec3_t
Definition:
lw6mat_fvec3_t lw6mat_fvec4_t::v3
Accessor with smaller-sized vector, only 3 dimensions.
Type:
int32_t
Definition:
int32_t lw6mat_imat2_t::m[LW6MAT_MAT2_M_SIZE][LW6MAT_MAT2_M_SIZE]
Accessor with 2 dimensions array index. The convention is column-major mode as done in OpenGL so that m[i][j] is element at column i and row j. Beware, this is not the most natural order for a C programmer.
Type:
int32_t
Definition:
int32_t lw6mat_imat2_t::v[LW6MAT_MAT2_V_SIZE_X_SIZE]
Accessor with flat array index. To access element a column i and row j, use i*2+j.
Type:
int32_t
Definition:
int32_t lw6mat_imat3_t::m[LW6MAT_MAT3_M_SIZE][LW6MAT_MAT3_M_SIZE]
Accessor with 2 dimensions array index. The convention is column-major mode as done in OpenGL so that m[i][j] is element at column i and row j. Beware, this is not the most natural order for a C programmer.
Type:
int32_t
Definition:
int32_t lw6mat_imat3_t::v[LW6MAT_MAT3_V_SIZE_X_SIZE]
Accessor with flat array index. To access element a column i and row j, use i*3+j.
Type:
int32_t
Definition:
int32_t lw6mat_imat4_t::m[LW6MAT_MAT4_M_SIZE][LW6MAT_MAT4_M_SIZE]
Accessor with 2 dimensions array index. The convention is column-major mode as done in OpenGL so that m[i][j] is element at column i and row j. Beware, this is not the most natural order for a C programmer.
Type:
int32_t
Definition:
int32_t lw6mat_imat4_t::v[LW6MAT_MAT4_V_SIZE_X_SIZE]
Accessor with flat array index. To access element a column i and row j, use i*4+j.
Type:
struct lw6mat_ivec2_t::8
Definition:
struct lw6mat_ivec2_t::8 lw6mat_ivec2_t::p
Accessor with named/point coords.
Type:
struct lw6mat_ivec2_t::9
Definition:
struct lw6mat_ivec2_t::9 lw6mat_ivec2_t::t
Accessor with texture-like name.
Type:
int32_t
Definition:
int32_t lw6mat_ivec2_t::v[LW6MAT_VEC2_V_SIZE]
Accessor with array index.
Type:
struct lw6mat_ivec3_t::10
Definition:
struct lw6mat_ivec3_t::10 lw6mat_ivec3_t::p
Accessor with named/point coords.
Type:
struct lw6mat_ivec3_t::11
Definition:
struct lw6mat_ivec3_t::11 lw6mat_ivec3_t::c
Accessor with color-like name.
Type:
struct lw6mat_ivec3_t::12
Definition:
struct lw6mat_ivec3_t::12 lw6mat_ivec3_t::t
Accessor with texture-like name.
Type:
int32_t
Definition:
int32_t lw6mat_ivec3_t::v[LW6MAT_VEC3_V_SIZE]
Accessor with array index.
Type:
struct lw6mat_ivec4_t::13
Definition:
struct lw6mat_ivec4_t::13 lw6mat_ivec4_t::p
Accessor with named/point coords.
Type:
struct lw6mat_ivec4_t::14
Definition:
struct lw6mat_ivec4_t::14 lw6mat_ivec4_t::c
Accessor with color-like name.
Type:
struct lw6mat_ivec4_t::15
Definition:
struct lw6mat_ivec4_t::15 lw6mat_ivec4_t::t
Accessor with texture-like name.
Type:
int32_t
Definition:
int32_t lw6mat_ivec4_t::v[LW6MAT_VEC4_V_SIZE]
Accessor with array index.
Type:
int32_t
Definition:
int32_t lw6mat_xmat2_t::m[LW6MAT_MAT2_M_SIZE][LW6MAT_MAT2_M_SIZE]
Accessor with 2 dimensions array index. The convention is column-major mode as done in OpenGL so that m[i][j] is element at column i and row j. Beware, this is not the most natural order for a C programmer.
Type:
int32_t
Definition:
int32_t lw6mat_xmat2_t::v[LW6MAT_MAT2_V_SIZE_X_SIZE]
Accessor with flat array index. To access element a column i and row j, use i*3+j.
Type:
int32_t
Definition:
int32_t lw6mat_xmat3_t::m[LW6MAT_MAT3_M_SIZE][LW6MAT_MAT3_M_SIZE]
Accessor with 2 dimensions array index. The convention is column-major mode as done in OpenGL so that m[i][j] is element at column i and row j. Beware, this is not the most natural order for a C programmer.
Type:
int32_t
Definition:
int32_t lw6mat_xmat3_t::v[LW6MAT_MAT3_V_SIZE_X_SIZE]
Accessor with flat array index. To access element a column i and row j, use i*3+j.
Type:
int32_t
Definition:
int32_t lw6mat_xmat4_t::m[LW6MAT_MAT4_M_SIZE][LW6MAT_MAT4_M_SIZE]
Accessor with 2 dimensions array index. The convention is column-major mode as done in OpenGL so that m[i][j] is element at column i and row j. Beware, this is not the most natural order for a C programmer.
Type:
int32_t
Definition:
int32_t lw6mat_xmat4_t::v[LW6MAT_MAT4_V_SIZE_X_SIZE]
Accessor with flat array index. To access element a column i and row j, use i*4+j.
Type:
struct lw6mat_xvec2_t::24
Definition:
struct lw6mat_xvec2_t::24 lw6mat_xvec2_t::p
Accessor with named/point coords.
Type:
struct lw6mat_xvec2_t::25
Definition:
struct lw6mat_xvec2_t::25 lw6mat_xvec2_t::t
Accessor with texture-like name.
Type:
int32_t
Definition:
int32_t lw6mat_xvec2_t::v[LW6MAT_VEC2_V_SIZE]
Accessor with array index.
Type:
struct lw6mat_xvec3_t::26
Definition:
struct lw6mat_xvec3_t::26 lw6mat_xvec3_t::p
Accessor with named/point coords.
Type:
struct lw6mat_xvec3_t::27
Definition:
struct lw6mat_xvec3_t::27 lw6mat_xvec3_t::c
Accessor with color-like name.
Type:
struct lw6mat_xvec3_t::28
Definition:
struct lw6mat_xvec3_t::28 lw6mat_xvec3_t::t
Accessor with texture-like name.
Type:
int32_t
Definition:
int32_t lw6mat_xvec3_t::v[LW6MAT_VEC3_V_SIZE]
Accessor with array index.
Type:
struct lw6mat_xvec4_t::29
Definition:
struct lw6mat_xvec4_t::29 lw6mat_xvec4_t::p
Accessor with named/point coords.
Type:
struct lw6mat_xvec4_t::30
Definition:
struct lw6mat_xvec4_t::30 lw6mat_xvec4_t::c
Accessor with color-like name.