FreeBSD Manual Pages
M_VECTORZ(3) Library Functions Manual M_VECTORZ(3) NAME M_VectorZ -- Agar-Math signed integer vectors SYNOPSIS #include <agar/core.h> #include <agar/gui.h> #include <agar/math/m.h> DESCRIPTION The M_VectorZ functions implement basic operations on signed-integer- valued n dimensional vectors. VECTORS IN Z^N The following routines operate on dynamically-allocated vectors in Z^n. Vectors entries are directly accessible through the v array. The M_VectorZ structure is defined as: typedef struct m_vector { Uint n; /* Size */ Uint32 _pad; int *_Nonnull v; /* Elements */ } M_VectorZ; VECTORS IN Z^N: INITIALIZATION M_VectorZ * M_VectorNewZ(Uint m) void M_VectorFreeZ(M_VectorZ *v) int M_VectorResizeZ(M_VectorZ *v, Uint m) The M_VectorNewZ() function allocates a new vector in Z^n. M_VectorFreeZ() releases all resources allocated for the specified vec- tor. M_VectorResizeZ() resizes the vector v to m. Existing entries are pre- served, but new entries are left uninitialized. If insufficient memory is available, -1 is returned and an error message is set. On success, the function returns 0. VECTORS IN Z^N: BASIC OPERATIONS void M_VectorCopyZ(const M_VectorZ *vDst, const M_VectorZ *vSrc) M_VectorZ * M_VectorScaleZv(const M_VectorZ *v, M_Real c) void M_VectorAddZv(M_VectorZ *a, const M_VectorZ *b) void M_VectorSubZv(M_VectorZ *a, const M_VectorZ *b) M_VectorCopyZ() copies the contents of vector vSrc into vDst. Both vectors must have the same size. M_VectorScaleZv() scales each component of vector v by a scaling factor c. M_VectorAddZv() returns the sum of vectors a and b into a. Both vec- tors must be of the same size. M_VectorSubZv() returns the difference of vectors a and b into a. Both vectors must be of the same size. SEE ALSO AG_Intro(3), M_Matrix(3), M_Vector(3), M_Real(3) HISTORY The M_VectorZ interface appeared in Agar 1.3.4. It was first docu- mented in Agar 1.7.1. Agar 1.7 March 8, 2024 M_VECTORZ(3)
NAME | SYNOPSIS | DESCRIPTION | VECTORS IN Z^N | VECTORS IN Z^N: INITIALIZATION | VECTORS IN Z^N: BASIC OPERATIONS | SEE ALSO | HISTORY
Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=M_VectorZ&sektion=3&manpath=FreeBSD+Ports+15.0.quarterly>
