MBO
 All Data Structures Files Functions Variables Typedefs Enumerations Modules Pages
Typedefs | Functions
MboVec.h File Reference

The MboVec API. More...

#include <MboExport.h>
#include <MboErrors.h>
#include <MboIndices.h>

Go to the source code of this file.

Typedefs

typedef struct MboVec_t * MboVec
 Data type for representing vectors.
 

Functions

MBO_EXPORT MBO_STATUS mboVecCreate (MboGlobInd dim, MboVec *v)
 Create MboVec of dimension dim.
 
MBO_EXPORT MBO_STATUS mboVecDestroy (MboVec *v)
 Release all resources of a MboVec.
 
MBO_EXPORT MBO_STATUS mboVecUnitVector (MboGlobInd n, MboVec v)
 Fill vector with nth unit vector Sets the nth entry in the vector to 1 and all other entries to zero. More...
 
MBO_EXPORT MboGlobInd mboVecDim (MboVec v)
 Get dimension of vector.
 
MBO_EXPORT MBO_STATUS mboVecGetViewRW (MboVec v, struct MboAmplitude **array)
 Obtain a read-write view of the vector data. More...
 
MBO_EXPORT MBO_STATUS mboVecGetViewR (MboVec v, struct MboAmplitude **array)
 Obtain a read-only view of vector data. More...
 
MBO_EXPORT MBO_STATUS mboVecReleaseView (MboVec v, struct MboAmplitude **array)
 Release a view of the vector data.
 
MBO_EXPORT MBO_STATUS mboVecAXPY (struct MboAmplitude *a, MboVec x, MboVec y)
 y <- a * x + y
 
MBO_EXPORT MBO_STATUS mboVecDot (MboVec x, MboVec y, struct MboAmplitude *result)
 computes the dot product of two vectors More...
 
MBO_EXPORT MBO_STATUS mboVecSwap (MboVec x, MboVec y)
 swap contents of two vectors. More...
 
MBO_EXPORT MBO_STATUS mboVecSet (struct MboAmplitude *a, MboVec x)
 set vector to a constant
 
MBO_EXPORT MBO_STATUS mboVecSetRandom (MboVec x)
 Fill a vector with random numbers.
 
MBO_EXPORT MBO_STATUS mboVecKron (int n, MboLocInd *dims, struct MboAmplitude **vecs, MboVec x)
 Add outer product of vectors. More...
 
MBO_EXPORT MBO_STATUS mboVecMap (int n, MboLocInd *dims, void f(int, MboLocInd *, MboLocInd *, void *, struct MboAmplitude *), void *ctx, MboVec x)
 Apply a function to every entry in a vector. More...
 
MBO_EXPORT MBO_STATUS mboVecDuplicate (MboVec x, MboVec *y)
 Duplicate a vector. More...
 
MBO_EXPORT int mboVecCheck (MboVec v)
 Check integrity of MboVec. More...
 

Detailed Description

The MboVec API.

MboVecs are used to describe vectors in product spaces.