MBO
 All Data Structures Files Functions Variables Typedefs Enumerations Modules Pages
Typedefs | Functions

Typedefs

typedef struct MboNumOp_t * MboNumOp
 Data type for numerical operators. More...
 

Functions

MBO_EXPORT MBO_STATUS mboNumOpCompile (MboTensorOp op, MboNumOp *numOp)
 Build a numerical operator from a tensor operator. More...
 
MBO_EXPORT void mboNumOpDestroy (MboNumOp *op)
 Deallocate all resources associated with a MboNumOp. More...
 
MBO_EXPORT MboProdSpace mboNumOpGetSpace (MboNumOp op)
 Returns a (non-owning) pointer to the space of an operator. More...
 
MBO_EXPORT MBO_STATUS mboNumOpMatVec (struct MboAmplitude alpha, MboNumOp a, struct MboAmplitude *x, struct MboAmplitude beta, struct MboAmplitude *y)
 
MBO_EXPORT double mboNumOpFlops (MboNumOp a)
 Returns an estimate for the number of floating point operations in a MatVec. More...
 
MBO_EXPORT void mboNumOpDenseMatrix (MboNumOp a, struct MboAmplitude *mat)
 Dense matrix representation of operator. More...
 
MBO_EXPORT void mboNumOpRowOffsets (MboNumOp op, MboGlobInd rmin, MboGlobInd rmax, MboGlobInd *i)
 Compute row offsets of sparse matrix. More...
 
MBO_EXPORT MBO_STATUS mboNumOpSparseMatrix (MboNumOp op, MboGlobInd rmin, MboGlobInd rmax, MboGlobInd *i, MboGlobInd *j, struct MboAmplitude *a)
 Create a sparse matrix representation for a numerical operator. More...
 
MBO_EXPORT void mboNumOpDiagonal (MboNumOp op, MboGlobInd rmin, MboGlobInd rmax, struct MboAmplitude *diag)
 Get diagonal entries from a numerical operator. More...
 
MBO_EXPORT void mboNumOpDeleteDiagonal (MboNumOp op)
 Erase the diagonal from an operator. More...
 

Detailed Description

Typedef Documentation

typedef struct MboNumOp_t* MboNumOp

Data type for numerical operators.

MboNumOp objects can be created from MboTensorOps using mboNumOpCompile

See also
mboNumOpCompile, MboTensorOp

Function Documentation

MBO_EXPORT MBO_STATUS mboNumOpCompile ( MboTensorOp  op,
MboNumOp numOp 
)

Build a numerical operator from a tensor operator.

Parameters
opOperator to compile.
numOpOn exit this pointer contains the compiled operator. The generated MboNumOp has to be destroyed with mboNumOpDestroy.
See also
MboNumOp, MboTensorOp, mboNumOpDestroy
MBO_EXPORT void mboNumOpDeleteDiagonal ( MboNumOp  op)

Erase the diagonal from an operator.

Parameters
opOperator from which to delete the diagonal.
See also
MboNumOp, mboTensorOpDiagonal
MBO_EXPORT void mboNumOpDenseMatrix ( MboNumOp  a,
struct MboAmplitude mat 
)

Dense matrix representation of operator.

This function fills the array mat with the dense matrix representation of the tensor operator. The matrix is written in row major order

Parameters
aThe tensor operator.
matUser allocated array for the dense matrix. Has to be at least of length dim * dim, where dim is the dimension of the Hilbert space of the operator.
MBO_EXPORT void mboNumOpDestroy ( MboNumOp op)

Deallocate all resources associated with a MboNumOp.

See also
mboNumOpCompile, MboNumOp
MBO_EXPORT void mboNumOpDiagonal ( MboNumOp  op,
MboGlobInd  rmin,
MboGlobInd  rmax,
struct MboAmplitude diag 
)

Get diagonal entries from a numerical operator.

Parameters
opThe operator.
rminFirst row for which to get the diagonal.
rmaxLast row for which to get the diagonal.
diagThe diagonal. Has to point to memory for at least rmax - rmin entries.
See also
MboNumOp, mboNumOpDeleteDiagonal
MBO_EXPORT double mboNumOpFlops ( MboNumOp  a)

Returns an estimate for the number of floating point operations in a MatVec.

A complex multiply-add is counted as 8 floating point operations.

Parameters
aThe numerical operator for which the flops are to be computed.
MBO_EXPORT MboProdSpace mboNumOpGetSpace ( MboNumOp  op)

Returns a (non-owning) pointer to the space of an operator.

Parameters
opThe operator.
Returns
The product space.
See also
MboProdSpace, MboNumOp
MBO_EXPORT MBO_STATUS mboNumOpMatVec ( struct MboAmplitude  alpha,
MboNumOp  a,
struct MboAmplitude x,
struct MboAmplitude  beta,
struct MboAmplitude y 
)

y <- alpha * a * x + beta * y

MBO_EXPORT void mboNumOpRowOffsets ( MboNumOp  op,
MboGlobInd  rmin,
MboGlobInd  rmax,
MboGlobInd i 
)

Compute row offsets of sparse matrix.

This method computes the row offsets of the sparse matrix representing the tensor operator. This corresponds to the i array in aij or Yale sparse matrix format. We have i[0] = 0, i[1] = nnz[rmin], i[2] = nnz[rmin] + nnz[rmin + 1], etc. In particular, i[rmax - rmin] contains the total number of non-zeros in the row range [rmin, rmax). Note that this method, like mboNumOpSparseMatrix, counts duplicate entries separately. The i array is suitable for input to mboNumOpSparseMatrix.

Parameters
opThe tensor.
rminStart of row range for which to compute the offsets.
rmaxEnd of row range for which to compute the offsets.
iOn exit this array contains the row offsets. The offset of the first row in the range is set to 0. Thus, in order to obtain the global offsets one has to add the global offset of the first row to all offsets in i.
See also
mboNumOpSparseMatrix
MBO_EXPORT MBO_STATUS mboNumOpSparseMatrix ( MboNumOp  op,
MboGlobInd  rmin,
MboGlobInd  rmax,
MboGlobInd i,
MboGlobInd j,
struct MboAmplitude a 
)

Create a sparse matrix representation for a numerical operator.

After a call to mboNumOpRowOffsets and mboNumOpSparseMatrix the arrays i, j, and a contain the compressed sparse row representation of the matrix for the rows [rmin, rmax).

Parameters
opCreate sparse matrix for this operator.
rminStart of row range for which to compute the sparse matrix.
rmaxEnd of row range.
iOffsets array computed by mboNumOpRowOffsets.
jColumn indices of nonzero entries.
aNon-zero entries.
Returns
Error code.
See also
mboNumOpDenseMatrix, mboNumOpRowOffsets.