Woolz Image Processing  Version 1.8.3
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}}. \]

. More...

 
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} \]

. More...

 
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...
 

Detailed Description

Function Documentation

◆ AlgVectorZero()

void AlgVectorZero ( double *  aV,
size_t  n 
)

sets all elements of the given vector to zero.

Parameters
aVGiven vector.
nNumber of elements.

Referenced by AlgMatrixTVectorMul().

◆ AlgVectorNorm()

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
aVGiven vector \(\mathbf{a}\),
nNumber of elements in \(\mathbf{a}\).

References AlgVectorDot().

Referenced by AlgMatrixCGSolve(), and AlgMatrixSolveLSQR().

◆ AlgVectorDot()

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
aVVector \(\mathbf{a}\).
bVVector \(\mathbf{b}\).
nNumber of elements in each of the vectors.

Referenced by AlgMatrixCGSolve(), and AlgVectorNorm().

◆ AlgVectorAdd()

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
aVVector \(\mathbf{a}\).
bVVector \(\mathbf{b}\).
cVVector \(\mathbf{c}\).
nNumber of elements in each of the vectors.

◆ AlgVectorSub()

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
aVVector \(\mathbf{a}\).
bVVector \(\mathbf{b}\).
cVVector \(\mathbf{c}\).
nNumber of elements in each of the vectors.

Referenced by AlgMatrixCGSolve().

◆ AlgVectorCopy()

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
aVVector \(\mathbf{a}\).
bVVector \(\mathbf{b}\).
nNumber of elements in each of the vectors.

Referenced by AlgMatrixCGSolve(), AlgMatrixCopy(), AlgMatrixSolveLSQR(), and AlgMatrixTVectorMulAdd().