Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

Next Page > Hide TOC

vDSP Vector-To-Scalar Operations Reference

Framework
Accelerate/vecLib
Declared in
vDSP.h

Overview

Describes the C API for the functions that perform vector-to-scalar operations in vecLib.

Functions by Task

Calculating Dot Products

Finding Maximums

Finding Minimums

Calculating Means

Summing Vectors

Functions

vDSP_dotpr

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 input1[],
   vDSP_Stride stride1,
   const float input2[],
   vDSP_Stride stride2,
   float * result,
   vDSP_Length size);

Discussion

This performs the operation


mathematical formula

Availability
Declared In
vDSP.h

vDSP_dotprD

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 input1[],
   vDSP_Stride stride1,
   const double input2[],
   vDSP_Stride stride2,
   double * result,
   vDSP_Length size);

Discussion

This performs the operation


mathematical formula

Availability
Declared In
vDSP.h

vDSP_maxmgv

Vector maximum magnitude; single precision.

   void vDSP_maxmgv (const float * A,
   vDSP_Stride I,
   float * C,
   vDSP_Length N);

Parameters
A

Single-precision real input vector. If passed a zero vector, this function returns a value of 0 with an indeterminate index.

I

Stride for A

C

Output scalar

N

Count

Discussion

This performs the operation


mathematical formula

Finds the element with the greatest magnitude in vector A and copies this value to scalar C.

Availability
Declared In
vDSP.h

vDSP_maxmgvD

Vector maximum magnitude; double precision.

   void vDSP_maxmgvD (const double * A,
   vDSP_Stride I,
   double * C,
   vDSP_Length N);

Parameters
A

Double-precision real input vector

I

Stride for A

C

Output scalar

N

Count

Discussion

This performs the operation


mathematical formula

Finds the element with the greatest magnitude in vector A and copies this value to scalar C.

Availability
Declared In
vDSP.h

vDSP_maxmgvi

Vector maximum magnitude with index; single precision.

   void vDSP_maxmgvi (float * A,
   vDSP_Stride I,
   float * C,
   vDSP_Length * IC,
   vDSP_Length N);

Parameters
A

Single-precision real input vector. If passed a zero vector, this function returns a value of 0 with an indeterminate index.

I

Stride for A

C

Output scalar

IC

Output scalar index

N

Count

Discussion

This performs the operation


mathematical formula

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.

Availability
Declared In
vDSP.h

vDSP_maxmgviD

Vector maximum magnitude with index; double precision.

   void vDSP_maxmgviD (double * A,
   vDSP_Stride I,
   double * C,
   vDSP_Length * IC,
   vDSP_Length N);

Parameters
A

Double-precision real input vector

I

Stride for A

C

Output scalar

IC

Output scalar

N

Count

Discussion

This performs the operation


mathematical formula

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.

Availability
Declared In
vDSP.h

vDSP_maxv

Vector maximum value; single precision.

   void vDSP_maxv (float * A,
   vDSP_Stride I,
   float * C,
   vDSP_Length N);

Parameters
A

Single-precision real input vector. If passed an array of length 0, this function returns -INF.

I

Stride for A

C

Output scalar

N

Count

Discussion

This performs the operation


mathematical formula

Finds the element with the greatest value in vector A and copies this value to scalar C.

Availability
Declared In
vDSP.h

vDSP_maxvD

Vector maximum value; double precision.

   void vDSP_maxvD (double * A,
   vDSP_Stride I,
   double * C,
   vDSP_Length N);

Parameters
A

Double-precision real input vector

I

Stride for A

C

Output scalar

N

Count

Discussion

This performs the operation


mathematical formula

Finds the element with the greatest value in vector A and copies this value to scalar C.

Availability
Declared In
vDSP.h

vDSP_maxvi

Vector maximum value with index; single precision.

   void vDSP_maxvi (float * A,
   vDSP_Stride I,
   float * C,
   vDSP_Length * IC,
   vDSP_Length N);

Parameters
A

Single-precision real input vector. If passed a zero vector, this function returns a value of -INF with an indeterminate index.

I

Stride for A

C

Output scalar

IC

Output scalar index

N

Count

Discussion

This performs the operation


mathematical formula

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.

Availability
Declared In
vDSP.h

vDSP_maxviD

Vector maximum value with index; double precision.

   void vDSP_maxviD (double * A,
   vDSP_Stride I,
   double * C,
   vDSP_Length * IC,
   vDSP_Length N);

Parameters
A

Double-precision real input vector

I

Stride for A

C

Output scalar

IC

Output scalar

N

Count

Discussion

This performs the operation


