Mac OS X Reference Library Apple Developer Connection spyglass button

vDSP Matrix Operations Reference

Framework
Accelerate/vecLib
Declared in
vDSP.h

Overview

This document describes the C API for the matrix arithmetic operations available in vDSP. It provides functionality for multiplying and transposing real or complex matrices.

Functions by Task

Multiplying Real Matrices

Transposing a Matrix

Copying a Submatrix

Multiplying Complex Matrices

Functions

vDSP_mmov

The contents of a submatrix are copied to another submatrix.

   void
   vDSP_mmov (float * A,
   float * C,
   vDSP_Length NC,
   vDSP_Length NR,
   vDSP_Length TCA,
   vDSP_Length TCC);
Parameters
A

Single-precision real input submatrix

C

Single-precision real output submatrix

NC

Number of columns in A and C

NR

Number of rows in A and C

TCA

Number of columns in the matrix of which A is a submatrix

TCC

Number of columns in the matrix of which C is a submatrix

Discussion

The matrices are assumed to be stored in row-major order. Thus elements A[i][j] and A[i][j+1] are adjacent. Elements A[i][j] and A[i+1][j] are TCA elements apart.

This function may be used to move a subarray beginning at any point in a larger embedding array by passing for A the address of the first element of the subarray. For example, to move a subarray starting at A[3][4], pass &A[3][4]. Similarly, the address of the first destination element is passed for C

NC may equal TCA, and it may equal TCC. To copy all of an array to all of another array, pass the number of rows in NR and the number of columns in NC, TCA, and TCC.

Availability
Declared In
vDSP.h

vDSP_mmovD

The contents of a submatrix are copied to another submatrix.

   void vDSP_mmovD (double * A,
   double * C,
   vDSP_Length NC,
   vDSP_Length NR,
   vDSP_Length TCA,
   vDSP_Length TCC);
Parameters
A

Double-precision real input submatrix

C

Double-precision real output submatrix

NC

Number of columns in A and C

NR

Number of rows in A and C

TCA

Number of columns in the matrix of which A is a submatrix

TCC

Number of columns in the matrix of which C is a submatrix

Discussion

The matrices are assumed to be stored in row-major order. Thus elements A[i][j] and A[i][j+1] are adjacent. Elements A[i][j] and A[i+1][j] are TCA elements apart.

This function may be used to move a subarray beginning at any point in a larger embedding array by passing for A the address of the first element of the subarray. For example, to move a subarray starting at A[3][4], pass &A[3][4]. Similarly, the address of the first destination element is passed for C

NC may equal TCA, and it may equal TCC. To copy all of an array to all of another array, pass the number of rows in NR and the number of columns in NC, TCA, and TCC.

Availability
Declared In
vDSP.h

vDSP_mmul

Performs an out-of-place multiplication of M-by-P matrix A by a P-by-N matrix B and stores the results in an M-by-N matrix C; single precision.

   void vDSP_mmul (float * A,
   vDSP_Stride I,
   float * B,
   vDSP_Stride J,
   float * C,
   vDSP_Stride K,
   vDSP_Length M,
   vDSP_Length N,
   vDSP_Length P);
Discussion

This performs the operation

mathematical formula

Parameters A and B are the matrixes to be multiplied. I is an address stride through A. J is an address stride through B.

Parameter C is the result matrix. K is an address stride through C.

Parameter M is the row count for both A and C. Parameter N is the column count for both B and C. Parameter P is the column count for A and the row count for B.

Availability
Declared In
vDSP.h

vDSP_mmulD

Performs an out-of-place multiplication of M-by-P matrix A by a P-by-N matrix B and stores the results in an M-by-N matrix C; double precision.

   void vDSP_mmulD (double * A,
   vDSP_Stride I,
   double * B,
   vDSP_Stride J,
   double * C,
   vDSP_Stride K,
   vDSP_Length M,
   vDSP_Length N,
   vDSP_Length P);
Discussion

This performs the operation

mathematical formula

Parameters A and B are the matrixes to be multiplied. I is an address stride through A. J is an address stride through B.

Parameter C is the result matrix. K is an address stride through C.

Parameter M is the row count for both A and C. Parameter N is the column count for both B and C. Parameter P is the column count for A and the row count for B.

Availability
Declared In
vDSP.h

vDSP_mtrans

Creates a transposed matrix C from a source matrix A; single precision.

   void vDSP_mtrans (float * A,
   vDSP_Stride I,
   float * C,
   vDSP_Stride K,
   vDSP_Length M,
   vDSP_Length N);
Discussion

This performs the operation

mathematical formula

Parameter A is the source matrix. I is an address stride through the source matrix.

Parameter C is the resulting transposed matrix. K is an address stride through the result matrix.

Parameter M is the number of rows in C (and the number of columns in A).

Availability
Declared In
vDSP.h

vDSP_mtransD

Creates a transposed matrix C from a source matrix A; double precision.

   void vDSP_mtransD (double * A,
   vDSP_Stride I,
   double * C,
   vDSP_Stride K,
   vDSP_Length M,
   vDSP_Length N);
Discussion

This performs the operation

mathematical formula

Parameter A is the source matrix. I is an address stride through the source matrix.

Parameter C is the resulting transposed matrix. K is an address stride through the result matrix.

Parameter M is the number of rows in C (and the number of columns in A).

Availability
Declared In
vDSP.h

vDSP_zmma

Performs an out-of-place complex multiplication of an M-by-P matrix A by a P-by-N matrix B, adds the product to M-by-N matrix C, and stores the result in M-by-N matrix D; single precision.

   void vDSP_zmma (DSPSplitComplex * A,
   vDSP_Stride I,
   DSPSplitComplex * B,
   vDSP_Stride J,
   DSPSplitComplex * C,
   vDSP_Stride K,
   DSPSplitComplex * D,
   vDSP_Stride L,
   vDSP_Length M,
   vDSP_Length N,
   vDSP_Length P);
Discussion

This performs the operation

mathematical formula

Parameters A and C are the matrixes to be multiplied, and C the matrix to be added. I is an address stride through A. J is an address stride through B. K is an address stride through C. L is an address stride through D.

Parameter D is the result matrix.

Parameter M is the row count for A, C and D. Parameter N is the column count of B, C, and D. Parameter P is the column count of A and the row count of B.

Availability
Declared In
vDSP.h

vDSP_zmmaD

Performs an out-of-place complex multiplication of an M-by-P matrix A by a P-by-N matrix B, adds the product to M-by-N matrix C, and stores the result in M-by-N matrix D; double precision.

   void vDSP_zmmaD (DSPDoubleSplitComplex * A,
   vDSP_Stride I,
   DSPDoubleSplitComplex * B,
   vDSP_Stride J,
   DSPDoubleSplitComplex * C,
   vDSP_Stride K,
   DSPDoubleSplitComplex * D,
   vDSP_Stride L,
   vDSP_Length M,
   vDSP_Length N,
   vDSP_Length P);
   
Discussion

This performs the operation

mathematical formula

Parameters A and C are the matrixes to be multiplied, and C the matrix to be added. I is an address stride through A. J is an address stride through B. K is an address stride through C. L is an address stride through D.

Parameter D is the result matrix.

Parameter M is the row count for A, C and D. Parameter N is the column count of B, C, and D. Parameter P is the column count of A and the row count of B.

Availability
Declared In
vDSP.h

vDSP_zmms

Performs an out-of-place complex multiplication of an M-by-P matrix A by a P-by-N matrix B , subtracts M-by-N matrix C from the product, and stores the result in M-by-N matrix D; single precision.

   void vDSP_zmms (DSPSplitComplex * A,
   vDSP_Stride I,
   DSPSplitComplex * B,
   vDSP_Stride J,
   DSPSplitComplex * C,
   vDSP_Stride K,
   DSPSplitComplex * D,
   vDSP_Stride L,
   vDSP_Length M,
   vDSP_Length N,
   vDSP_Length P);
Discussion

This performs the operation

mathematical formula

Parameters A and B are the matrixes to be multiplied, and C the matrix to be subtracted. I is an address stride through A. J is an address stride through B. K is an address stride through C. L is an address stride through D.

Parameter D is the result matrix.

Parameter M is the row count for A, C and D. Parameter N is the column count of B, C, and D. Parameter P is the column count of A and the row count of B.

Availability
Declared In
vDSP.h

vDSP_zmmsD

Performs an out-of-place complex multiplication of an M-by-P matrix A by a P-by-N matrix B , subtracts M-by-N matrix C from the product, and stores the result in M-by-N matrix D; double precision.

   void vDSP_zmmsD (DSPDoubleSplitComplex * A,
   vDSP_Stride I,
   DSPDoubleSplitComplex * B,
   vDSP_Stride J,
   DSPDoubleSplitComplex * C,
   vDSP_Stride K,
   DSPDoubleSplitComplex * D,
   vDSP_Stride L,
   vDSP_Length M,
   vDSP_Length N,
   vDSP_Length P);
   
Discussion

This performs the operation

mathematical formula

Parameters A and B are the matrixes to be multiplied, and C the matrix to be subtracted. I is an address stride through A. J is an address stride through B. K is an address stride through C. L is an address stride through D.

Parameter D is the result matrix.

Parameter M is the row count for A, C and D. Parameter N is the column count of B, C, and D. Parameter P is the column count of A and the row count of B.

Availability
Declared In
vDSP.h

vDSP_zmmul

Performs an out-of-place complex multiplication of an M-by-P matrix A by a P-by-N matrix B and stores the results in an M-by-N matrix C; single precision.

   void vDSP_zmmul (DSPSplitComplex * A,
   vDSP_Stride I,
   DSPSplitComplex * B,
   vDSP_Stride J,
   DSPSplitComplex * C,
   vDSP_Stride K,
   vDSP_Length M,
   vDSP_Length N,
   vDSP_Length P);
Discussion

This performs the operation

mathematical formula

Parameters A and B are the matrixes to be multiplied. I is an address stride through A. J is an address stride through B.

Parameter C is the result matrix. K is an address stride through C.

Parameter M is the row count for both A and C. Parameter N is the column count for both B and C. Parameter P is the column count for A and the row count for B.

Availability
Declared In
vDSP.h

vDSP_zmmulD

Performs an out-of-place complex multiplication of an M-by-P matrix A by a P-by-N matrix B and stores the results in an M-by-N matrix C; double precision.

   void vDSP_zmmulD (DSPDoubleSplitComplex * A,
   vDSP_Stride I,
   DSPDoubleSplitComplex * B,
   vDSP_Stride J,
   DSPDoubleSplitComplex * C,
   vDSP_Stride K,
   vDSP_Length M,
   vDSP_Length N,
   vDSP_Length P);
   
Discussion

This performs the operation

mathematical formula

Parameters A and B are the matrixes to be multiplied. I is an address stride through A. J is an address stride through B.

Parameter C is the result matrix. K is an address stride through C.

Parameter M is the row count for both A and C. Parameter N is the column count for both B and C. Parameter P is the column count for A and the row count for B.

Availability
Declared In
vDSP.h

vDSP_zmsm

Performs an out-of-place complex multiplication of an M-by-P matrix A by a P-by-N matrix B, subtracts the product from M-by-P matrix C, and stores the result in M-by-P matrix D; single precision.

   void vDSP_zmsm (DSPSplitComplex * A,
   vDSP_Stride I,
   DSPSplitComplex * B,
   vDSP_Stride J,
   DSPSplitComplex * C,
   vDSP_Stride K,
   DSPSplitComplex * D,
   vDSP_Stride L,
   vDSP_Length M,
   vDSP_Length N,
   vDSP_Length P);
Discussion

This performs the operation

mathematical formula

Parameters A and B are the matrixes to be multiplied, and C is the matrix from which the product is to be subtracted. aStride is an address stride through A. bStride is an address stride through B. cStride is an address stride through C. dStride is an address stride through D.

Parameter D is the result matrix.

Parameter M is the row count for A, C and D. Parameter N is the column count of B, C, and D. Parameter P is the column count of A and the row count of B.

Availability
Declared In
vDSP.h

vDSP_zmsmD

Performs an out-of-place complex multiplication of an M-by-P matrix A by a P-by-N matrix B, subtracts the product from M-by-P matrix C, and stores the result in M-by-P matrix D; double precision.

   void vDSP_zmsmD (DSPDoubleSplitComplex * A,
   vDSP_Stride I,
   DSPDoubleSplitComplex * B,
   vDSP_Stride J,
   DSPDoubleSplitComplex * C,
   vDSP_Stride K,
   DSPDoubleSplitComplex * D,
   vDSP_Stride L,
   vDSP_Length M,
   vDSP_Length N,
   vDSP_Length P);
   
Discussion

This performs the operation

mathematical formula

Parameters A and B are the matrixes to be multiplied, and parameter C is the matrix from which the product is to be subtracted. aStride is an address stride through A. bStride is an address stride through B. cStride is an address stride through C. dStride is an address stride through D.

Parameter D is the result matrix.

Parameter M is the row count for A, C and D. Parameter N is the column count of B, C, and D. Parameter P is the column count of A and the row count of B.

Availability
Declared In
vDSP.h


Last updated: 2009-01-06

Did this document help you? Yes It's good, but... Not helpful...