Framework | Accelerate/vecLib |
Declared in | vDSP.h |
This document describes the C API for the vDSP functions that receive a vector as input and compute scalars as output. Examples of such operations include calculating the dot product of a vector, or finding the minimum or maximum of a vector.
vDSP_dotpr
vDSP_dotprD
vDSP_zdotpr
vDSP_zdotprD
vDSP_zidotpr
vDSP_zidotprD
vDSP_zrdotpr
vDSP_zrdotprD
vDSP_meanv
vDSP_meanvD
vDSP_meamgv
vDSP_meamgvD
vDSP_measqv
vDSP_measqvD
vDSP_mvessq
vDSP_mvessqD
vDSP_rmsqv
vDSP_rmsqvD
Computes the dot or scalar product of vectors A
and B
and leaves the result in scalar C
; single precision.
void vDSP_dotpr (const float A[], vDSP_Stride I, const float B[], vDSP_Stride J, float * C, vDSP_Length N);
This performs the operation
vDSP.h
Computes the dot or scalar product of vectors A
and B
and leaves the result in scalar C
; double precision.
void vDSP_dotprD (const double A[], vDSP_Stride I, const double B[], vDSP_Stride J, double * C, vDSP_Length N);
This performs the operation
vDSP.h
Vector maximum magnitude; single precision.
void vDSP_maxmgv (const float * A, vDSP_Stride I, float * C, vDSP_Length N);
Single-precision real input vector. If passed a vector with no elements, this function returns a value of 0 in C
.
Stride for A
Output scalar
Count
This performs the operation
*C = 0; |
for (n = 0; n < N; ++n) |
if (*C < abs(A[n*I])) |
*C = abs(A[n*I]); |
Finds the element with the greatest magnitude in vector A
and copies this value to scalar C
.
vDSP.h
Vector maximum magnitude; double precision.
void vDSP_maxmgvD (const double * A, vDSP_Stride I, double * C, vDSP_Length N);
Double-precision real input vector. If passed a vector with no elements, this function returns a value of 0 in C
.
Stride for A
Output scalar
Count
This performs the operation
*C = 0; |
for (n = 0; n < N; ++n) |
if (*C < abs(A[n*I])) |
*C = abs(A[n*I]); |
Finds the element with the greatest magnitude in vector A
and copies this value to scalar C
.
vDSP.h
Vector maximum magnitude with index; single precision.
void vDSP_maxmgvi (float * A, vDSP_Stride I, float * C, vDSP_Length * IC, vDSP_Length N);
Single-precision real input vector. If passed a vector with no elements, this function returns a value of 0 in *C
, and the value returned in IC
is undefined.
Stride for A
Output scalar
Output scalar index
Count
This performs the operation
*C = 0; |
for (n = 0; n < N; ++n) |
{ |
if (*C < abs(A[n*I])) |
{ |
*C = abs(A[n*I]); |
*IC = n*I; |
} |
} |
Copies the element with the greatest magnitude from real vector A
to real scalar C
, and writes its zero-based index to integer scalar IC
. The index is the actual array index, not the pre-stride index. If vector A
contains more than one instance of the maximum magnitude, IC
contains the index of the first instance.
vDSP.h
Vector maximum magnitude with index; double precision.
void vDSP_maxmgviD (double * A, vDSP_Stride I, double * C, vDSP_Length * IC, vDSP_Length N);
Double-precision real input vector. If passed a vector with no elements, this function returns a value of 0 in *C
. The value returned in IC
is undefined.
Stride for A
Output scalar
Output scalar
Count
This performs the operation
*C = 0; |
for (n = 0; n < N; ++n) |
{ |
if (*C < abs(A[n*I])) |
{ |
*C = abs(A[n*I]); |
*IC = n*I; |
} |
} |
Copies the element with the greatest magnitude from real vector A
to real scalar C
, and writes its zero-based index to integer scalar IC
. The index is the actual array index, not the pre-stride index. If vector A
contains more than one instance of the maximum magnitude, IC
contains the index of the first instance.
vDSP.h
Vector maximum value; single precision.
void vDSP_maxv (float * A, vDSP_Stride I, float * C, vDSP_Length N);
Single-precision real input vector.
Stride for A
Output scalar
Count
This performs the operation
*C = -INFINITY; |
for (n = 0; n < N; ++n) |
if (*C < A[n*I]) |
*C = A[n*I]; |
Finds the element with the greatest value in vector A
and copies this value to scalar C
. If A
has length of 0, this function returns -INFINITY
.
vDSP.h
Vector maximum value; double precision.
void vDSP_maxvD (double * A, vDSP_Stride I, double * C, vDSP_Length N);
Double-precision real input vector
Stride for A
Output scalar
Count
This performs the operation
*C = -INFINITY; |
for (n = 0; n < N; ++n) |
if (*C < A[n*I]) |
*C = A[n*I]; |
Finds the element with the greatest value in vector A
and copies this value to scalar C
. If A
has length of 0, this function returns -INFINITY
.
vDSP.h
Vector maximum value with index; single precision.
void vDSP_maxvi (float * A, vDSP_Stride I, float * C, vDSP_Length * IC, vDSP_Length N);
Single-precision real input vector.
Stride for A
Output scalar
Output scalar index
Count
This performs the operation
*C = -INFINITY; |
for (n = 0; n < N; ++n) |
{ |
if (*C < A[n * I]) |
{ |
*C = A[n * I]; |
*IC = n * I; |
} |
} |
Copies the element with the greatest value from real vector A
to real scalar C
, and writes its zero-based index to integer scalar IC
. The index is the actual array index, not the pre-stride index. If vector A
contains more than one instance of the maximum value, IC
contains the index of the first instance. If A
is vector with no elements, this function returns a value of -infinity in C
and *IC
is undetermined.
vDSP.h
Vector maximum value with index; double precision.
void vDSP_maxviD (double * A, vDSP_Stride I, double * C, vDSP_Length * IC, vDSP_Length N);
Double-precision real input vector
Stride for A
Output scalar
Output scalar
Count
This performs the operation
*C = -INFINITY; |
for (n = 0; n < N; ++n) |
{ |
if (*C < A[n * I]) |
{ |
*C = A[n * I]; |
*IC = n * I; |
} |
} |
Copies the element with the greatest value from real vector A
to real scalar C
, and writes its zero-based index to integer scalar IC
. The index is the actual array index, not the pre-stride index. If vector A
contains more than one instance of the maximum value, IC
contains the index of the first instance. If A
is vector with no elements, this function returns a value of -infinity in C
and *IC
is undetermined.
vDSP.h
Vector mean magnitude; single precision.
void vDSP_meamgv (float * A, vDSP_Stride I, float * C, vDSP_Length N);
Single-precision real input vector
Stride for A
Output scalar
Count
This performs the operation
Finds the mean of the magnitudes of elements of vector A
and stores this value in scalar C
.
vDSP.h
Vector mean magnitude; double precision.
void vDSP_meamgvD (double * A, vDSP_Stride I, double * C, vDSP_Length N);
Double-precision real input vector
Stride for A
Output scalar
Count
This performs the operation
Finds the mean of the magnitudes of elements of vector A
and stores this value in scalar C
.
vDSP.h
Vector mean value; single precision.
void vDSP_meanv (float * A, vDSP_Stride I, float * C, vDSP_Length N);
Single-precision real input vector. If passed an array of length 0, this function returns a NaN.
Stride for A
Output scalar
Count
This performs the operation
Finds the mean value of the elements of vector A
and stores this value in scalar C
.
vDSP.h
Vector mean value; double precision.
void vDSP_meanvD (double * A, vDSP_Stride I, double * C, vDSP_Length N);
Double-precision real input vector
Stride for A
Output scalar
Count
This performs the operation
Finds the mean value of the elements of vector A
and stores this value in scalar C
.
vDSP.h
Vector mean square value; single precision.
void vDSP_measqv (float * A, vDSP_Stride I, float * C, vDSP_Length N);
Single-precision real input vector. If passed an array of length 0, this function returns a NaN.
Stride for A
Output scalar
Count
This performs the operation
Finds the mean value of the squares of the elements of vector A
and stores this value in scalar C
.
vDSP.h
Vector mean square value; double precision.
void vDSP_measqvD (double * A, vDSP_Stride I, double * C, vDSP_Length N);
Double-precision real input vector
Stride for A
Output scalar
Count
This performs the operation
Finds the mean value of the squares of the elements of vector A
and stores this value in scalar C
.
vDSP.h
Vector minimum magnitude; single precision.
void vDSP_minmgv (float * A, vDSP_Stride I, float * C, vDSP_Length N);
Single-precision real input vector. If passed an array of length 0, this function returns +INF.
Stride for A
Output scalar
Count
This performs the operation
Finds the element with the least magnitude in vector A
and copies this value to scalar C
.
vDSP.h
Vector minimum magnitude; double precision.
void vDSP_minmgvD (double * A, vDSP_Stride I, double * C, vDSP_Length N);
Double-precision real input vector
Stride for A
Output scalar
Count
This performs the operation
Finds the element with the least magnitude in vector A
and copies this value to scalar C
.
vDSP.h
Vector minimum magnitude with index; single precision.
void vDSP_minmgvi (float * A, vDSP_Stride I, float * C, vDSP_Length * IC, vDSP_Length N);
Single-precision real input vector. If passed a zero vector, this function returns a value of +INF with an indeterminate index.
Stride for A
Output scalar
Output scalar index
Count
This performs the operation
Copies the element with the least magnitude from real vector A
to real scalar C
, and writes its zero-based index to integer scalar IC
. The index is the actual array index, not the pre-stride index. If vector A
contains more than one instance of the least magnitude, IC
contains the index of the first instance.
vDSP.h
Vector minimum magnitude with index; double precision.
void vDSP_minmgviD (double * A, vDSP_Stride I, double * C, vDSP_Length * IC, vDSP_Length N);
Double-precision real input vector
Stride for A
Output scalar
Output scalar
Count
This performs the operation
Copies the element with the least magnitude from real vector A
to real scalar C
, and writes its zero-based index to integer scalar IC
. The index is the actual array index, not the pre-stride index. If vector A
contains more than one instance of the least magnitude, IC
contains the index of the first instance.
vDSP.h
Vector minimum value.
void vDSP_minv (float * A, vDSP_Stride I, float * C, vDSP_Length N);
Single-precision real input vector. If passed an array of length 0, this function returns +INF.
Stride for A
Output scalar
Count
This performs the operation
Finds the element with the least value in vector A
and copies this value to scalar C
.
vDSP.h
Vector minimum value; double precision.
void vDSP_minvD (double * A, vDSP_Stride I, double * C, vDSP_Length N);
Double-precision real input vector
Stride for A
Output scalar
Count
This performs the operation
Finds the element with the least value in vector A
and copies this value to scalar C
.
vDSP.h
Vector minimum value with index; single precision.
void vDSP_minvi (float * A, vDSP_Stride I, float * C, vDSP_Length * IC, vDSP_Length N);
Single-precision real input vector. If passed a zero vector, this function returns a value of +INF with an indeterminate index.
Stride for A
Output scalar
Output scalar index
Count
This performs the operation
Copies the element with the least value from real vector A
to real scalar C
, and writes its zero-based index to integer scalar IC
. The index is the actual array index, not the pre-stride index. If vector A
contains more than one instance of the least value, IC
contains the index of the first instance.
vDSP.h
Vector minimum value with index; double precision.
void vDSP_minviD (double * A, vDSP_Stride I, double * C, vDSP_Length * IC, vDSP_Length N);
Double-precision real input vector
Stride for A
Output scalar
Output scalar
Count
This performs the operation
Copies the element with the least value from real vector A
to real scalar C
, and writes its zero-based index to integer scalar IC
. The index is the actual array index, not the pre-stride index. If vector A
contains more than one instance of the least value, IC
contains the index of the first instance.
vDSP.h
Vector mean of signed squares; single precision.
void vDSP_mvessq (float * A, vDSP_Stride I, float * C, vDSP_Length N);
Single-precision real input vector.
Stride for A
Output scalar
Count
This performs the operation
Finds the mean value of the signed squares of the elements of vector A
and stores this value in *C
. If A
is an array of length 0, this function returns a NaN. .
vDSP.h
Vector mean of signed squares; double precision.
void vDSP_mvessqD (double * A, vDSP_Stride I, double * C, vDSP_Length N);
Double-precision real input vector
Stride for A
Output scalar
Count
This performs the operation
Finds the mean value of the signed squares of the elements of vector A
and stores this value in *C
. If A
is an array of length 0, this function returns a NaN.
vDSP.h
Vector root-mean-square; single precision.
void vDSP_rmsqv (float * A, vDSP_Stride I, float * C, vDSP_Length N);
Single-precision real input vector. If passed an array of length 0, this function returns a NaN.
Stride for A
Single-precision real output scalar
Count
This performs the operation
Calculates the root mean square of the elements of A
and stores the result in *C
vDSP.h
Vector root-mean-square; double precision.
void vDSP_rmsqvD (double * A, vDSP_Stride I, double * C, vDSP_Length N);
Double-precision real input vector
Stride for A
Double-precision real output scalar
Count
This performs the operation
Calculates the root mean square of the elements of A
and stores the result in *C
vDSP.h
Vector sum; single precision.
void vDSP_sve (float * A, vDSP_Stride I, float * C, vDSP_Length N);
Single-precision real input vector.
Stride for A
Single-precision real output scalar
Count
This performs the operation
Writes the sum of the elements of A
into *C
. If A
is a vector with zero elements, this function returns 0 in *C
.
vDSP.h
Vector sum; double precision.
void vDSP_sveD (double * A, vDSP_Stride I, double * C, vDSP_Length N);
Double-precision real input vector
Stride for A
Double-precision real output scalar
Count
This performs the operation
Writes the sum of the elements of A
into *C
. If A
is a vector with zero elements, this function returns 0 in *C
.
vDSP.h
Vector sum of magnitudes; single precision.
void vDSP_svemg (float * A, vDSP_Stride I, float * C, vDSP_Length N);
Single-precision real input scalar. If passed an value of 0, this function returns 0.
Stride for A
Single-precision real output scalar
Count
This performs the operation
Writes the sum of the magnitudes of the elements of A
into C
.
vDSP.h
Vector sum of magnitudes; double precision.
void vDSP_svemgD (double * A, vDSP_Stride I, double * C, vDSP_Length N);
Double-precision real input scalar
Stride for A
Double-precision real output scalar
Count
This performs the operation
Writes the sum of the magnitudes of the elements of A
into C
.
vDSP.h
Vector sum of squares; single precision.
void vDSP_svesq (float * A, vDSP_Stride I, float * C, vDSP_Length N);
Single-precision real input scalar. If passed an value of 0, this function returns 0.
Stride for A
Single-precision real output scalar
Count
This performs the operation
Writes the sum of the squares of the elements of A
into C
.
vDSP.h
Vector sum of squares; double precision.
void vDSP_svesqD (double * A, vDSP_Stride I, double * C, vDSP_Length N);
Double-precision real input scalar
Stride for A
Double-precision real output scalar
Count
This performs the operation
Writes the sum of the squares of the elements of A
into C
.
vDSP.h
Vector sum of signed squares; single precision.
void vDSP_svs (float * A, vDSP_Stride I, float * C, vDSP_Length N);
Single-precision real input scalar. If passed an value of 0, this function returns 0.
Stride for A
Single-precision real output scalar
Count
This performs the operation
Writes the sum of the signed squares of the elements of A
into C
.
vDSP.h
Vector sum of signed squares; double precision.
void vDSP_svsD (double * A, vDSP_Stride I, double * C, vDSP_Length N);
Double-precision real input scalar
Stride for A
Double-precision real output scalar
Count
This performs the operation
Writes the sum of the signed squares of the elements of A
into C
.
vDSP.h
Calculates the complex dot product of complex vectors signal1 and signal2 and leaves the result in complex vector result
; single precision.
void vDSP_zdotpr (DSPSplitComplex * A, vDSP_Stride I, DSPSplitComplex * B, vDSP_Stride J, DSPSplitComplex * C, vDSP_Length N);
This performs the operation
vDSP.h
Calculates the complex dot product of complex vectors signal1 and signal2 and leaves the result in complex vector result
; double precision.
void vDSP_zdotprD (DSPDoubleSplitComplex * A, vDSP_Stride I, DSPDoubleSplitComplex * B, vDSP_Stride J, DSPDoubleSplitComplex * C, vDSP_Length N);
This performs the operation
vDSP.h
Calculates the conjugate dot product (or inner dot product) of complex vectors signal1
and signal2
and leave the result in complex vector result
; single precision.
void vDSP_zidotpr (DSPSplitComplex * A, vDSP_Stride I, DSPSplitComplex * B, vDSP_Stride J, DSPSplitComplex * C, vDSP_Length N);
This performs the operation
vDSP.h
Calculates the conjugate dot product (or inner dot product) of complex vectors
signal1 and signal2 and leave the result in complex vector result
; double precision.
void vDSP_zidotprD (DSPDoubleSplitComplex * A, vDSP_Stride I, DSPDoubleSplitComplex * B, vDSP_Stride J, DSPDoubleSplitComplex * C, vDSP_Length N);
This performs the operation
vDSP.h
Calculates the complex dot product of complex vector A
and real vector B
and leaves the result in complex vector C
; single precision.
void vDSP_zrdotpr (DSPSplitComplex * A, vDSP_Stride I, const float B[], vDSP_Stride J, DSPSplitComplex * C, vDSP_Length N);
This performs the operation
vDSP.h
Calculates the complex dot product of complex vector A
and real vector B
and leaves the result in complex vector C
; double precision.
void vDSP_zrdotprD (DSPDoubleSplitComplex * A, vDSP_Stride I, const double B[], vDSP_Stride J, DSPDoubleSplitComplex * C, vDSP_Length N);
This performs the operation
vDSP.h
© 2009 Apple Inc. All Rights Reserved. (Last updated: 2009-01-06)