mathematical formula

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.

Availability
Declared In
vDSP.h

vDSP_meamgv

Vector mean magnitude; single precision.

   void vDSP_meamgv (float * A,
   vDSP_Stride I,
   float * C,
   vDSP_Length N);

Parameters
A

Single-precision real input vector

I

Stride for A

C

Output scalar

N

Count

Discussion

This performs the operation


mathematical formula

Finds the mean of the magnitudes of elements of vector A and stores this value in scalar C.

Availability
Declared In
vDSP.h

vDSP_meamgvD

Vector mean magnitude; double precision.

   void vDSP_meamgvD (double * A,
   vDSP_Stride I,
   double * C,
   vDSP_Length N);

Parameters
A

Double-precision real input vector

I

Stride for A

C

Output scalar

N

Count

Discussion

This performs the operation


mathematical formula

Finds the mean of the magnitudes of elements of vector A and stores this value in scalar C.

Availability
Declared In
vDSP.h

vDSP_meanv

Vector mean value; single precision.

   void vDSP_meanv (float * A,
   vDSP_Stride I,
   float * C,
   vDSP_Length N);

Parameters
A

Single-precision real input vector. If passed an array of length 0, this function returns a NaN.

I

Stride for A

C

Output scalar

N

Count

Discussion

This performs the operation


mathematical formula

Finds the mean value of the elements of vector A and stores this value in scalar C.

Availability
Declared In
vDSP.h

vDSP_meanvD

Vector mean value; double precision.

   void vDSP_meanvD (double * A,
   vDSP_Stride I,
   double * C,
   vDSP_Length N);

Parameters
A

Double-precision real input vector

I

Stride for A

C

Output scalar

N

Count

Discussion

This performs the operation


mathematical formula

Finds the mean value of the elements of vector A and stores this value in scalar C.

Availability
Declared In
vDSP.h

vDSP_measqv

Vector mean square value; single precision.

   void vDSP_measqv (float * A,
   vDSP_Stride I,
   float * C,
   vDSP_Length N);

Parameters
A

Single-precision real input vector. If passed an array of length 0, this function returns a NaN.

I

Stride for A

C

Output scalar

N

Count

Discussion

This performs the operation


mathematical formula

Finds the mean value of the squares of the elements of vector A and stores this value in scalar C.

Availability
Declared In
vDSP.h

vDSP_measqvD

Vector mean square value; double precision.

   void vDSP_measqvD (double * A,
   vDSP_Stride I,
   double * C,
   vDSP_Length N);

Parameters
A

Double-precision real input vector

I

Stride for A

C

Output scalar

N

Count

Discussion

This performs the operation


mathematical formula

Finds the mean value of the squares of the elements of vector A and stores this value in scalar C.

Availability
Declared In
vDSP.h

vDSP_minmgv

Vector minimum magnitude; single precision.

   void vDSP_minmgv (float * A,
   vDSP_Stride I,
   float * C,
   vDSP_Length N);

Parameters
A

Single-precision real input vector. If passed an array of length 0, this function returns +INF.

I

Stride for A

C

Output scalar

N

Count

Discussion

This performs the operation


mathematical formula

Finds the element with the least magnitude in vector A and copies this value to scalar C.

Availability
Declared In
vDSP.h

vDSP_minmgvD

Vector minimum magnitude; double precision.

   void vDSP_minmgvD (double * A,
   vDSP_Stride I,
   double * C,
   vDSP_Length N);

Parameters
A

Double-precision real input vector

I

Stride for A

C

Output scalar

N

Count

Discussion

This performs the operation


mathematical formula

Finds the element with the least magnitude in vector A and copies this value to scalar C.

Availability
Declared In
vDSP.h

vDSP_minmgvi

Vector minimum magnitude with index; single precision.

   void vDSP_minmgvi (float * A,
   vDSP_Stride I,
   float * C,
   vDSP_Length * IC,
   vDSP_Length N);

Parameters
A

Single-precision real input vector. If passed a zero vector, this function returns a value of +INF with an indeterminate index.

I

Stride for A

C

Output scalar

IC

Output scalar index

N

Count

Discussion

This performs the operation


mathematical formula

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.

Availability
Declared In
vDSP.h

vDSP_minmgviD

Vector minimum magnitude with index; double precision.

   void vDSP_minmgviD (double * A,
   vDSP_Stride I,
   double * C,
   vDSP_Length * IC,
   vDSP_Length N);

Parameters
A

Double-precision real input vector

I

Stride for A

C

Output scalar

IC

Output scalar

N

Count

Discussion

This performs the operation


mathematical formula

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.

