BeBOP Optimized Sparse Kernel Interface Library  1.0.1h
Functions
Kernels (matrix type-independent implementations).
Public Interface

Functions

int oski_MatMultAndMatTransMult (const oski_matrix_t A_tunable, oski_value_t alpha, const oski_vecview_t x_view, oski_value_t beta, oski_vecview_t y_view, oski_matop_t opA, oski_value_t omega, const oski_vecview_t w_view, oski_value_t zeta, oski_vecview_t z_view)
 Computes $y \leftarrow \alpha\cdot Ax + \beta\cdot y$ and $z \leftarrow \omega\cdot\mathrm{op}(A)x + \zeta\cdot z$, where $\mathrm{op}(A) \in \{A, A^T, A^H\}$.
int oski_MatTransMatMult (const oski_matrix_t A_tunable, oski_ataop_t op, oski_value_t alpha, const oski_vecview_t x_view, oski_value_t beta, oski_vecview_t y_view, oski_vecview_t t_view)
 Computes $y \leftarrow \alpha\cdot\mathrm{op}(A)x + \beta\cdot y$, where $\mathrm{op}(A) \in \{AA^T, A^TA, AA^H, A^HA\}$.
int oski_MatMult (const oski_matrix_t A_tunable, oski_matop_t opA, oski_value_t alpha, const oski_vecview_t x_view, oski_value_t beta, oski_vecview_t y_view)
 Computes $y \leftarrow \alpha\cdot\mathrm{op}(A)x + \beta\cdot y$, where $\mathrm{op}(A) \in \{A, A^T, A^H\}$.
int oski_MatPowMult (const oski_matrix_t A_tunable, oski_matop_t opA, int power, oski_value_t alpha, const oski_vecview_t x_view, oski_value_t beta, oski_vecview_t y_view, oski_vecview_t T_view)
 Computes a power of a matrix times a vector, or $y \leftarrow \alpha\cdot\mathrm{op}(A)^\rho x + \beta\cdot y$.
int oski_MatTrisolve (const oski_matrix_t T_tunable, oski_matop_t opT, oski_value_t alpha, oski_vecview_t x_view)
 Computes $x \leftarrow \alpha\cdot\mathrm{op}(T^{-1})x$, where $T$ is a triangular matrix.

Function Documentation

int oski_MatMult ( const oski_matrix_t  A_tunable,
oski_matop_t  opA,
oski_value_t  alpha,
const oski_vecview_t  x_view,
oski_value_t  beta,
const oski_vecview_t  y_view 
)

Computes $y \leftarrow \alpha\cdot\mathrm{op}(A)x + \beta\cdot y$, where $\mathrm{op}(A) \in \{A, A^T, A^H\}$.

Parameters:
[in]A_tunableSparse matrix object, $A$.
[in]opASpecifies the transpose operation, $op(A)$.
[in]alphaScalar multiplier, $\alpha$.
[in]x_viewVector view object, $x$.
[in]betaScalar multiplier, $\beta$.
[in,out]y_viewVector view object, $y$.
Returns:
0 on success, or an error code.

References ERR_BAD_VECVIEW, ERR_NOT_IMPLEMENTED, oski_matstruct_t::input_mat, INVALID_ID, MACRO_TO_STRING, MatReprMult, OSKI_ERR, OSKI_ERR_BAD_VEC, OSKI_ERR_NOT_IMPLEMENTED, OSKI_KERNEL_MatMult, OSKI_MATTYPEID_METHOD, oski_ReadElapsedTime(), oski_RecordCall, oski_RestartTimer(), oski_StopTimer(), oski_matstruct_t::props, oski_matspecific_t::repr, oski_matstruct_t::timer, oski_matstruct_t::trace, oski_matstruct_t::tuned_mat, and oski_matspecific_t::type_id.

int oski_MatMultAndMatTransMult ( const oski_matrix_t  A_tunable,
oski_value_t  alpha,
const oski_vecview_t  x_view,
oski_value_t  beta,
oski_vecview_t  y_view,
oski_matop_t  op,
oski_value_t  omega,
const oski_vecview_t  w_view,
oski_value_t  zeta,
oski_vecview_t  z_view 
)

Computes $y \leftarrow \alpha\cdot Ax + \beta\cdot y$ and $z \leftarrow \omega\cdot\mathrm{op}(A)x + \zeta\cdot z$, where $\mathrm{op}(A) \in \{A, A^T, A^H\}$.

Parameters:
[in]A_tunableSparse matrix object, $A$.
[in]opSpecifies the transpose operation, $\mathrm{op}(A)$.
[in]alphaScalar multiplier, $\alpha$.
[in]x_viewVector view object, $x$.
[in]betaScalar multiplier, $\beta$.
[in]y_viewVector view object, $y$.
[in]omegaScalar multiplier, $\omega$.
[in]w_viewVector view object, $w$.
[in]zetaScalar multiplier, $\zeta$.
[in]z_viewVector view object, $z$.
Returns:
0 on success, or an error code.

References ERR_BAD_VECVIEW, INVALID_ID, MatMultAndMatTransMultDefault, OSKI_ERR, OSKI_ERR_BAD_VEC, OSKI_KERNEL_MatMultAndMatTransMult, OSKI_MATTYPEID_METHOD, oski_ReadElapsedTime(), oski_RecordCall, oski_matstruct_t::props, oski_matspecific_t::repr, oski_matstruct_t::timer, oski_matstruct_t::trace, oski_matstruct_t::tuned_mat, and oski_matspecific_t::type_id.

int oski_MatPowMult ( const oski_matrix_t  A_tunable,
oski_matop_t  opA,
int  power,
oski_value_t  alpha,
const oski_vecview_t  x_view,
oski_value_t  beta,
oski_vecview_t  y_view,
oski_vecview_t  T_view 
)

Computes a power of a matrix times a vector, or $y \leftarrow \alpha\cdot\mathrm{op}(A)^\rho x + \beta\cdot y$.

Parameters:
[in]A_tunableThe $m\times n$ matrix object $A$.
[in]opATranspose option, $op(A)$.
[in]powerNon-negative matrix power $k$.
[in]alphaScalar multiplier $\alpha$.
[in]x_viewSingle vector object $x$.
[in]betaScalar multiplier $\alpha$.
[in,out]y_viewSingle vector object $y$.
[in,out]T_viewMultivector object $T$ consisting of $\max\{k-1,0\}$ column vectors in which to store intermediate results.
Returns:
Computes $y, T$ and returns 0 on success, or an error code otherwise.

References DefaultMatPowMult(), ERR_BAD_VECVIEW, oski_matstruct_t::input_mat, INVALID_ID, MACRO_TO_STRING, OSKI_ERR, OSKI_ERR_BAD_VEC, OSKI_KERNEL_MatPowMult, OSKI_MATTYPEID_METHOD, oski_ReadElapsedTime(), oski_RecordCall, oski_RestartTimer(), oski_StopTimer(), oski_matstruct_t::props, oski_matspecific_t::repr, oski_matstruct_t::timer, oski_matstruct_t::trace, oski_matstruct_t::tuned_mat, and oski_matspecific_t::type_id.

int oski_MatTransMatMult ( const oski_matrix_t  A_tunable,
oski_ataop_t  op,
oski_value_t  alpha,
const oski_vecview_t  x_view,
oski_value_t  beta,
oski_vecview_t  y_view,
oski_vecview_t  t_view 
)

Computes $y \leftarrow \alpha\cdot\mathrm{op}(A)x + \beta\cdot y$, where $\mathrm{op}(A) \in \{AA^T, A^TA, AA^H, A^HA\}$.

Parameters:
[in]A_tunableSparse matrix object, $A$.
[in]opSpecifies the transpose operation, $op(A)$.
[in]alphaScalar multiplier, $\alpha$.
[in]x_viewVector view object, $x$.
[in]betaScalar multiplier, $\beta$.
[in]y_viewVector view object, $y$.
[in]t_viewVector view object, $t$. The caller may set t_view == INVALID_VEC if no intermediate result is desired.
Returns:
0 on success, or an error code.

References ERR_BAD_VECVIEW, ERR_NOT_IMPLEMENTED, INVALID_ID, MACRO_TO_STRING, MatTransMatMultDefault, OSKI_ERR, OSKI_ERR_BAD_VEC, OSKI_KERNEL_MatTransMatMult, OSKI_MATTYPEID_METHOD, oski_ReadElapsedTime(), oski_RecordCall, oski_RestartTimer(), oski_StopTimer(), oski_matstruct_t::props, oski_matspecific_t::repr, oski_matstruct_t::timer, oski_matstruct_t::trace, oski_matstruct_t::tuned_mat, and oski_matspecific_t::type_id.

int oski_MatTrisolve ( const oski_matrix_t  T,
oski_matop_t  opT,
oski_value_t  alpha,
oski_vecview_t  x 
)

Computes $x \leftarrow \alpha\cdot\mathrm{op}(T^{-1})x$, where $T$ is a triangular matrix.

Parameters:
[in]T_tunableTriangular sparse matrix object, $T$.
[in]opTSpecifies the transpose operation, $op(T)$.
[in]alphaScalar multiplier, $\alpha$.
[in,out]x_viewVector view object, $x$.
Returns:
0 on success, or an error code.
Todo:
For efficiency, this routine does not attempt to pre-scan the matrix data structure and ensure there are no zero diagonals. At least for CSR and CSC input matrices, we should add some kind of check somewhere (e.g., at matrix handle creation time). A similar to-do appears elsewhere in this source.

References ERR_BAD_VECVIEW, ERR_NOT_IMPLEMENTED, oski_matstruct_t::input_mat, INVALID_ID, MACRO_TO_STRING, OSKI_ERR, OSKI_ERR_BAD_VEC, OSKI_ERR_NOT_IMPLEMENTED, OSKI_KERNEL_MatTrisolve, OSKI_MATTYPEID_METHOD, oski_ReadElapsedTime(), oski_RecordCall, oski_RestartTimer(), oski_StopTimer(), oski_matstruct_t::props, oski_matspecific_t::repr, oski_matstruct_t::timer, oski_matstruct_t::trace, oski_matstruct_t::tuned_mat, and oski_matspecific_t::type_id.