vecLib Reference
Inheritance
Not Applicable
Conforms To
Not Applicable
Import Statement
Swift
import Accelerate
Objective-C
@import Accelerate;
The vecLib framework contains nine C header files (not counting vecLib.h which merely includes the others). Two of them, vDSP.h and vDSP_translate.h, are covered in vDSP Programming Guide and vDSP Reference.
Three of the header files are Apple’s versions of well-known libraries which are described in detail in external references:
cblas.handvblas.hare the interfaces to Apple’s implementations of BLAS. You can find reference documentation in BLAS Reference. Additional documentation on the BLAS standard, including reference implementations, can be found on the web starting from the BLAS FAQ page at these URLs: http://www.netlib.org/blas/faq.html and http://www.netlib.org/blas/blast-forum/blast-forum.html.clapack.h is the interface to Apple’s implementation of LAPACK. Documentation of the LAPACK interfaces, including reference implementations, can be found on the web starting from the LAPACK FAQ page at this URL: http://netlib.org/lapack/faq.html
This document describes the functions declared in the remaining header files: vecLibTypes.h, vfp.h, vForce.h, vBasicOps.h, vectorOps.h, and vBigNum.h. These files support the vector mathematical functions library (also called “vMathLib”), which runs on vector processing hardware if available.
This library abstracts the vector processing capability so that code written for it will execute appropriate instructions for the processor available at runtime. For this reason, unless you are writing specialized code that targets a single CPU, you should generally use these functions rather than directly using vector instructions. By using these functions, your code does not have to deal with subtle differences in vector instruction availability between different microarchitectures, freeing you to focus on the problem you are trying to solve. Also, code written using vecLib tends to be easier to port to different CPU architectures (porting your core libraries to ARM on iOS, for example).
vecLibTypes.h
The vecLibTypes.h header file defines a set of vector data types (vFloat, vUInt32, etc.), which represent 128-bit vectors containing values of type float, UInt32, etc. The vBasicOps.h and vfp.h headers make use of these types.
The type names all begin with the letter “v,” followed by a mnemonic for the scalar data type used for elements of the vector. For example, vUInt32, vSInt16, vFloat, etc.
vBasicOps.h
vBasicOps.h declares a set of basic arithmetic and logical functions on 128-bit vectors, using the integer types from vecLibTypes.h.
The function names begin with “v,” followed by a mnemonic for the type of operation, e.g. “S” or “U” for signed or unsigned, then the width of the operation, then the name of the operation. For example, vS8Divide performs division of signed 8-bit values packed into 128-bit vectors.
vfp.h
vfp.h declares a set of floating-point arithmetic, transcendental and trigonometric functions, on 128-bit vectors, using the floating-point types from vecLibTypes.h.
These functions are named with their customary mathematical names, prefixed with the letter “v”, and all except vtablelookup() have the suffix “f” to indicate that they work with single-precision floating-point data. For example, vcosf is the single-precision cosine function.
vForce.h
vForce.h declares a set of trigonometric and transcendental functions in terms of C arrays (double * or float *), which can be of any desired length. Internally, the C arrays are converted piecewise into collections of 128-bit vectors, if appropriate for the current architecture.
The functions declared in vForce.h are named with the customary mathematical names, but with the prefix “vv.” Each mathematical function is available in two variants: one for single-precision floating-point data and one for double-precision data. The single-precision forms have the suffix “f”, while the double-precision forms have no suffix. For example, vvcosf is the single-precision cosine function, while vvcos is the double-precision variant.
All of the vForce.h functions follow a common format:
The return type is
void.The first parameter points to an array to hold the results. (The only exceptions are
vvsincosf()andvvsincos(), which have two result arrays pointed to by the first two parameters.)One or more parameters point to operand arrays, the same length as the result array.
The last parameter is the array length.
vectorOps.h
vectorOps.h declares a set of vector and matrix BLAS functions on arrays of 128-bit vectors containing single-precision floating-point values. The arrays can be of any desired length, but the number of float elements must be a multiple of 4.
vBigNum.h
vBigNum.h provides arithmetic and logical operations on large integers, which may be 128, 256, 512, or 1024 bits in length. It defines types for these values, and internally processes them as collections of 128-bit vectors.
vBigNum.h defines its own set of data types to represent large integer quantities, such as vS128 for a signed, 128-bit integer or vU1024 for an unsigned, 1024-bit integer. The function names begin with the data type name, followed by the name of the operation. For example, vS512Add performs addition of two 128-bit signed integers.
The functions perform logical and arithmetic operations on scalar values that may be 128, 256, 512, or 1024 bits in width. These values are implemented as structures of one, two, four, or eight 128-bit vectors, and the operations execute on the available vector-processing hardware if possible.
The functions have names that are compatible with those in vBasicOps.h.
Threading Model
In versions of vecLib prior to OS X v10.7, many vecLib routines used multiple POSIX threads to improve performance. In some cases, this could cause performance problems in applications that use large numbers of POSIX threads.
An application can limit the number of threads used by vecLib by setting the environment variable VECLIB_MAXIMUM_THREADS as follows:
#include <stdlib.h>setenv("VECLIB_MAXIMUM_THREADS", "1", true);
To remove the limit, you can unset the environment variable as follows:
unsetenv("VECLIB_MAXIMUM_THREADS");
In OS X v10.7, these routines use Grand Central Dispatch, so the use of this environment variable should no longer be necessary.
For More Information
For information about membership in Apple’s developer program, go to this URL:
http://developer.apple.com/membership/
For information about the Velocity Engine, go to this URL:
http://developer.apple.com/hardwaredrivers/ve/index.html
For general technical support from Apple, go to this URL:
-
128-bit logical left shift.
Parameters
vAThe vector to shift.
vShiftFactorThe number of bits to shift the vector.
Return Value
Returns the shifted vector.
Discussion
This function treats the entire 128-bit vector as a single value to shift.
Import Statement
Objective-C
#include <vBasicOps.h>;Availability
Available in OS X v10.5 and later.
-
128-bit logical right shift.
Parameters
vAThe vector to shift.
vShiftFactorThe number of bits to shift the vector.
Return Value
Returns the shifted vector.
Discussion
This function treats the entire 128-bit vector as a single value to shift.
Import Statement
Objective-C
#include <vBasicOps.h>;Availability
Available in OS X v10.5 and later.
-
64-bit logical left shift.
Declaration
Discussion
This function treats the vector as a pair of 64-bit values to shift.
Import Statement
Objective-C
@import Accelerate;Availability
OS X version 10.0 and later.
-
64-bit logical left shift with two shift factors.
Parameters
vAThe vector to shift.
vShiftFactorThe number of bits to shift the vector.
Return Value
Returns the shifted vector.
Discussion
This function treats the vector as a pair of 64-bit values to shift.
Import Statement
Objective-C
@import Accelerate;Availability
OS X version 10.0 and later.
-
64-bit logical right shift.
Declaration
Parameters
vAThe vector to shift.
vShiftFactorThe number of bits to shift the vector.
Return Value
Returns the shifted vector.
Discussion
This function treats the vector as a pair of 64-bit values to shift.
Import Statement
Objective-C
@import Accelerate;Availability
OS X version 10.0 and later.
-
64-bit logical right shift with two shift factors.
Parameters
vAThe vector to shift.
vShiftFactorThe number of bits to shift the vector.
Return Value
Returns the shifted vector.
Discussion
This function treats the vector as a pair of 64-bit values to shift.
Import Statement
Objective-C
@import Accelerate;Availability
OS X version 10.0 and later.
-
64-bit arithmetic (signed) shift.
Parameters
vAThe vector to shift.
vShiftFactorThe number of bits to shift the vector.
Return Value
Returns the shifted vector.
Discussion
This function treats the vector as a pair of 64-bit values to shift.
Import Statement
Objective-C
@import Accelerate;Availability
OS X version 10.0 and later.
-
64-bit arithmetic (signed) shift with two shift factors.
Parameters
vAThe vector to shift.
vShiftFactorThe number of bits to shift the vector.
Return Value
Returns the shifted vector.
Discussion
This function treats the vector as a pair of 64-bit values to shift.
Import Statement
Objective-C
@import Accelerate;Availability
OS X version 10.0 and later.
-
128-bit arithmetic (signed) shift.
Parameters
vAThe vector to shift.
vShiftFactorThe number of bits to shift the vector.
Return Value
Returns the shifted vector.
Discussion
This function treats the entire 128-bit vector as a single value to shift.
Import Statement
Objective-C
#include <vBasicOps.h>;Availability
OS X version 10.0 and later.
-
64-bit left rotate.
Parameters
vAThe vector to shift.
vShiftFactorThe number of bits to shift the vector.
Return Value
Returns the shifted vector.
Discussion
This function treats the vector as a pair of 64-bit values to rotate.
Import Statement
Objective-C
@import Accelerate;Availability
OS X version 10.0 and later.
-
64-bit right rotate.
Parameters
vAThe vector to shift.
vShiftFactorThe number of bits to shift the vector.
Return Value
Returns the shifted vector.
Discussion
This function treats the vector as a pair of 64-bit values to rotate.
Import Statement
Objective-C
@import Accelerate;Availability
OS X version 10.0 and later.
-
64-bit left rotate with two rotation factors.
Parameters
vAThe vector to shift.
vShiftFactorThe number of bits to shift the vector.
Return Value
Returns the shifted vector.
Discussion
This function treats the vector as a pair of 64-bit values to rotate.
Import Statement
Objective-C
@import Accelerate;Availability
OS X version 10.0 and later.
-
64-bit right rotate with two rotation factors.
Parameters
vAThe vector to shift.
vShiftFactorThe number of bits to shift the vector.
Return Value
Returns the shifted vector.
Discussion
This function treats the vector as a pair of 64-bit values to rotate.
Import Statement
Objective-C
@import Accelerate;Availability
OS X version 10.0 and later.
-
128-bit left rotate.
Parameters
vAThe vector to shift.
vShiftFactorThe number of bits to shift the vector.
Return Value
Returns the shifted vector.
Discussion
This function treats the entire 128-bit vector as a single value to rotate.
Import Statement
Objective-C
@import Accelerate;Availability
OS X version 10.0 and later.
-
128-bit right rotate.
Parameters
vAThe vector to shift.
vShiftFactorThe number of bits to shift the vector.
Return Value
Returns the shifted vector.
Discussion
This function treats the entire 128-bit vector as a single value to rotate.
Import Statement
Objective-C
@import Accelerate;Availability
OS X version 10.0 and later.
-
Unsigned 32-bit multiplication; results are twice as wide as multiplicands, even-numbered elements of multiplicand vectors are used. Note the big-endian convention: the leftmost element is element 0.
Import Statement
Objective-C
@import Accelerate;Availability
OS X version 10.0 and later.
-
Unsigned 32-bit multiplication; results are twice as wide as multiplicands, odd-numbered elements of multiplicand vectors are used. Note the big-endian convention: the leftmost element is element 0.
Import Statement
Objective-C
@import Accelerate;Availability
OS X version 10.0 and later.
-
Signed 32-bit multiplication; results are twice as wide as multiplicands, even-numbered elements of multiplicand vectors are used. Note the big-endian convention: the leftmost element is element 0.
Import Statement
Objective-C
@import Accelerate;Availability
OS X version 10.0 and later.
-
Signed 32-bit multiplication; results are twice as wide as multiplicands, odd-numbered elements of multiplicand vectors are used. Note the big-endian convention: the leftmost element is element 0.
Import Statement
Objective-C
@import Accelerate;Availability
OS X version 10.0 and later.
-
Unsigned 64-bit multiplication; results are twice as wide as multiplicands, even-numbered elements of multiplicand vectors are used. Note the big-endian convention: the leftmost element is element 0.
Import Statement
Objective-C
@import Accelerate;Availability
OS X version 10.0 and later.
-
Unsigned 64-bit multiplication; results are twice as wide as multiplicands, odd-numbered elements of multiplicand vectors are used. Note the big-endian convention: the leftmost element is element 0.
Import Statement
Objective-C
#include <vBasicOps.h>;Availability
OS X version 10.0 and later.
-
Signed 64-bit multiplication; results are twice as wide as multiplicands, even-numbered elements of multiplicand vectors are used. Note the big-endian convention: the leftmost element is element 0.
Import Statement
Objective-C
@import Accelerate;Availability
OS X version 10.0 and later.
-
Signed 64-bit multiplication; results are twice as wide as multiplicands, odd-numbered elements of multiplicand vectors are used. Note the big-endian convention: the leftmost element is element 0.
Import Statement
Objective-C
#include <vBasicOps.h>;Availability
OS X version 10.0 and later.
-
Computes the ceiling of values in a vector of floating-point values.
Declaration
Objective-C
vFloat vceilf ( vFloat );Parameters
AThe input vector.
Return Value
Returns a vector of floating-point values, each of which is the ceiling of the corresponding value in
A.Import Statement
Objective-C
@import Accelerate;Availability
Available in OS X v10.5 and later.
-
For each vector element, produces a value with the magnitude of
arg2and signarg1. Note that the order of the arguments matches the recommendation of the IEEE 754 floating-point standard, which is opposite from the SANE copysign function.Import Statement
Objective-C
@import Accelerate;Availability
OS X version 10.0 and later.
-
For each vector element, calculates the absolute value of
v.Declaration
Objective-C
vFloat vfabf ( vFloat );Import Statement
Objective-C
@import Accelerate;Availability
OS X version 10.0 and later.
-
Computes the floor of values in a vector of floating-point values.
Declaration
Objective-C
vFloat vfloorf ( vFloat );Parameters
AThe input vector.
Return Value
Returns a vector of floating-point values, each of which is the floor of the corresponding value in
A.Import Statement
Objective-C
@import Accelerate;Availability
Available in OS X v10.5 and later.
-
Truncates the decimal portion of a vector of floating-point values.
Declaration
Objective-C
vFloat vintf ( vFloat );Parameters
AThe input vector.
Return Value
Returns a vector of floating-point values, each of which is the result of truncating the fractional portion of the corresponding value in
A.Import Statement
Objective-C
@import Accelerate;Availability
Available in OS X v10.5 and later.
-
Rounds to the nearest integer (nearest even for ties).
Declaration
Objective-C
vFloat vnintf ( vFloat );Parameters
AThe input vector.
Return Value
Returns a vector of floating-point values, each of which is the result of rounding the corresponding value in
Ato the nearest integer, with ties rounded to the nearest even integer.Import Statement
Objective-C
@import Accelerate;Availability
Available in OS X v10.5 and later.
-
Computes the reciprocal of values in a vector.
Declaration
Objective-C
vFloat vrecf ( vFloat );Parameters
AThe source vector
Return Value
Returns a vector containing the reciprocals of the values in the source vector.
Import Statement
Objective-C
@import Accelerate;Availability
Available in OS X v10.5 and later.
-
For each vector element, calculates the inverse of the square root of
X.Declaration
Objective-C
vFloat vrsqrtf ( vFloat );Import Statement
Objective-C
@import Accelerate;Availability
OS X version 10.0 and later.
-
For each vector element, calculates the square root of
X.Declaration
Objective-C
vFloat vsqrtf ( vFloat );Import Statement
Objective-C
@import Accelerate;Availability
OS X version 10.0 and later.
-
For each vector element, calculates the exponential of X.
Declaration
Objective-C
vFloat vexpf ( vFloat );Import Statement
Objective-C
@import Accelerate;Availability
OS X version 10.0 and later.
-
For each vector element, calculates ExpM1(x) = Exp(x) - 1. But, for small enough arguments, ExpM1(x) is expected to be more accurate than Exp(x) - 1.
Declaration
Objective-C
vFloat vexpm1f ( vFloat );Import Statement
Objective-C
@import Accelerate;Availability
OS X version 10.0 and later.
-
For each vector element, calculates the natural logarithm of
X.Declaration
Objective-C
vFloat vlogf ( vFloat );Import Statement
Objective-C
@import Accelerate;Availability
OS X version 10.0 and later.
-
For each vector element, calculates Log1P = Log(1 + x). But, for small enough arguments, Log1P is expected to be more accurate than Log(1 + x).
Declaration
Objective-C
vFloat vlog1pf ( vFloat );Import Statement
Objective-C
@import Accelerate;Availability
OS X version 10.0 and later.
-
Computes the base-10 logarithm of values in a vector.
Declaration
Objective-C
vFloat vlog10f ( vFloat );Parameters
XThe source vector.
Return Value
Returns a vector of floating point values, each of which is the base-10 logarithm of the corresponding value in the source vector.
Import Statement
Objective-C
@import Accelerate;Availability
Available in OS X v10.5 and later.
-
For each vector element, extracts the exponent of
X, as a signed integral value. A subnormal argument is treated as though it were first normalized. Thus: 1 <= x * 2^(-logb(x)) < 2.Declaration
Objective-C
vFloat vlogbf ( vFloat );Import Statement
Objective-C
@import Accelerate;Availability
OS X version 10.0 and later.
-
For each vector element, calculates the sine.
Declaration
Objective-C
vFloat vsinf ( vFloat );Import Statement
Objective-C
@import Accelerate;Availability
OS X version 10.0 and later.
-
For each vector element, calculates the cosine.
Declaration
Objective-C
vFloat vcosf ( vFloat );Import Statement
Objective-C
@import Accelerate;Availability
OS X version 10.0 and later.
-
Simultaneously computes sine and cosine of values in a vector.
Parameters
argThe source vector.
sine_resultAn output vector. On return, this contains the result of
sin(x)for each value (x) in the source vector.Return Value
Returns a vector that contains the result of
cos(x)for each value (x) in the source vector.Import Statement
Objective-C
@import Accelerate;Availability
Available in OS X v10.5 and later.
-
For each vector element, calculates the tangent.
Declaration
Objective-C
vFloat vtanf ( vFloat );Import Statement
Objective-C
@import Accelerate;Availability
OS X version 10.0 and later.
-
For each vector element, calculates the arcsine. Results are in the interval [-pi/2, pi/2].
Declaration
Objective-C
vFloat vasinf ( vFloat );Import Statement
Objective-C
@import Accelerate;Availability
OS X version 10.0 and later.
-
For each vector element, calculates the arccosine. Results are in the interval [0, pi].
Declaration
Objective-C
vFloat vacosf ( vFloat );Import Statement
Objective-C
@import Accelerate;Availability
OS X version 10.0 and later.
-
For each vector element, calculates the arctangent. Results are in the interval [-pi/2, pi/2].
Declaration
Objective-C
vFloat vatanf ( vFloat );Import Statement
Objective-C
@import Accelerate;Availability
OS X version 10.0 and later.
-
For each vector element, calculates the arctangent of
arg2/arg1in the interval [-pi,pi] using the sign of both arguments to determine the quadrant of the computed value.Import Statement
Objective-C
@import Accelerate;Availability
OS X version 10.0 and later.
-
For each vector element, calculates the hyperbolic sine of
X.Declaration
Objective-C
vFloat vsinhf ( vFloat );Import Statement
Objective-C
@import Accelerate;Availability
OS X version 10.0 and later.
-
For each vector element, calculates the hyperbolic cosine of
X.Declaration
Objective-C
vFloat vcoshf ( vFloat );Import Statement
Objective-C
@import Accelerate;Availability
OS X version 10.0 and later.
-
For each vector element, calculates the hyperbolic tangent of
X.Declaration
Objective-C
vFloat vtanhf ( vFloat );Import Statement
Objective-C
@import Accelerate;Availability
OS X version 10.0 and later.
-
For each vector element, calculates the inverse hyperbolic sine of
X.Declaration
Objective-C
vFloat vasinhf ( vFloat );Import Statement
Objective-C
@import Accelerate;Availability
OS X version 10.0 and later.
-
For each vector element, calculates the inverse hyperbolic cosine of
X.Declaration
Objective-C
vFloat vacoshf ( vFloat );Import Statement
Objective-C
@import Accelerate;Availability
OS X version 10.0 and later.
-
For each vector element, calculates the inverse hyperbolic tangent of
X.Declaration
Objective-C
vFloat vatanhf ( vFloat );Import Statement
Objective-C
@import Accelerate;Availability
OS X version 10.0 and later.
-
For each vector element, calculates the remainder of
X/Y, according to the SANE standard. It stores intoQUOthe 7 low-order bits of the integer quotient, such that -127 <=QUO<= 127.Import Statement
Objective-C
@import Accelerate;Availability
OS X version 10.0 and later.
-
For each vector element, returns the class of the argument (one of the FP_ ... constants defined in math.h).
Declaration
Objective-C
vUInt32 vclassifyf ( vFloat );Import Statement
Objective-C
@import Accelerate;Availability
OS X version 10.0 and later.
-
For each vector element, returns a non-zero value if and only if the sign of
argis negative. This includes NaNs, infinities and zeros.Declaration
Objective-C
vUInt32 vsignbitf ( vFloat );Import Statement
Objective-C
@import Accelerate;Availability
OS X version 10.0 and later.
-
For each double-precision array element, sets
yto the ceiling ofx.Declaration
Swift
func vvceil(__: UnsafeMutablePointer<Double>, __: UnsafePointer<Double>, __: UnsafePointer<Int32>)Objective-C
void vvceil ( double *, const double *, const int * );Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
For each single-precision array element, sets
yto the ceiling ofx.Declaration
Swift
func vvceilf(__: UnsafeMutablePointer<Float>, __: UnsafePointer<Float>, __: UnsafePointer<Int32>)Objective-C
void vvceilf ( float *, const float *, const int * );Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
Copies an array, setting the sign of each value based on a second array.
Declaration
Swift
func vvcopysign(_z: UnsafeMutablePointer<Double>, _y: UnsafePointer<Double>, _x: UnsafePointer<Double>, _n: UnsafePointer<Int32>)Objective-C
void vvcopysign ( double *, const double *, const double *, const int * );Parameters
zThe output array.
yThe magnitude input array.
xThe sign input array.
nThe address of an integer containing the number of elements to copy.
Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.7 and later.
-
Copies an array, setting the sign of each value based on a second array.
Declaration
Swift
func vvcopysignf(_result: UnsafeMutablePointer<Float>, _signs: UnsafePointer<Float>, _float: UnsafePointer<Float>, _int: UnsafePointer<Int32>)Objective-C
void vvcopysignf ( float *, const float *, const float *, const int * );Parameters
resultStorage for the result. Modified on return.
signsArray containing values with the desired signs.
floatArray containing values with the desired values.
intThe length of the arrays.
Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.5 and later.
-
For each double-precision array element, sets
ztoy/x.Declaration
Swift
func vvdiv(__: UnsafeMutablePointer<Double>, __: UnsafePointer<Double>, __: UnsafePointer<Double>, __: UnsafePointer<Int32>)Objective-C
void vvdiv ( double *, const double *, const double *, const int * );Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
For each single-precision array element, sets
ztoy/x.Declaration
Swift
func vvdivf(__: UnsafeMutablePointer<Float>, __: UnsafePointer<Float>, __: UnsafePointer<Float>, __: UnsafePointer<Int32>)Objective-C
void vvdivf ( float *, const float *, const float *, const int * );Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
Sets each element
y[i]toabs(x[i]-1)foriin0..n-1.Declaration
Swift
func vvfabs(_y: UnsafeMutablePointer<Double>, _x: UnsafePointer<Double>, _n: UnsafePointer<Int32>)Objective-C
void vvfabs ( double *, const double *, const int * );Parameters
yAn input array of double-precision floating point numbers
xAn output array of double-precision floating point numbers.
nA pointer to an integer containing the number of floating point elements to set.
Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.7 and later.
-
Sets each element
y[i]toabs(x[i]-1)foriin0..n-1.Declaration
Swift
func vvfabsf(_y: UnsafeMutablePointer<Float>, _x: UnsafePointer<Float>, _n: UnsafePointer<Int32>)Objective-C
void vvfabsf ( float *, const float *, const int * );Parameters
yAn input array of single-precision floating point values.
xAn output array of single-precision floating point values.
nA pointer to an integer containing the number of floating point elements to set.
Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.7 and later.
-
For each double-precision array element, sets
yto the floor ofx.Declaration
Swift
func vvfloor(__: UnsafeMutablePointer<Double>, __: UnsafePointer<Double>, __: UnsafePointer<Int32>)Objective-C
void vvfloor ( double *, const double *, const int * );Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
For each single-precision array element, sets
yto the floor ofx.Declaration
Swift
func vvfloorf(__: UnsafeMutablePointer<Float>, __: UnsafePointer<Float>, __: UnsafePointer<Int32>)Objective-C
void vvfloorf ( float *, const float *, const int * );Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
Sets each element
y[i]to the floating point remainder of(y[i]/x[i])foriin0..n-1.Declaration
Swift
func vvfmod(_z: UnsafeMutablePointer<Double>, _y: UnsafePointer<Double>, _x: UnsafePointer<Double>, _n: UnsafePointer<Int32>)Objective-C
void vvfmod ( double *, const double *, const double *, const int * );Parameters
zAn output array of double-precision floating point numbers.
yNumerator input array of double-precision floating point numbers.
xDenominator input array of double-precision floating point numbers.
nA pointer to an integer containing the number of floating point elements to set.
Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.7 and later.
-
Computes the remainders after dividing values in a pair of arrays.
Declaration
Swift
func vvfmodf(_result: UnsafeMutablePointer<Float>, _divisors: UnsafePointer<Float>, _dividends: UnsafePointer<Float>, _count: UnsafePointer<Int32>)Objective-C
void vvfmodf ( float *, const float *, const float *, const int * );Parameters
resultAn array, modified on return, where the results are stored.
divisorsAn array of divisors.
dividendsAn array of dividends.
countThe number of values in the input and result arrays.
Discussion
On return, the
resultarray contains the remainders after calculatingdividend[i] / divisor[i]for each value ofifrom0throughcount-1.Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.5 and later.
-
For each double-precision array element, sets
yto the integer truncation ofx.Declaration
Swift
func vvint(__: UnsafeMutablePointer<Double>, __: UnsafePointer<Double>, __: UnsafePointer<Int32>)Objective-C
void vvint ( double *, const double *, const int * );Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
For each single-precision array element, sets
yto the integer truncation ofx.Declaration
Swift
func vvintf(__: UnsafeMutablePointer<Float>, __: UnsafePointer<Float>, __: UnsafePointer<Int32>)Objective-C
void vvintf ( float *, const float *, const int * );Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
Sets each element
z[i]to the next machine-representable value fromy[i]towardsx[i]foriin0..n-1.Declaration
Swift
func vvnextafter(_z: UnsafeMutablePointer<Double>, _y: UnsafePointer<Double>, _x: UnsafePointer<Double>, _n: UnsafePointer<Int32>)Objective-C
void vvnextafter ( double *, const double *, const double *, const int * );Parameters
zAn output array of double-precision floating point numbers.
yAn input array of double-precision floating point numbers.
xAn input array of double-precision floating point numbers.
nA pointer to an integer containing the number of floating point elements to set.
Discussion
Not all values can be represented as a floating-point value of a given precision. This function sets a value in
z[i]that is either minimally larger than the value iny[i](ifx[i]is larger thany[i]) or minimally smaller than the value iny[i](ifx[i]is smaller thany[i]).Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.7 and later.
-
Sets each element
z[i]to the next machine-representable value fromy[i]towardsx[i]foriin0..n-1.Declaration
Swift
func vvnextafterf(_z: UnsafeMutablePointer<Float>, _y: UnsafePointer<Float>, _x: UnsafePointer<Float>, _n: UnsafePointer<Int32>)Objective-C
void vvnextafterf ( float *, const float *, const float *, const int * );Parameters
zAn array where results are stored on return.
yAn array of floating-point values providing the direction relative to
x.xAn array of floating-point values providing the starting point.
nA pointer to an integer containing the number of elements to process.
Discussion
Not all values can be represented as a floating-point value of a given precision. This function sets a value in
z[i]that is either minimally larger than the value iny[i](ifx[i]is larger thany[i]) or minimally smaller than the value iny[i](ifx[i]is smaller thany[i]).Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.5 and later.
-
For each double-precision array element, sets
yto the nearest integer tox.Declaration
Swift
func vvnint(__: UnsafeMutablePointer<Double>, __: UnsafePointer<Double>, __: UnsafePointer<Int32>)Objective-C
void vvnint ( double *, const double *, const int * );Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
For each single-precision array element, sets
yto the nearest integer tox.Declaration
Swift
func vvnintf(__: UnsafeMutablePointer<Float>, __: UnsafePointer<Float>, __: UnsafePointer<Int32>)Objective-C
void vvnintf ( float *, const float *, const int * );Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
For each double-precision array element, sets
yto the reciprocal of the square root ofx.Declaration
Swift
func vvrsqrt(__: UnsafeMutablePointer<Double>, __: UnsafePointer<Double>, __: UnsafePointer<Int32>)Objective-C
void vvrsqrt ( double *, const double *, const int * );Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
For each single-precision array element, sets
yto the reciprocal of the square root ofx.Declaration
Swift
func vvrsqrtf(__: UnsafeMutablePointer<Float>, __: UnsafePointer<Float>, __: UnsafePointer<Int32>)Objective-C
void vvrsqrtf ( float *, const float *, const int * );Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
For each double-precision array element, sets
yto the square root ofx.Declaration
Swift
func vvsqrt(__: UnsafeMutablePointer<Double>, __: UnsafePointer<Double>, __: UnsafePointer<Int32>)Objective-C
void vvsqrt ( double *, const double *, const int * );Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
For each single-precision array element, sets
yto the square root ofx.Declaration
Swift
func vvsqrtf(__: UnsafeMutablePointer<Float>, __: UnsafePointer<Float>, __: UnsafePointer<Int32>)Objective-C
void vvsqrtf ( float *, const float *, const int * );Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
For each double-precision array element, sets
yto the reciprocal ofy.Declaration
Swift
func vvrec(__: UnsafeMutablePointer<Double>, __: UnsafePointer<Double>, __: UnsafePointer<Int32>)Objective-C
void vvrec ( double *, const double *, const int * );Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
For each single-precision array element, sets
yto the reciprocal ofy.Declaration
Swift
func vvrecf(__: UnsafeMutablePointer<Float>, __: UnsafePointer<Float>, __: UnsafePointer<Int32>)Objective-C
void vvrecf ( float *, const float *, const int * );Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
Sets
z[i]to the remainder relative to a round-to-even division ofy[i]/x[i]for eachiin0..n-1.Declaration
Swift
func vvremainder(_z: UnsafeMutablePointer<Double>, _y: UnsafePointer<Double>, _x: UnsafePointer<Double>, _n: UnsafePointer<Int32>)Objective-C
void vvremainder ( double *, const double *, const double *, const int * );Parameters
zAn array for storing the results.
yAn array of divisors.
xAn array of dividends.
nA pointer to an integer containing the number of elements to process.
Discussion
This function performs the equivalent of
vnintffor each dividend/divisor pair, then multiplies the result by the divisor, and subtracts the result from the dividend.Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.7 and later.
-
Computes the remainder relative to a round-to-even division.
Declaration
Swift
func vvremainderf(_results: UnsafeMutablePointer<Float>, _divisors: UnsafePointer<Float>, _dividends: UnsafePointer<Float>, _count: UnsafePointer<Int32>)Objective-C
void vvremainderf ( float *, const float *, const float *, const int * );Parameters
resultsAn array for storing the results.
divisorsAn array of divisors.
dividendsAn array of dividends.
countA pointer to an integer containing the number of elements to process.
Discussion
This function performs the equivalent of
vnintffor each dividend/divisor pair, then multiplies the result by the divisor, and subtracts the result from the dividend.Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.5 and later.
-
For each double-precision array element, sets
yto the exponential ofx.Declaration
Swift
func vvexp(__: UnsafeMutablePointer<Double>, __: UnsafePointer<Double>, __: UnsafePointer<Int32>)Objective-C
void vvexp ( double *, const double *, const int * );Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
For each single-precision array element, sets
yto the exponential ofx.Declaration
Objective-C
void vvexpf ( float *, const float *, const int * );Import Statement
Objective-C
#include <vForce.h>;Availability
Available in OS X v10.4 and later.
-
Sets each element
y[i]to2raised to(x[i])foriin0..n-1.Declaration
Swift
func vvexp2(_y: UnsafeMutablePointer<Double>, _x: UnsafePointer<Double>, _n: UnsafePointer<Int32>)Objective-C
void vvexp2 ( double *, const double *, const int * );Parameters
yAn input array of double-precision floating point numbers
xAn output array of double-precision floating point numbers.
nA pointer to an integer containing the number of floating point elements to set.
Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.7 and later.
-
Sets each element
y[i]to2raised to(x[i])foriin0..n-1.Declaration
Swift
func vvexp2f(_y: UnsafeMutablePointer<Float>, _x: UnsafePointer<Float>, _n: UnsafePointer<Int32>)Objective-C
void vvexp2f ( float *, const float *, const int * );Parameters
yAn input array of single-precision floating point values.
xAn output array of single-precision floating point values.
nA pointer to an integer containing the number of floating point elements to set.
Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.7 and later.
-
Returns
(e^x)-1for each elementy[i].Declaration
Swift
func vvexpm1(_y: UnsafeMutablePointer<Double>, _x: UnsafePointer<Double>, _n: UnsafePointer<Int32>)Objective-C
void vvexpm1 ( double *, const double *, const int * );Parameters
yAn input array of double-precision floating point numbers
xAn output array of double-precision floating point numbers.
nA pointer to an integer containing the number of floating point elements to set.
Discussion
This is accurate for very small values of
x[i].Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.7 and later.
-
Computes
(e^x)-1for each element in an array.Declaration
Swift
func vvexpm1f(_result: UnsafeMutablePointer<Float>, _src: UnsafePointer<Float>, _count: UnsafePointer<Int32>)Objective-C
void vvexpm1f ( float *, const float *, const int * );Parameters
resultAn array, modified on return, where the results are stored.
srcThe input array.
countThe number of values in the input and result arrays.
Discussion
Provides additional accuracy for values of
xnear-1.Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.5 and later.
-
For each double-precision array element, sets
yto the natural logarithm ofx.Declaration
Swift
func vvlog(__: UnsafeMutablePointer<Double>, __: UnsafePointer<Double>, __: UnsafePointer<Int32>)Objective-C
void vvlog ( double *, const double *, const int * );Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
For each single-precision array element, sets
yto the natural logarithm ofx.Declaration
Swift
func vvlogf(__: UnsafeMutablePointer<Float>, __: UnsafePointer<Float>, __: UnsafePointer<Int32>)Objective-C
void vvlogf ( float *, const float *, const int * );Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
Sets each element
y[i]tolog(1+x[i])foriin0..n-1.Declaration
Swift
func vvlog1p(_y: UnsafeMutablePointer<Double>, _x: UnsafePointer<Double>, _n: UnsafePointer<Int32>)Objective-C
void vvlog1p ( double *, const double *, const int * );Parameters
yAn output array of double-precision floating point numbers.
xAn input array of double-precision floating point numbers.
nA pointer to an integer containing the number of floating point elements to set.
Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.7 and later.
-
Computes the natural logarithm of a value plus 1.
Declaration
Swift
func vvlog1pf(_results: UnsafeMutablePointer<Float>, _values: UnsafePointer<Float>, _count: UnsafePointer<Int32>)Objective-C
void vvlog1pf ( float *, const float *, const int * );Parameters
resultsAn array where results are stored on return.
valuesThe source array.
countA pointer to an integer containing the number of elements to process.
Discussion
This algorithm computes
log(1+x)for each element
xin the source array.This algorithm is tuned to provide increased accuracy for values of
xnear1.Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.5 and later.
-
Sets each element
y[i]to the base-2 logarithm ofx[i]foriin0..n-1.Declaration
Swift
func vvlog2(_y: UnsafeMutablePointer<Double>, _x: UnsafePointer<Double>, _n: UnsafePointer<Int32>)Objective-C
void vvlog2 ( double *, const double *, const int * );Parameters
yAn output array of double-precision floating point numbers.
xAn input array of double-precision floating point numbers.
nA pointer to an integer containing the number of floating point elements to set.
Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.7 and later.
-
Sets each element
y[i]to the base 2 logarithm ofx[i]foriin0..n-1.Declaration
Swift
func vvlog2f(_y: UnsafeMutablePointer<Float>, _x: UnsafePointer<Float>, _n: UnsafePointer<Int32>)Objective-C
void vvlog2f ( float *, const float *, const int * );Parameters
yAn output array of single-precision floating point numbers.
xAn input array of single-precision floating point numbers.
nA pointer to an integer containing the number of floating point elements to set.
Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.7 and later.
-
For each double-precision array element, sets
yto the base 10 logarithm ofx.Declaration
Swift
func vvlog10(__: UnsafeMutablePointer<Double>, __: UnsafePointer<Double>, __: UnsafePointer<Int32>)Objective-C
void vvlog10 ( double *, const double *, const int * );Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
For each single-precision array element, sets
yto the base 10 logarithm ofx.Declaration
Swift
func vvlog10f(__: UnsafeMutablePointer<Float>, __: UnsafePointer<Float>, __: UnsafePointer<Int32>)Objective-C
void vvlog10f ( float *, const float *, const int * );Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
Sets each element
y[i]to the exponent ofx[i]foriin0..n-1.Declaration
Swift
func vvlogb(_y: UnsafeMutablePointer<Double>, _x: UnsafePointer<Double>, _n: UnsafePointer<Int32>)Objective-C
void vvlogb ( double *, const double *, const int * );Parameters
yAn output array of double-precision floating point numbers.
xAn input array of double-precision floating point numbers.
nA pointer to an integer containing the number of floating point elements to set.
Discussion
Floating point numbers are internally represented as a mantissa multiplied times a base raised to an exponent. That exponent is returned in the output array.
Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.7 and later.
-
Sets each element
y[i]to the exponent ofx[i]foriin0..n-1.Declaration
Swift
func vvlogbf(_y: UnsafeMutablePointer<Float>, _x: UnsafePointer<Float>, _n: UnsafePointer<Int32>)Objective-C
void vvlogbf ( float *, const float *, const int * );Parameters
yAn array where results are stored on return.
xThe source array.
nA pointer to an integer containing the number of elements to process.
Discussion
Floating point numbers are internally represented as a mantissa multiplied times a base raised to an exponent. That exponent is returned in the output array.
Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.5 and later.
-
For each single-precision array element, sets
ztoxraised to the power ofy.Declaration
Swift
func vvpowf(__: UnsafeMutablePointer<Float>, __: UnsafePointer<Float>, __: UnsafePointer<Float>, __: UnsafePointer<Int32>)Objective-C
void vvpowf ( float *, const float *, const float *, const int * );Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
For each double-precision array element, sets
ztoxraised to the power ofy.Declaration
Swift
func vvpow(__: UnsafeMutablePointer<Double>, __: UnsafePointer<Double>, __: UnsafePointer<Double>, __: UnsafePointer<Int32>)Objective-C
void vvpow ( double *, const double *, const double *, const int * );Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
For each double-precision array element, sets
yto the sine ofx.Declaration
Swift
func vvsin(__: UnsafeMutablePointer<Double>, __: UnsafePointer<Double>, __: UnsafePointer<Int32>)Objective-C
void vvsin ( double *, const double *, const int * );Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
For each single-precision array element, sets
yto the sine ofx.Declaration
Swift
func vvsinf(__: UnsafeMutablePointer<Float>, __: UnsafePointer<Float>, __: UnsafePointer<Int32>)Objective-C
void vvsinf ( float *, const float *, const int * );Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
Sets
y[i]tosin(pi * x[i])foriin0..n-1.Declaration
Swift
func vvsinpi(_y: UnsafeMutablePointer<Double>, _x: UnsafePointer<Double>, _n: UnsafePointer<Int32>)Objective-C
void vvsinpi ( double *, const double *, const int * );Parameters
yAn array where results are stored on return.
xThe source array.
nA pointer to an integer containing the number of elements to process.
Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.7 and later.
-
Sets
y[i]tosin(pi * x[i])foriin0..n-1.Declaration
Swift
func vvsinpif(_y: UnsafeMutablePointer<Float>, _x: UnsafePointer<Float>, _n: UnsafePointer<Int32>)Objective-C
void vvsinpif ( float *, const float *, const int * );Parameters
yAn array where results are stored on return.
xThe source array.
nA pointer to an integer containing the number of elements to process.
Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.7 and later.
-
For each double-precision array element, sets
yto the cosine ofx.Declaration
Swift
func vvcos(__: UnsafeMutablePointer<Double>, __: UnsafePointer<Double>, __: UnsafePointer<Int32>)Objective-C
void vvcos ( double *, const double *, const int * );Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
For each single-precision array element, sets
yto the cosine ofx.Declaration
Swift
func vvcosf(__: UnsafeMutablePointer<Float>, __: UnsafePointer<Float>, __: UnsafePointer<Int32>)Objective-C
void vvcosf ( float *, const float *, const int * );Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
Sets each element
y[i]to thesin(pi * x[i])foriin0..n-1.Declaration
Swift
func vvcospi(_y: UnsafeMutablePointer<Double>, _x: UnsafePointer<Double>, _n: UnsafePointer<Int32>)Objective-C
void vvcospi ( double *, const double *, const int * );Parameters
yAn input array of double-precision floating point numbers
xAn output array of double-precision floating point numbers.
nA pointer to an integer containing the number of floating point elements to set.
Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.7 and later.
-
Sets each element
y[i]to thesin(pi * x[i])foriin0..n-1.Declaration
Swift
func vvcospif(_y: UnsafeMutablePointer<Float>, _x: UnsafePointer<Float>, _n: UnsafePointer<Int32>)Objective-C
void vvcospif ( float *, const float *, const int * );Parameters
yAn input array of single-precision floating point values.
xAn output array of single-precision floating point values.
nA pointer to an integer containing the number of floating point elements to set.
Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.7 and later.
-
For each double-precision array element, sets the real part of
Cto the cosine ofxand the imaginary part ofCto the sine ofx, fornelements.Declaration
Swift
func vvcosisin(__: COpaquePointer, __: UnsafePointer<Double>, __: UnsafePointer<Int32>)Objective-C
void vvcosisin ( __double_complex_t *, const double *, const int * );Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
For each single-precision array element, sets the real part of
Cto the cosine ofxand the imaginary part ofCto the sine ofx, fornelements.Declaration
Swift
func vvcosisinf(__: COpaquePointer, __: UnsafePointer<Float>, __: UnsafePointer<Int32>)Objective-C
void vvcosisinf ( __float_complex_t *, const float *, const int * );Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
For each double-precision array element, sets
zto the sine ofxandyto the cosine ofx.Declaration
Swift
func vvsincos(__: UnsafeMutablePointer<Double>, __: UnsafeMutablePointer<Double>, __: UnsafePointer<Double>, __: UnsafePointer<Int32>)Objective-C
void vvsincos ( double *, double *, const double *, const int * );Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
For each single-precision array element, sets
zto the sine ofxandyto the cosine ofx.Declaration
Swift
func vvsincosf(__: UnsafeMutablePointer<Float>, __: UnsafeMutablePointer<Float>, __: UnsafePointer<Float>, __: UnsafePointer<Int32>)Objective-C
void vvsincosf ( float *, float *, const float *, const int * );Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
For each double-precision array element, sets
yto the tangent ofx.Declaration
Swift
func vvtan(__: UnsafeMutablePointer<Double>, __: UnsafePointer<Double>, __: UnsafePointer<Int32>)Objective-C
void vvtan ( double *, const double *, const int * );Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
For each single-precision array element, sets
yto the tangent ofx.Declaration
Swift
func vvtanf(__: UnsafeMutablePointer<Float>, __: UnsafePointer<Float>, __: UnsafePointer<Int32>)Objective-C
void vvtanf ( float *, const float *, const int * );Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
Sets
y[i]totan(pi * x[i])foriin0..n-1.Declaration
Swift
func vvtanpi(_y: UnsafeMutablePointer<Double>, _x: UnsafePointer<Double>, _n: UnsafePointer<Int32>)Objective-C
void vvtanpi ( double *, const double *, const int * );Parameters
yAn array where results are stored on return.
xThe source array.
nA pointer to an integer containing the number of elements to process.
Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.7 and later.
-
Sets
y[i]totan(pi * x[i])foriin0..n-1.Declaration
Swift
func vvtanpif(_y: UnsafeMutablePointer<Float>, _x: UnsafePointer<Float>, _n: UnsafePointer<Int32>)Objective-C
void vvtanpif ( float *, const float *, const int * );Parameters
yAn array where results are stored on return.
xThe source array.
nA pointer to an integer containing the number of elements to process.
Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.7 and later.
-
For each double-precision array element, sets
yto the arcsine ofx.Declaration
Swift
func vvasin(__: UnsafeMutablePointer<Double>, __: UnsafePointer<Double>, __: UnsafePointer<Int32>)Objective-C
void vvasin ( double *, const double *, const int * );Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
For each single-precision array element, sets
yto the arcsine ofx.Declaration
Swift
func vvasinf(__: UnsafeMutablePointer<Float>, __: UnsafePointer<Float>, __: UnsafePointer<Int32>)Objective-C
void vvasinf ( float *, const float *, const int * );Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
For each double-precision array element, sets
yto the arccosine ofx.Declaration
Swift
func vvacos(__: UnsafeMutablePointer<Double>, __: UnsafePointer<Double>, __: UnsafePointer<Int32>)Objective-C
void vvacos ( double *, const double *, const int * );Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
For each single-precision array element, sets
yto the arccosine ofx.Declaration
Swift
func vvacosf(__: UnsafeMutablePointer<Float>, __: UnsafePointer<Float>, __: UnsafePointer<Int32>)Objective-C
void vvacosf ( float *, const float *, const int * );Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
For each double-precision array element, sets
yto the arctangent ofx.Declaration
Swift
func vvatan(__: UnsafeMutablePointer<Double>, __: UnsafePointer<Double>, __: UnsafePointer<Int32>)Objective-C
void vvatan ( double *, const double *, const int * );Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
For each single-precision array element, sets
yto the arctangent ofx.Declaration
Swift
func vvatanf(__: UnsafeMutablePointer<Float>, __: UnsafePointer<Float>, __: UnsafePointer<Int32>)Objective-C
void vvatanf ( float *, const float *, const int * );Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
For each double-precision array element, sets
zto the arctangent ofy/x.Declaration
Swift
func vvatan2(__: UnsafeMutablePointer<Double>, __: UnsafePointer<Double>, __: UnsafePointer<Double>, __: UnsafePointer<Int32>)Objective-C
void vvatan2 ( double *, const double *, const double *, const int * );Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
For each single-precision array element, sets
zto the arctangent ofy/x.Declaration
Swift
func vvatan2f(__: UnsafeMutablePointer<Float>, __: UnsafePointer<Float>, __: UnsafePointer<Float>, __: UnsafePointer<Int32>)Objective-C
void vvatan2f ( float *, const float *, const float *, const int * );Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
For each single-precision array element, sets
yto the hyperbolic sine ofx.Declaration
Swift
func vvsinhf(__: UnsafeMutablePointer<Float>, __: UnsafePointer<Float>, __: UnsafePointer<Int32>)Objective-C
void vvsinhf ( float *, const float *, const int * );Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
For each double-precision array element, sets
yto the hyperbolic sine ofx.Declaration
Swift
func vvsinh(__: UnsafeMutablePointer<Double>, __: UnsafePointer<Double>, __: UnsafePointer<Int32>)Objective-C
void vvsinh ( double *, const double *, const int * );Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
For each single-precision array element, sets
yto the hyperbolic cosine ofx.Declaration
Swift
func vvcoshf(__: UnsafeMutablePointer<Float>, __: UnsafePointer<Float>, __: UnsafePointer<Int32>)Objective-C
void vvcoshf ( float *, const float *, const int * );Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
For each double-precision array element, sets
yto the hyperbolic cosine ofx.Declaration
Swift
func vvcosh(__: UnsafeMutablePointer<Double>, __: UnsafePointer<Double>, __: UnsafePointer<Int32>)Objective-C
void vvcosh ( double *, const double *, const int * );Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
For each single-precision array element, sets
yto the hyperbolic tangent ofx.Declaration
Swift
func vvtanhf(__: UnsafeMutablePointer<Float>, __: UnsafePointer<Float>, __: UnsafePointer<Int32>)Objective-C
void vvtanhf ( float *, const float *, const int * );Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
For each double-precision array element, sets
yto the hyperbolic tangent ofx.Declaration
Swift
func vvtanh(__: UnsafeMutablePointer<Double>, __: UnsafePointer<Double>, __: UnsafePointer<Int32>)Objective-C
void vvtanh ( double *, const double *, const int * );Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
For each single-precision array element, sets
yto the inverse hyperbolic sine ofx.Declaration
Swift
func vvasinhf(__: UnsafeMutablePointer<Float>, __: UnsafePointer<Float>, __: UnsafePointer<Int32>)Objective-C
void vvasinhf ( float *, const float *, const int * );Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
For each double-precision array element, sets
yto the inverse hyperbolic sine ofx.Declaration
Swift
func vvasinh(__: UnsafeMutablePointer<Double>, __: UnsafePointer<Double>, __: UnsafePointer<Int32>)Objective-C
void vvasinh ( double *, const double *, const int * );Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
For each single-precision array element, sets
yto the inverse hyperbolic cosine ofx.Declaration
Swift
func vvacoshf(__: UnsafeMutablePointer<Float>, __: UnsafePointer<Float>, __: UnsafePointer<Int32>)Objective-C
void vvacoshf ( float *, const float *, const int * );Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
For each double-precision array element, sets
yto the inverse hyperbolic cosine ofx.Declaration
Swift
func vvacosh(__: UnsafeMutablePointer<Double>, __: UnsafePointer<Double>, __: UnsafePointer<Int32>)Objective-C
void vvacosh ( double *, const double *, const int * );Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
For each single-precision array element, sets
yto the inverse hyperbolic tangent ofx.Declaration
Swift
func vvatanhf(__: UnsafeMutablePointer<Float>, __: UnsafePointer<Float>, __: UnsafePointer<Int32>)Objective-C
void vvatanhf ( float *, const float *, const int * );Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
For each double-precision array element, sets
yto the inverse hyperbolic tangent ofx.Declaration
Swift
func vvatanh(__: UnsafeMutablePointer<Double>, __: UnsafePointer<Double>, __: UnsafePointer<Int32>)Objective-C
void vvatanh ( double *, const double *, const int * );Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
Unsigned 1024-bit subtraction with saturation (clipping).
Declaration
Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
OS X version 10.0 and later.
-
Signed 1024-bit subtraction with saturation (clipping).
Declaration
Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
OS X version 10.0 and later.
-
Unsigned 256-bit negation.
Declaration
Parameters
vAThe value to negate.
Return Value
Returns the negated value.
Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
OS X version 10.0 and later.
-
Signed 256-bit negation.
Declaration
Parameters
aThe value to negate.
Return Value
Returns the negated value through the result parameter.
Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
OS X version 10.0 and later.
-
Unsigned 512-bit negation.
Declaration
Parameters
aThe value to negate.
Return Value
Returns the negated value through the result parameter.
Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
OS X version 10.0 and later.
-
Signed 512-bit negation.
Declaration
Parameters
aThe value to negate.
Return Value
Returns the negated value through the result parameter.
Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
OS X version 10.0 and later.
-
Unsigned 1024-bit negation.
Declaration
Parameters
aThe value to negate.
Return Value
Returns the negated value through the result parameter.
Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
OS X version 10.0 and later.
-
Signed 1024-bit negation.
Declaration
Parameters
aThe value to negate.
Return Value
Returns the negated value through the result parameter.
Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
OS X version 10.0 and later.
-
Unsigned 256-bit multiplication; result is the same width as multiplicands.
Declaration
Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
OS X version 10.0 and later.
-
Signed 256-bit multiplication; result is the same width as multiplicands.
Declaration
Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
OS X version 10.0 and later.
-
Unsigned 512-bit multiplication; result is the same width as multiplicands.
Declaration
Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
OS X version 10.0 and later.
-
Signed 512-bit multiplication; result is the same width as multiplicands.
Declaration
Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
OS X version 10.0 and later.
-
Unsigned 1024-bit multiplication; result is the same width as multiplicands.
Declaration
Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
OS X version 10.0 and later.
-
Signed 1024-bit multiplication; result is the same width as multiplicands.
Declaration
Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
OS X version 10.0 and later.
-
Unsigned 128-bit multiplication; result is twice as wide as multiplicands.
Declaration
Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
OS X version 10.0 and later.
-
Signed 128-bit multiplication; result is twice as wide as multiplicands.
Declaration
Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
OS X version 10.0 and later.
-
Unsigned 256-bit multiplication; result is twice as wide as multiplicands.
Declaration
Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
OS X version 10.0 and later.
-
Signed 256-bit multiplication; result is twice as wide as multiplicands.
Declaration
Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
OS X version 10.0 and later.
-
Unsigned 512-bit multiplication; result is twice as wide as multiplicands.
Declaration
Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
OS X version 10.0 and later.
-
Signed 512-bit multiplication; result is twice as wide as multiplicands.
Declaration
Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
OS X version 10.0 and later.
-
Unsigned 256-bit division.
Declaration
Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
OS X version 10.0 and later.
-
Signed 256-bit division.
Declaration
Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
OS X version 10.0 and later.
-
Unsigned 512-bit division.
Declaration
Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
OS X version 10.0 and later.
-
Signed 512-bit division.
Declaration
Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
OS X version 10.0 and later.
-
Unsigned 1024-bit division.
Declaration
Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
OS X version 10.0 and later.
-
Signed 1024-bit division.
Declaration
Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
OS X version 10.0 and later.
-
Finds the position of the first vector element having the largest absolute value.
Declaration
Swift
func vIsamax(_count: Int32, _x: COpaquePointer) -> Int32Objective-C
int32_t vIsamax ( int32_t count, const vFloat x[] );Parameters
countNumber of elements in the vector
x; must be a multiple of 4.xA vector array of
floatvalues.Return Value
The index of the first element having the largest absolute value in the vector.
Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
OS X version 10.0 and later.
-
Finds the position of the first vector element having the smallest absolute value.
Declaration
Swift
func vIsamin(_count: Int32, _x: COpaquePointer) -> Int32Objective-C
int32_t vIsamin ( int32_t count, const vFloat x[] );Parameters
countNumber of elements in the vector
x; must be a multiple of 4.xA vector array of
floatvalues.Return Value
The index of the first element having the smallest absolute value in the vector.
Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
OS X version 10.0 and later.
-
Finds the position of the first vector element having the maximum value.
Declaration
Swift
func vIsmax(_count: Int32, _x: COpaquePointer) -> Int32Objective-C
int32_t vIsmax ( int32_t count, const vFloat x[] );Parameters
countNumber of elements in the vector
x; must be a multiple of 4.xA vector array of
floatvalues.Return Value
The index of the first element having the maximum value in the vector.
Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
OS X version 10.0 and later.
-
Finds the position of the first vector element having the minimum value.
Declaration
Swift
func vIsmin(_count: Int32, _x: COpaquePointer) -> Int32Objective-C
int32_t vIsmin ( int32_t count, const vFloat x[] );Parameters
countNumber of elements in the vector
x; must be a multiple of 4.xA vector array of
floatvalues.Return Value
The index of the first element having the minimum value in the vector.
Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
OS X version 10.0 and later.
-
Finds the sum of the absolute values of the elements in a vector.
Declaration
Swift
func vSasum(_count: Int32, _x: COpaquePointer) -> FloatObjective-C
float vSasum ( int32_t count, const vFloat x[] );Parameters
countNumber of elements in the vector
x; must be a multiple of 4.xA vector array of
floatvalues.Return Value
The sum of the absolute values of the elements in the vector.
Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
OS X version 10.0 and later.
-
Finds the sum of the values of the elements in a vector.
Declaration
Swift
func vSsum(_count: Int32, _x: COpaquePointer) -> FloatObjective-C
float vSsum ( int32_t count, const vFloat x[] );Parameters
countNumber of elements in the vector
x; must be a multiple of 4.xA vector array of
floatvalues.Return Value
The sum of the values of the elements in the vector.
Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
OS X version 10.0 and later.
-
Multiplies a vector by a scalar , adds it to a second vector , and stores the result in the second vector.
Declaration
Swift
func vSaxpy(_n: Int32, _alpha: Float, _x: COpaquePointer, _y: COpaquePointer)Parameters
nNumber of elements in each of the vectors
xandy; must be a multiple of 4.alphaA multiplier for the vector
x.xA vector array of
floatvalues.yA second vector array of
floatvalues.Discussion
The elements of
xare multiplied byalphaand added to the corresponding elements ofy. The results are stored iny.Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
OS X version 10.0 and later.
-
Performs the computation of
vSaxpyntimes, using a different multiplier each time.Declaration
Swift
func vSnaxpy(_n: Int32, _m: Int32, _a: COpaquePointer, _x: COpaquePointer, _y: COpaquePointer)Parameters
nNumber of elements in vector
a; must be a multiple of 4.mNumber of elements in each of the vectors
xandy; must be a multiple of 4.xA vector array of
floatvalues.yA second vector array of
floatvalues.Discussion
For i = 0 to n-1, the elements of
xare multiplied bya[i] and added to the corresponding elements ofy. The results are accumulated and stored iny.Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
OS X version 10.0 and later.
-
Copies one vector to another.
Declaration
Swift
func vScopy(_n: Int32, _x: COpaquePointer, _y: COpaquePointer)Parameters
nNumber of elements in vectors
xandy; must be a multiple of 4.xA vector array of
floatvalues.yA second vector array of
floatvalues.Discussion
The elements of
xare copied to the corresponding elements ofy.Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
OS X version 10.0 and later.
-
Computes the dot product of two vectors.
Declaration
Swift
func vSdot(_n: Int32, _x: COpaquePointer, _y: COpaquePointer) -> FloatParameters
nNumber of elements in vectors
xandy; must be a multiple of 4.xA vector array of
floatvalues.yA second vector array of
floatvalues.Return Value
The dot product of the two vectors.
Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
OS X version 10.0 and later.
-
Computes the dot products of n pairs of vectors, accumulating or storing the results in an array of
nfloatvalues.Declaration
Swift
func vSndot(_n: Int32, _m: Int32, _s: UnsafeMutablePointer<Float>, _isw: Int32, _x: COpaquePointer, _y: COpaquePointer)Parameters
nNumber of dot products to compute, and number of elements in vector
s; must be a multiple of 4.mNumber of elements in the vectors whose dot products are computed; must be a multiple of 4.
sDestination vector; the
ndot products are accumulated or stored here.iswA key that selects one of the four variants of this function: see Discussion below.
xA matrix whose rows are
nfloating-point vectors, each containingmvalues.yA second matrix whose rows are
nfloating-point vectors, each containingmvalues.Discussion
For i = 0 to n-1, the dot product of vectors
x[i] andy[i] is computed. The dot product is accumulated or stored ins[i], according to the value ofisw:if
isw= 1, the dot product is stored ins[i].if
isw= 2, the dot product is negated and then stored ins[i].if
isw= 3, the dot product is added to the value ins[i].if
isw= 4, the dot product is negated and then added to the value ins[i].
Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
OS X version 10.0 and later.
-
Finds the Euclidean length of a vector.
Declaration
Swift
func vSnrm2(_count: Int32, _x: COpaquePointer) -> FloatObjective-C
float vSnrm2 ( int32_t count, const vFloat x[] );Parameters
countNumber of elements in the vector
x; must be a multiple of 4.xA vector array of
floatvalues.Return Value
The Euclidean length of
x.Discussion
Input is scaled to avoid destructive underflow and overflow.
Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
OS X version 10.0 and later.
-
Finds the Euclidean length of a vector.
Declaration
Swift
func vSnorm2(_count: Int32, _x: COpaquePointer) -> FloatObjective-C
float vSnorm2 ( int32_t count, const vFloat x[] );Parameters
countNumber of elements in the vector
x; must be a multiple of 4.xA vector array of
floatvalues.Return Value
The Euclidean length of
x.Discussion
Input is not scaled.
Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
OS X version 10.0 and later.
-
Applies planar rotation to a set of n points whose x and y coordinates are contained in two arrays of vectors.
Declaration
Swift
func vSrot(_n: Int32, _x: COpaquePointer, _y: COpaquePointer, _c: Float, _s: Float)Parameters
nnumber of points to be rotated; must be a multiple of 4.
xvector with
n/4 elements of typevector float, representing the x-coordinates of the points.yvector with
n/4 elements of typevector float, representing the y-coordinates of the points.ccosine of the angle of rotation.
ssine of the angle of rotation.
Discussion
The coordinates are modified in place in the vectors in arrays
xandy.Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
OS X version 10.0 and later.
-
Scales a vector in place.
Declaration
Swift
func vSscal(_n: Int32, _alpha: Float, _v: COpaquePointer)Objective-C
void vSscal ( int32_t n, float alpha, vFloat x[] );Parameters
nnumber of elements in vector
x; must be a multiple of 4.alphascaling factor.
vvector with
nelements of typefloat.Discussion
Each element of vector
xis multiplied in place byalpha.Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
OS X version 10.0 and later.
-
Interchanges the elements of two vectors.
Declaration
Swift
func vSswap(_n: Int32, _x: COpaquePointer, _y: COpaquePointer)Parameters
nnumber of elements in vectors
xandy; must be a multiple of 4.xvector with
nelements of typefloat.yvector with
nelements of typefloat.Discussion
Each element of vector
xis replaced by the corresponding element ofy, and vice versa.Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
OS X version 10.0 and later.
-
Multiplies each element of a vector and stores the results in a second vector.
Declaration
Swift
func vSyax(_n: Int32, _alpha: Float, _x: COpaquePointer, _y: COpaquePointer)Parameters
nnumber of elements in vectors
xandy; must be a multiple of 4.alphamultiplier.
xsource vector with
nelements of typefloat.ydestination vector with
nelements of typefloat.Discussion
Each element of vector
xis multiplied byalpha, and stored in the corresponding element ofy.Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
OS X version 10.0 and later.
-
Multiplies a vector by a scalar, adds it to a second vector, and stores the result in a third vector.
Declaration
Swift
func vSzaxpy(_n: Int32, _alpha: Float, _x: COpaquePointer, _yY: COpaquePointer, _z: COpaquePointer)Parameters
nnumber of elements in vectors
x,y, andz; must be a multiple of 4.alphamultiplier.
xsource vector with
nelements of typefloat.yYsource vector with
nelements of typefloat.zdestination vector with
nelements of typefloat.Discussion
Each element of vector
xis multiplied byalpha, then the corresponding element ofyYis added. Results are stored in the corresponding elements ofz.Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
OS X version 10.0 and later.
-
Multiplies a vector by a scalar. Multiplies a matrix by another scalar, then by a second vector, and adds the resulting vector to the first vector. This function can also perform the calculation with the transpose of the original matrix instead of the matrix itself. A selector parameter determines whether the transpose is used.
Declaration
Swift
func vSgemv(_forma: Int8, _m: Int32, _n: Int32, _alpha: Float, _a: COpaquePointer, _x: COpaquePointer, _beta: Float, _y: COpaquePointer)Parameters
formaselects the variant computation to be performed: ‘T’ causes the transpose of matrix
ato be used, ‘N’ causesaitself to be used.mnumber of rows in
a. Ifforma= ‘N’,mis the length of vectory; ifforma= ‘T’,mis the length of vectorx; must be a multiple of 4.nnumber of columns in
a. Ifforma= ‘N’,mis the length of vectorx; ifforma= ‘T’,mis the length of vectory; must be a multiple of 4.alphascalar multiplier for matrix
a.ambynmatrix with elements of typefloat.xvector with elements of type
float.betascalar multiplier for vector
y.ydestination vector with
nelements of typefloat.Discussion
Vector
yis multiplied bybeta. Matrixais multiplied byalpha. Then ifforma= ‘N’,ais multiplied by vectorx; ifforma= ‘T’, the transpose ofais multiplied byx. The resulting vector is added to vectory, and the results are stored iny.Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
OS X version 10.0 and later.
-
Multiplies a matrix by a scalar and then by a vector, and adds the resulting vector to a second vector.
Declaration
Swift
func vSgemx(_m: Int32, _n: Int32, _alpha: Float, _a: COpaquePointer, _x: COpaquePointer, _y: COpaquePointer)Parameters
mnumber of rows in
a, and the length of vectory; must be a multiple of 4.nnumber of columns in
a, and the length of vectorx; must be a multiple of 4.alphascalar multiplier for matrix
a.ambynmatrix with elements of typefloat.xvector with elements of type
float.ydestination vector with
nelements of typefloat.Discussion
Matrix
ais multiplied byalphaand then by vectorx; the resulting vector is added to vectory, and the results are stored iny.Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
OS X version 10.0 and later.
-
Forms the transpose of a matrix, multiplies it by a scalar and then by a vector, and adds the resulting vector to a second vector.
Declaration
Swift
func vSgemtx(_m: Int32, _n: Int32, _alpha: Float, _a: COpaquePointer, _x: COpaquePointer, _y: COpaquePointer)Parameters
mnumber of rows in
a, and the length of vectory; must be a multiple of 4.nnumber of columns in
a, and the length of vectorx; must be a multiple of 4.alphascalar multiplier for matrix
a.ambynmatrix with elements of typefloat.xvector with elements of type
float.ydestination vector with
nelements of typefloat.Discussion
The transpose of matrix
ais multiplied byalphaand then by vectorx; the resulting vector is added to vectory, and the results are stored iny.Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
OS X version 10.0 and later.
-
Adds two general matrices or their transposes.
Declaration
Swift
func vSgeadd(_height: Int32, _width: Int32, _a: COpaquePointer, _forma: Int8, _b: COpaquePointer, _formb: Int8, _c: COpaquePointer)Parameters
heightnumber of rows in the matrices to be added; must be a multiple of 4.
widthnumber of columns in the matrices to be added; must be a multiple of 4.
aa matrix with elements of type
float. Ifforma= ‘N’, the matrix itself is used in the calculation and it hasheightrows andwidthcolumns. Ifforma= ‘T’, the transpose is used andahaswidthrows andheightcolumns.formaselector with a value of‘N’ or ‘T’.
ba matrix with elements of type
float. Ifformb= ‘N’, the matrix itself is used in the calculation and it hasheightrows andwidthcolumns. Ifformb= ‘T’, the transpose is used andbhaswidthrows andheightcolumns.formbselector with a value of ‘N’ or ‘T’.
cdestination matrix with
heightrows andwidthcolumns.Discussion
Matrix
a(or its transpose) is added to matrixb(or its transpose); the result is stored in mactrixc.Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
OS X version 10.0 and later.
-
Subtracts two general matrices or their transposes.
Declaration
Swift
func vSgesub(_height: Int32, _width: Int32, _a: COpaquePointer, _forma: Int8, _b: COpaquePointer, _formb: Int8, _c: COpaquePointer)Parameters
heightnumber of rows in the matrices to be subtracted; must be a multiple of 4.
widthnumber of columns in the matrices to be subtracted; must be a multiple of 4.
aa matrix with elements of type
float. Ifforma= ‘N’, the matrix itself is used in the calculation and it hasheightrows andwidthcolumns. Ifforma= ‘T’, the transpose is used andahaswidthrows andheightcolumns.formaselector with a value of ‘N’ or ‘T’.
ba matrix with elements of type
float. Ifformb= ‘N’, the matrix itself is used in the calculation and it hasheightrows andwidthcolumns. Ifformb= ‘T’, the transpose is used andbhaswidthrows andheightcolumns.formbselector with a value of ‘N’ or ‘T’.
cdestination matrix with
heightrows andwidthcolumns.Discussion
Matrix
b(or its transpose) is subtracted from matrixa(or its transpose); the result is stored in mactrixc.Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
OS X version 10.0 and later.
-
Multiplies two general matrices or their transposes.
Declaration
Swift
func vSgemul(_l: Int32, _m: Int32, _n: Int32, _a: COpaquePointer, _forma: Int8, _b: COpaquePointer, _formb: Int8, _matrix: COpaquePointer)Parameters
lnumber of rows in matrix
matrix; must be a multiple of 4.mif
forma= ‘N’,mis the number of columns in matrixa; if forma = ‘T’,mis the number of rows in matrixa. Also, ifformb= ‘N’,mis the number of rows in matrixb; if formb = ‘T’,mis the number of columns in matrixb.mmust be a multiple of 4.nnumber of columns in the matrix
matrix; must be a multiple of 4.aa matrix with elements of type
float. Ifforma= ‘N’, the matrix itself is used in the calculation and it haslrows andmcolumns. Ifforma= ‘T’, the transpose is used andahasmrows andlcolumns. Thus the matrix used in the calculation islbym.formaselector with a value of ‘N’ or ‘T’.
ba matrix with elements of type
float. Ifformb= ‘N’, the matrix itself is used in the calculation and it hasmrows andncolumns. Ifformb= ‘T’, the transpose is used andbhasnrows andmcolumns. Thus the matrix used in the calculation ismbyn.formbselector with a value of ‘N’ or ‘T’.
matrixdestination matrix with
lrows andncolumns.Discussion
Matrix
a(or its transpose) is multiplied by matrixb(or its transpose); the result is stored in matrixmatrix.Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
OS X version 10.0 and later.
-
Multiples two general matrices or their transposes, then scales and adds a third.
Declaration
Swift
func vSgemm(_l: Int32, _m: Int32, _n: Int32, _a: COpaquePointer, _forma: Int8, _b: COpaquePointer, _formb: Int8, _c: COpaquePointer, _alpha: Float, _beta: Float, _matrix: COpaquePointer)Parameters
lnumber of rows in matrix
c; must be a multiple of 4.mif
forma= ‘N’,mis the number of columns in matrixa; ifforma= ‘T’,mis the number of rows in matrixa. Also, ifformb= ‘N’,mis the number of rows in matrixb; ifformb= ‘T’,mis the number of columns in matrixb.mmust be a multiple of 4.nnumber of columns in matrix
c; must be a multiple of 4.aa matrix with elements of type
float. Ifforma= ‘N’, the matrix itself is used in the calculation and it haslrows andmcolumns. Ifforma= ‘T’, the transpose is used andahasmrows andlcolumns. Thus the matrix used in the calculation islbyn.formaselector with a value of ‘N’ or ‘T’.
ba matrix with elements of type
float. Ifformb= ‘N’, the matrix itself is used in the calculation and it hasmrows andncolumns. Ifformb= ‘T’, the transpose is used andbhasnrows andmcolumns. Thus the matrix used in the calculation ismbyn.formbselector with a value of ‘N’ or ‘T’.
can
lbynmatrix with elements of typefloat.alphamultiplier for matrix
a.betamultiplier for matrix
c.matrixdestination matrix with
lrows andncolumns.Discussion
Matrix
a(or its transpose) is multiplied by matrixb(or its transpose); matrixcis multiplied bybeta, and the result is added to the result of the matrix multiplication; the result is stored in matrixmatrixImport Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
OS X version 10.0 and later.
-
Transposes a matrix in place.
Declaration
Swift
func vSgetmi(_size: Int32, _x: COpaquePointer)Objective-C
void vSgetmi ( int32_t size, vFloat x[] );Parameters
sizenumber of rows and columns in matrix
x; must be a multiple of 4.xsquare matrix with
sizerows andsizecolumns.Discussion
The matrix
xis transposed in place.Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
OS X version 10.0 and later.
-
Transposes a matrix out of place.
Declaration
Swift
func vSgetmo(_height: Int32, _width: Int32, _x: COpaquePointer, _y: COpaquePointer)Parameters
heightnumber of rows in matrix
xand number of columns in matrix y; must be a multiple of 4.widthnumber of columns in matrix
xand number of rows in matrix y; must be a multiple of 4.xmatrix with
heightrows andwidthcolumns.ymatrix with
widthrows andheightcolumns.Discussion
The matrix
xis transposed into matrixy.Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
OS X version 10.0 and later.
-
Produces the outer product of two vectors and places the results into a matrix.
Declaration
Swift
func vSgevv(_l: Int32, _n: Int32, _A: COpaquePointer, _B: COpaquePointer, _M: COpaquePointer)Parameters
lnumber of elements in vector
Aand the number of rows in matrixM; must be a multiple of 4.nnumber of elements in vector
Band the number of columns in matrixM; must be a multiple of 4.Avector with
lelements.Bvector with
nelements.Mmatrix with
lrows andncolumns.Discussion
The vectors
AandBare multiplied and the result is stored in matrixM, that is, for0 <= i < land0 <= j < n,C[i*n + j] = A[i] * B[j]..Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
OS X version 10.0 and later.
-
Deprecated. Use
vvfabsfinstead.Declaration
Objective-C
void vvfabf ( float *, const float *, const int * );Parameters
resultAn array, modified on return, where the results are stored.
srcThe input array.
countThe number of values in the input and result arrays.
Discussion
Computes the absolute value of values in an array.
Import Statement
Objective-C
@import Accelerate;Availability
Available in OS X v10.5 and later.
Deprecated in OS X v10.7.
All data structures passed to vecLib must be naturally aligned. For example, a 32-bit floating-point value must be aligned to a four-byte boundary. Many routines in vecLib generate exceptions on unaligned data.
-
A 128-bit vector packed with
unsigned charvalues.Declaration
Objective-C
typedef vector unsigned char vUInt8;Import Statement
Objective-C
#include <vecLibTypes.h>;Availability
Available in OS X v10.4 and later.
-
A 128-bit vector packed with
signed charvalues.Declaration
Objective-C
typedef vector signed char vSInt8;Import Statement
Objective-C
#include <vecLibTypes.h>;Availability
Available in OS X v10.4 and later.
-
A 128-bit vector packed with
unsigned shortvalues.Declaration
Objective-C
typedef vector unsigned short vUInt16;Import Statement
Objective-C
#include <vecLibTypes.h>;Availability
Available in OS X v10.4 and later.
-
A 128-bit vector packed with
signed shortvalues.Declaration
Objective-C
typedef vector signed short vSInt16;Import Statement
Objective-C
#include <vecLibTypes.h>;Availability
Available in OS X v10.4 and later.
-
A 128-bit vector packed with
unsigned intvalues.Declaration
Objective-C
typedef vector unsigned int vUInt32;Import Statement
Objective-C
#include <vecLibTypes.h>;Availability
Available in OS X v10.4 and later.
-
A 128-bit vector packed with
signed intvalues.Declaration
Objective-C
typedef vector signed int vSInt32;Import Statement
Objective-C
#include <vecLibTypes.h>;Availability
Available in OS X v10.4 and later.
-
A 128-bit vector packed with
uint64_tvalues.Declaration
Objective-C
typedef vector unsigned int vUInt64;Import Statement
Objective-C
#include <vecLibTypes.h>;Availability
Available in OS X v10.4 and later.
-
A 128-bit vector packed with
int64_tvalues.Declaration
Objective-C
typedef vector signed int vSInt64;Import Statement
Objective-C
#include <vecLibTypes.h>;Availability
Available in OS X v10.4 and later.
-
A 128-bit vector packed with
floatvalues.Declaration
Objective-C
typedef vector float vFloat;Import Statement
Objective-C
#include <vecLibTypes.h>;Availability
Available in OS X v10.4 and later.
-
A 128-bit vector packed with
doublevalues.Declaration
Objective-C
typedef double vDouble __attribute__((__vector_size__ (16)));Import Statement
-
A 128-bit vector packed with
bool intvalues.Declaration
Objective-C
typedef vector bool int vBool32;Import Statement
Objective-C
#include <vecLibTypes.h>;Availability
Available in OS X v10.4 and later.
-
A single-precision complex number type.
Declaration
Objective-C
typedef complex float __float_complex_t;Import Statement
-
A double-precision complex number type.
Declaration
Objective-C
typedef complex double __double_complex_t;Import Statement
-
A union containing one
vUInt32vector or four 32-bit integers, representing a 128-bit unsigned integer.Declaration
Swift
struct vU128 { init() }Objective-C
union vU128 { vUInt32 v; struct { vUInt32 v1; } vs; struct { UInt32 MSW; UInt32 d2; UInt32 d3; UInt32 LSW; } s; }; typedef union vU128 vU128;Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
A union containing one
vSInt32vector or four 32-bit integers, representing a 128-bit signed integer.Declaration
Swift
struct vS128 { init() }Objective-C
union vS128 { vUInt32 v; struct { vUInt32 v1; } vs; struct { SInt32 MSW; UInt32 d2; UInt32 d3; UInt32 LSW; } s; }; typedef union vS128 vS128;Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
A union containing an array or structure of two
vUInt32vectors or eight 32-bit integers, representing a 256-bit unsigned integer.Declaration
Swift
struct vU256 { init() }Objective-C
union vU256 { vUInt32 v[2]; struct { vUInt32 v1; vUInt32 v2; } vs; struct { UInt32 MSW; UInt32 d2; UInt32 d3; UInt32 d4; UInt32 d5; UInt32 d6; UInt32 d7; UInt32 LSW; } s; }; typedef union vU256 vU256;Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
A union containing an array or structure of two
vUInt32vectors or eight 32-bit integers, representing a 256-bit signed integer.Declaration
Swift
struct vS256 { init() }Objective-C
union vS256 { vUInt32 v[2]; struct { vUInt32 v1; vUInt32 v2; } vs; struct { SInt32 MSW; UInt32 d2; UInt32 d3; UInt32 d4; UInt32 d5; UInt32 d6; UInt32 d7; UInt32 LSW; } s; }; typedef union vS256 vS256;Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
A union containing an array or structure of four
vUInt32vectors or sixteen 32-bit integers, representing a 256-bit unsigned integer.Declaration
Swift
struct vU512 { init() }Objective-C
union vU512 { vUInt32 v[4]; struct { vUInt32 v1; vUInt32 v2; vUInt32 v3; vUInt32 v4; } vs; struct { UInt32 MSW; UInt32 d2; UInt32 d3; UInt32 d4; UInt32 d5; UInt32 d6; UInt32 d7; UInt32 d8; UInt32 d9; UInt32 d10; UInt32 d11; UInt32 d12; UInt32 d13; UInt32 d14; UInt32 d15; UInt32 LSW; } s; }; typedef union vU512 vU512;Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
A union containing an array or structure of four
vUInt32vectors or sixteen 32-bit integers, representing a 256-bit signed integer.Declaration
Swift
struct vS512 { init() }Objective-C
union vS512 { vUInt32 v[4]; struct { vUInt32 v1; vUInt32 v2; vUInt32 v3; vUInt32 v4; } vs; struct { SInt32 MSW; UInt32 d2; UInt32 d3; UInt32 d4; UInt32 d5; UInt32 d6; UInt32 d7; UInt32 d8; UInt32 d9; UInt32 d10; UInt32 d11; UInt32 d12; UInt32 d13; UInt32 d14; UInt32 d15; UInt32 LSW; } s; }; typedef union vS512 vS512;Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
A union containing an array or structure of eight
vUInt32vectors or thirty-two 32-bit integers, representing a 1024-bit unsigned integer.Declaration
Swift
struct vU1024 { init() }Objective-C
union vU1024 { vUInt32 v[8]; struct { vUInt32 v1; vUInt32 v2; vUInt32 v3; vUInt32 v4; vUInt32 v5; vUInt32 v6; vUInt32 v7; vUInt32 v8; } vs; struct { UInt32 MSW; UInt32 d2; UInt32 d3; UInt32 d4; UInt32 d5; UInt32 d6; UInt32 d7; UInt32 d8; UInt32 d9; UInt32 d10; UInt32 d11; UInt32 d12; UInt32 d13; UInt32 d14; UInt32 d15; UInt32 d16; UInt32 d17; UInt32 d18; UInt32 d19; UInt32 d20; UInt32 d21; UInt32 d22; UInt32 d23; UInt32 d24; UInt32 d25; UInt32 d26; UInt32 d27; UInt32 d28; UInt32 d29; UInt32 d30; UInt32 d31; UInt32 LSW; } s; }; typedef union vU1024 vU1024;Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
-
A union containing an array or structure of eight
vUInt32vectors or thirty-two 32-bit integers, representing a 1024-bit signed integer.Declaration
Swift
struct vS1024 { init() }Objective-C
union vS1024 { vUInt32 v[8]; struct { vUInt32 v1; vUInt32 v2; vUInt32 v3; vUInt32 v4; vUInt32 v5; vUInt32 v6; vUInt32 v7; vUInt32 v8; } vs; struct { SInt32 MSW; UInt32 d2; UInt32 d3; UInt32 d4; UInt32 d5; UInt32 d6; UInt32 d7; UInt32 d8; UInt32 d9; UInt32 d10; UInt32 d11; UInt32 d12; UInt32 d13; UInt32 d14; UInt32 d15; UInt32 d16; UInt32 d17; UInt32 d18; UInt32 d19; UInt32 d20; UInt32 d21; UInt32 d22; UInt32 d23; UInt32 d24; UInt32 d25; UInt32 d26; UInt32 d27; UInt32 d28; UInt32 d29; UInt32 d30; UInt32 d31; UInt32 LSW; } s; }; typedef union vS1024 vS1024;Import Statement
Objective-C
@import Accelerate;Swift
import AccelerateAvailability
Available in OS X v10.4 and later.
Copyright © 2015 Apple Inc. All rights reserved. Terms of Use | Privacy Policy | Updated: 2014-07-15
