These routines form a simple linear algebra package used internally by
VolPack. The routines are also available as utility routines for use
by the application.
vpIdentity3 assigns the identity matrix to a 3-by-3 matrix.
vpIdentity4 assigns the identity matrix to a 4-by-4 matrix.
vpNormalize3 normalizes a 3-element vector (so the magnitude is
1.0). The result overwrites the source vector.
vpMatrixVectorMult4 multiplies a 4-by-4 matrix by a 4-element
column vector and stores the result in the destination vector
(v_dst = m . v_src).
vpMatrixMult4 multiplies two 4-by-4 matrices and stores the
result in the destination matrix (m_dst = m_src1 . m_src2).
vpCrossProduct computes the cross product of two 3-element
vectors and stores the result in the destination vector (v_dst =
v_src1 x v_src2).
vpSolveSystem4 solves the linear system m . x = b for each
right-hand-side vector in the b array. The solution vectors
overwrite the vectors in the b array. The solution is computed
using Gauss-Jordan elimination with partial pivoting and implicit
scaling.
vpSetVector3 initializes the components of a 3-element vector
(v_dst = [x, y, z]). It is a macro.
vpSetVector4 initializes the components of a 4-element vector
(v_dst = [x, y, z, w]). It is a macro.
ERRORS
vpNormalize3 and vpSolveSystem4 normally return VP_OK.
The following error return value is possible:
VPERROR_SINGULAR
The vector is a 0 vector (vpNormalize3 only), or the matrix is
singular (vpSolveSystem4 only).