Availability
Declared In
vDSP.h

vDSP_minv

Vector minimum value.

   void vDSP_minv (float * A,
   vDSP_Stride I,
   float * C,
   vDSP_Length N);

Parameters
A

Single-precision real input vector. If passed an array of length 0, this function returns +INF.

I

Stride for A

C

Output scalar

N

Count

Discussion

This performs the operation


mathematical formula

Finds the element with the least value in vector A and copies this value to scalar C.

Availability
Declared In
vDSP.h

vDSP_minvD

Vector minimum value; double precision.

   void vDSP_minvD (double * A,
   vDSP_Stride I,
   double * C,
   vDSP_Length N);

Parameters
A

Double-precision real input vector

I

Stride for A

C

Output scalar

N

Count

Discussion

This performs the operation


mathematical formula

Finds the element with the least value in vector A and copies this value to scalar C.

Availability
Declared In
vDSP.h

vDSP_minvi

Vector minimum value with index; single precision.

   void vDSP_minvi (float * A,
   vDSP_Stride I,
   float * C,
   vDSP_Length * IC,
   vDSP_Length N);

Parameters
A

Single-precision real input vector. If passed a zero vector, this function returns a value of +INF with an indeterminate index.

I

Stride for A

C

Output scalar

IC

Output scalar index

N

Count

Discussion

This performs the operation


mathematical formula

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.

Availability
Declared In
vDSP.h

vDSP_minviD

Vector minimum value with index; double precision.

   void vDSP_minviD (double * A,
   vDSP_Stride I,
   double * C,
   vDSP_Length * IC,
   vDSP_Length N);

Parameters
A

Double-precision real input vector

I

Stride for A

C

Output scalar

IC

Output scalar

N

Count

Discussion

This performs the operation


mathematical formula

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.

Availability
Declared In
vDSP.h

vDSP_mvessq

Vector mean of signed squares; single precision.

   void vDSP_mvessq (float * A,
   vDSP_Stride I,
   float * C,
   vDSP_Length N);

Parameters
A

Single-precision real input vector. If passed an array of length 0, this function returns a NaN.

I

Stride for A

C

Output scalar

N

Count

Discussion

This performs the operation


mathematical formula

Finds the mean value of the signed squares of the elements of vector A and stores this value in scalar C.

Availability
Declared In
vDSP.h

vDSP_mvessqD

Vector mean of signed squares; double precision.

   void vDSP_mvessqD (double * A,
   vDSP_Stride I,
   double * C,
   vDSP_Length N);

Parameters
A

Double-precision real input vector

I

Stride for A

C

Output scalar

N

Count

Discussion

This performs the operation


mathematical formula

Finds the mean value of the signed squares of the elements of vector A and stores this value in scalar C.

Availability
Declared In
vDSP.h

vDSP_rmsqv

Vector root-mean-square; single precision.

   void vDSP_rmsqv (float * A,
   vDSP_Stride I,
   float * C,
   vDSP_Length N);

Parameters
A

Single-precision real input vector. If passed an array of length 0, this function returns a NaN.

I

Stride for A

C

Single-precision real output scalar

N

Count

Discussion

This performs the operation


mathematical formula

Calculates the root mean square of the elements of A and stores the result in C

Availability
Declared In
vDSP.h

vDSP_rmsqvD

Vector root-mean-square; double precision.

   void vDSP_rmsqvD (double * A,
   vDSP_Stride I,
   double * C,
   vDSP_Length N);

Parameters
A

Double-precision real input vector

I

Stride for A

C

Double-precision real output scalar

N

Count

Discussion

This performs the operation


mathematical formula

Calculates the root mean square of the elements of A and stores the result in C

Availability
Declared In
vDSP.h

vDSP_sve

Vector sum; single precision.

   void vDSP_sve (float * A,
   vDSP_Stride I,
   float * C,
   vDSP_Length N);

Parameters
A

Single-precision real input scalar. If passed an value of 0, this function returns 0.

I

Stride for A

C

Single-precision real output scalar

N

Count

Discussion

This performs the operation


mathematical formula

Writes the sum of the elements of A into C.

Availability
Declared In
vDSP.h

vDSP_sveD

Vector sum; double precision.

   void vDSP_sveD (double * A,
   vDSP_Stride I,
   double * C,
   vDSP_Length N);

Parameters
A

Double-precision real input scalar

I

Stride for A

C

Double-precision real output scalar

N

Count

Discussion

This performs the operation


mathematical formula

Writes the sum of the elements of A into C.

Availability
Declared In
vDSP.h

vDSP_svemg

