LinearAlgebra(3)
β¨ LinearAlgebra β the linear algebra besties of VolPack β¨
okay so this is LinearAlgebra(3) from the Library Functions Manual and it's literally the math squad that lives inside VolPack π«Ά they do vectors, they do matrices, they do that whole "solve the system" thing, and they're not even gatekeeping β you can call them from your own app too. slay.
πΈ NAME πΈ
vpIdentity3, vpIdentity4, vpNormalize3, vpMatrixVectorMult4, vpMatrixMult4, vpCrossProduct, vpSolveSystem4, vpSetVector3, vpSetVector4 β linear algebra routines. yes bestie, all of them, one big happy function family π
π SYNOPSIS π
#include <volpack.h>
void
vpIdentity3(m_dst)
vpMatrix3 m_dst;
void
vpIdentity4(m_dst)
vpMatrix4 m_dst;
vpResult
vpNormalize3(v_src1)
vpVector3 v_src1;
void
vpMatrixVectorMult4(v_dst, m_src1, v_src1)
vpVector4 v_dst;
vpMatrix4 m_src1;
vpVector4 v_src1;
void
vpMatrixMult4(m_dst, m_src1, m_src2)
vpVector4 m_dst, m_src1, m_src2;
void
vpCrossProduct(v_dst, v_src1, v_src2)
vpVector3 v_dst, v_src1, v_src2;
vpResult
vpSolveSystem4(m_src1, b, count)
vpMatrix4 m_src1;
vpVector4 b[];
int count;
void
vpSetVector3(v_dst, x, y, z)
vpVector3 v_dst;
double x, y, z;
void
vpSetVector4(v_dst, x, y, z, w)
vpVector4 v_dst;
double x, y, z, w;
π¦ ARGUMENTS π¦
m_src1,m_src2,m_dstβ source and destination matrices. the "where it's coming from" and the "where it's going" πv_src1,v_src2,v_dstβ source and destination vectors. same energy, but vectors.bβ array of right-hand-side vectors. it's giving "the other side of the equation" β¨countβ number of right-hand-side vectors. so, how many of thosebsituations we're handling.x,y,z,wβ vector components. the little numbers inside the vector, no cap.
π DESCRIPTION π
these routines form a simple linear algebra package used internally by VolPack, and β plot twist β they're also available as utility routines for use by your application. so like, you get to borrow them. iconic behavior honestly π
vpIdentity3 assigns the identity matrix to a 3-by-3 matrix. the "who am I, I change nothing" matrix πͺ
vpIdentity4 assigns the identity matrix to a 4-by-4 matrix. same vibe, one dimension bigger π
vpNormalize3 normalizes a 3-element vector (so the magnitude is 1.0). the result overwrites the source vector β so heads up, your original vector is gone, it got a glow-up in place π
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). classic matrix-times-vector moment fr fr
vpMatrixMult4 multiplies two 4-by-4 matrices and stores the result in the destination matrix (m_dst = m_src1 . m_src2). two matrices walked in, one matrix walked out π
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). perpendicular era π¦
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 β so yeah, your b array becomes the answer key, bestie. the solution is computed using Gauss-Jordan elimination with partial pivoting and implicit scaling. that's the math being math, and it ate π₯
vpSetVector3 initializes the components of a 3-element vector (v_dst = [x, y, z]). it is a macro. yes, a macro, don't @ me.
vpSetVector4 initializes the components of a 4-element vector (v_dst = [x, y, z, w]). also a macro. twins π«Ά
π ERRORS π
vpNormalize3 and vpSolveSystem4 normally return VP_OK. so usually, we're chilling β¨
the following error return value is possible:
VPERROR_SINGULARβ the vector is a 0 vector (vpNormalize3only), or the matrix is singular (vpSolveSystem4only). this is the "math said no" error and you cannot normalize or solve your way out of it, sorry bestie π
π SEE ALSO π
that's the whole page, no cap. this manual page came to you from VolPack β go be a main character with your matrices π π β¨
π¦ where this page comes from
- debian bookworm: libvolpack1-dev 1.0b3-9 Β· BSD-3-Clause
- debian trixie: libvolpack1-dev 1.0b3-10 Β· BSD-3-Clause
- ubuntu jammy: libvolpack1-dev 1.0b3-9 Β· BSD-3-Clause
- ubuntu noble: libvolpack1-dev 1.0b3-9.1 Β· BSD-3-Clause
- ubuntu questing: libvolpack1-dev 1.0b3-11
- ubuntu resolute: libvolpack1-dev 1.0b3-11build1 Β· BSD-3-Clause
- ubuntu stonking: libvolpack1-dev 1.0b3-11build1 Β· BSD-3-Clause
- Copyright (c) 1994 The Board of Trustees of The Leland Stanford
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms