Woolz Image Processing  Version 1.7.5
AlgVector

## Files

file  AlgVectorMath.c
Basic vector arithmatic.

## Functions

void AlgVectorZero (double *aV, size_t n)
sets all elements of the given vector to zero. More...

double AlgVectorNorm (double *aV, size_t n)
Computes the norm of the given vector $$\mathbf{a}$$ with n elements:

$\|\mathbf{a}\| = \sqrt{\mathbf{a} \cdot \mathbf{a}}.$

double AlgVectorDot (double *aV, double *bV, size_t n)
Computes the scalar (dot) product of the two vectors $$\mathbf{a}$$ and $$\mathbf{b}$$ each with n elements:

$\mathbf{a} \cdot \mathbf{b} = \sum_{i = 0}^{n - 1}{a_i b_i}$

void AlgVectorAdd (double *aV, double *bV, double *cV, size_t n)
Adds vector $$\mathbf{b}$$ to vector $$\mathbf{c}$$. Computes $$a_i = b_i + c_i, \forall i \in [0 \ldots n - 1]$$. More...

void AlgVectorSub (double *aV, double *bV, double *cV, size_t n)
Subtracts vector $$\mathbf{c}$$ from vector $$\mathbf{b}$$. Computes $$a_i = b_i - c_i, \forall i \in [0 \ldots n - 1]$$. More...

void AlgVectorCopy (double *aV, double *bV, size_t n)
Copies one vector $$\mathbf{b}$$ to vector $$\mathbf{a}$$. $$a_i = b_i, \forall i \in [0 \ldots n - 1]$$. More...

## Function Documentation

 void AlgVectorZero ( double * aV, size_t n )

sets all elements of the given vector to zero.

Parameters
 aV Given vector. n Number of elements.

Referenced by AlgMatrixTVectorMul().

 double AlgVectorNorm ( double * aV, size_t n )

Computes the norm of the given vector $$\mathbf{a}$$ with n elements:

$\|\mathbf{a}\| = \sqrt{\mathbf{a} \cdot \mathbf{a}}.$

.

Returns
Norm of the vector.
Note
For efficiency the given parameters are not checked.
Vector size is limited only by address space.
Parameters
 aV Given vector $$\mathbf{a}$$, n Number of elements in $$\mathbf{a}$$.

References AlgVectorDot().

Referenced by AlgMatrixCGSolve(), and AlgMatrixSolveLSQR().

 double AlgVectorDot ( double * aV, double * bV, size_t n )

Computes the scalar (dot) product of the two vectors $$\mathbf{a}$$ and $$\mathbf{b}$$ each with n elements:

$\mathbf{a} \cdot \mathbf{b} = \sum_{i = 0}^{n - 1}{a_i b_i}$

.

Returns
Scalar (dot) product of the vectors.
Note
For efficiency the given parameters are not checked.
Vector size is limited only by address space.
Parameters
 aV Vector $$\mathbf{a}$$. bV Vector $$\mathbf{b}$$. n Number of elements in each of the vectors.

Referenced by AlgMatrixCGSolve(), and AlgVectorNorm().

 void AlgVectorAdd ( double * aV, double * bV, double * cV, size_t n )

Adds vector $$\mathbf{b}$$ to vector $$\mathbf{c}$$. Computes $$a_i = b_i + c_i, \forall i \in [0 \ldots n - 1]$$.

Returns
void
Note
For efficiency the given parameters are not checked.
Vector size is limited only by address space.
Parameters
 aV Vector $$\mathbf{a}$$. bV Vector $$\mathbf{b}$$. cV Vector $$\mathbf{c}$$. n Number of elements in each of the vectors.
 void AlgVectorSub ( double * aV, double * bV, double * cV, size_t n )

Subtracts vector $$\mathbf{c}$$ from vector $$\mathbf{b}$$. Computes $$a_i = b_i - c_i, \forall i \in [0 \ldots n - 1]$$.

Returns
void
Note
For efficiency the given parameters are not checked.
Vector size is limited only by address space.
Parameters
 aV Vector $$\mathbf{a}$$. bV Vector $$\mathbf{b}$$. cV Vector $$\mathbf{c}$$. n Number of elements in each of the vectors.

Referenced by AlgMatrixCGSolve().

 void AlgVectorCopy ( double * aV, double * bV, size_t n )

Copies one vector $$\mathbf{b}$$ to vector $$\mathbf{a}$$. $$a_i = b_i, \forall i \in [0 \ldots n - 1]$$.

Returns
void
Note
For efficiency the given parameters are not checked.
Vector size is limited only by address space.
Parameters
 aV Vector $$\mathbf{a}$$. bV Vector $$\mathbf{b}$$. n Number of elements in each of the vectors.