Vector sum of magnitudes; single precision.

   void vDSP_svemg (float * A,
   vDSP_Stride I,
   float * C,
   vDSP_Length N);

Parameters
A

Single-precision real input scalar. If passed an value of 0, this function returns 0.

I

Stride for A

C

Single-precision real output scalar

N

Count

Discussion

This performs the operation


mathematical formula

Writes the sum of the magnitudes of the elements of A into C.

Availability
Declared In
vDSP.h

vDSP_svemgD

Vector sum of magnitudes; double precision.

   void vDSP_svemgD (double * A,
   vDSP_Stride I,
   double * C,
   vDSP_Length N);

Parameters
A

Double-precision real input scalar

I

Stride for A

C

Double-precision real output scalar

N

Count

Discussion

This performs the operation


mathematical formula

Writes the sum of the magnitudes of the elements of A into C.

Availability
Declared In
vDSP.h

vDSP_svesq

Vector sum of squares; single precision.

   void vDSP_svesq (float * A,
   vDSP_Stride I,
   float * C,
   vDSP_Length N);

Parameters
A

Single-precision real input scalar. If passed an value of 0, this function returns 0.

I

Stride for A

C

Single-precision real output scalar

N

Count

Discussion

This performs the operation


mathematical formula

Writes the sum of the squares of the elements of A into C.

Availability
Declared In
vDSP.h

vDSP_svesqD

Vector sum of squares; double precision.

   void vDSP_svesqD (double * A,
   vDSP_Stride I,
   double * C,
   vDSP_Length N);

Parameters
A

Double-precision real input scalar

I

Stride for A

C

Double-precision real output scalar

N

Count

Discussion

This performs the operation


mathematical formula

Writes the sum of the squares of the elements of A into C.

Availability
Declared In
vDSP.h

vDSP_svs

Vector sum of signed squares; single precision.

   void vDSP_svs (float * A,
   vDSP_Stride I,
   float * C,
   vDSP_Length N);

Parameters
A

Single-precision real input scalar. If passed an value of 0, this function returns 0.

I

Stride for A

C

Single-precision real output scalar

N

Count

Discussion

This performs the operation


mathematical formula

Writes the sum of the signed squares of the elements of A into C.

Availability
Declared In
vDSP.h

vDSP_svsD

Vector sum of signed squares; double precision.

   void vDSP_svsD (double * A,
   vDSP_Stride I,
   double * C,
   vDSP_Length N);

Parameters
A

Double-precision real input scalar

I

Stride for A

C

Double-precision real output scalar

N

Count

Discussion

This performs the operation


mathematical formula

Writes the sum of the signed squares of the elements of A into C.

Availability
Declared In
vDSP.h

vDSP_zdotpr

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 * input1,
   vDSP_Stride stride1,
   DSPSplitComplex * input2,
   vDSP_Stride stride2,
   DSPSplitComplex * result,
   vDSP_Length size);

Discussion

This performs the operation


mathematical formula

Availability
Declared In
vDSP.h

vDSP_zdotprD

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 * input1,
   vDSP_Stride stride1,
   DSPDoubleSplitComplex * input2,
   vDSP_Stride stride2,
   DSPDoubleSplitComplex * result,
   vDSP_Length size);

Discussion

This performs the operation


mathematical formula

Availability
Declared In
vDSP.h

vDSP_zidotpr

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 * input1,
   vDSP_Stride stride1,
   DSPSplitComplex * input2,
   vDSP_Stride stride2,
   DSPSplitComplex * result,
   vDSP_Length size);

Discussion

This performs the operation


mathematical formula

Availability
Declared In
vDSP.h

vDSP_zidotprD

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 * input1,
   vDSP_Stride stride1,
   DSPDoubleSplitComplex * input2,
   vDSP_Stride stride2,
   DSPDoubleSplitComplex * result,
   vDSP_Length size);

Discussion

This performs the operation


mathematical formula

Availability
Declared In
vDSP.h

vDSP_zrdotpr

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 * input1,
   vDSP_Stride stride1,
   const float input2[],
   vDSP_Stride stride2,
   DSPSplitComplex * result,
   vDSP_Length size);

Discussion

This performs the operation


mathematical formula

Availability
Declared In
vDSP.h

vDSP_zrdotprD

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 * input1,
   vDSP_Stride stride1,
   const double input2[],
   vDSP_Stride stride2,
   DSPDoubleSplitComplex * result,
   vDSP_Length size);

Discussion

This performs the operation


mathematical formula

Availability
Declared In
vDSP.h

Next Page > Hide TOC


Last updated: 2007-06-15




Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice