matmult.c File Reference


Detailed Description

Sparse matrix-vector multiply implementation for a compressed sparse row (CSR) matrix.

#include <assert.h>
#include <oski/config.h>
#include <oski/common.h>
#include <oski/blas.h>
#include <oski/matmult.h>
#include <oski/CSR/format.h>
#include <oski/CSR/module.h>
#include "MatMult/CSR_MatMult.h"
#include "SymmMatMult/CSR_SymmMatMult.h"
#include "SymmMatMult/CSR_SymmMatHermMult.h"
#include "SymmMatMult/CSR_HermMatMult.h"
#include "SymmMatMult/CSR_HermMatTransMult.h"

Defines

#define CSR_MatConjMult_v1   CSR_MatMult_v1
 Base-adjusted, matrix times single-vector multiply.
#define MatReprMult_Conj   MatReprMult_Normal

Functions

static void CSR_MatMult_v1 (oski_index_t m, oski_index_t n, const oski_index_t *ptr, const oski_index_t *ind, const oski_value_t *val, oski_value_t alpha, const oski_value_t *x, oski_index_t incx, oski_value_t *y, oski_index_t incy)
 Base-adjusted, matrix times single-vector multiply.
static int MatReprMult_Normal (const oski_matCSR_t *A, const oski_matcommon_t *props, oski_value_t alpha, const oski_vecview_t x_view, oski_vecview_t y_view)
 CSR-specific matrix-vector multiply operation, $y \leftarrow y + \alpha \cdot A \cdot x$.
static void CSR_MatTransMult_v1 (oski_index_t m, oski_index_t n, const oski_index_t *ptr, const oski_index_t *ind, const oski_value_t *val, oski_value_t alpha, const oski_value_t *x, oski_index_t incx, oski_value_t *y, oski_index_t incy)
 Base-adjusted, matrix-transpose times single-vector multiply.
static int MatReprMult_Trans (const oski_matCSR_t *A, const oski_matcommon_t *props, oski_value_t alpha, const oski_vecview_t x_view, oski_vecview_t y_view)
 CSR-specific matrix-vector multiply operation, $y \leftarrow y + \alpha \cdot A^T \cdot x$.
static void SymmMatMult_v1 (oski_index_t m, oski_index_t n, const oski_index_t *ptr, const oski_index_t *ind, const oski_value_t *val, oski_index_t base, oski_value_t alpha, const oski_value_t *x, oski_index_t incx, oski_value_t *y, oski_index_t incy)
 Single-vector implementation of symmetric CSR SpMV.
static int SymmMatMult (const oski_matCSR_t *A, const oski_matcommon_t *props, oski_matop_t opA, oski_value_t alpha, const oski_vecview_t x_view, oski_vecview_t y_view)
 Symmetric matrix-vector multiply, $y \leftarrow y + \alpha\cdot op(A) \cdot x$, where $A = A^T$ and $op(A) \in \{A, A^H\}$.
int oski_MatReprMult (const void *pA, const oski_matcommon_t *props, oski_matop_t opA, oski_value_t alpha, const oski_vecview_t x_view, oski_value_t beta, oski_vecview_t y_view)
 Matrix type-specific implementation of sparse matrix-vector multiply.


Function Documentation

static int MatReprMult_Normal const oski_matCSR_t A,
const oski_matcommon_t props,
oski_value_t  alpha,
const oski_vecview_t  x_view,
oski_vecview_t  y_view
[static]
 

CSR-specific matrix-vector multiply operation, $y \leftarrow y + \alpha \cdot A \cdot x$.

At present, this implementation does not handle the multiple vector case specially.

Precondition:
This implementation assumes $\alpha \neq 0$.

This implementation assumes full storage.

At present, the multiple-vector implementation just repeatedly calls the single-vector implementation.

static int MatReprMult_Trans const oski_matCSR_t A,
const oski_matcommon_t props,
oski_value_t  alpha,
const oski_vecview_t  x_view,
oski_vecview_t  y_view
[static]
 

CSR-specific matrix-vector multiply operation, $y \leftarrow y + \alpha \cdot A^T \cdot x$.

At present, this implementation does not handle the multiple vector case specially.

Precondition:
This implementation assumes $\alpha \neq 0$.

This implementation assumes full storage.

At present, the multiple-vector implementation just repeatedly calls the single-vector implementation.

static int SymmMatMult const oski_matCSR_t A,
const oski_matcommon_t props,
oski_matop_t  opA,
oski_value_t  alpha,
const oski_vecview_t  x_view,
oski_vecview_t  y_view
[static]
 

Symmetric matrix-vector multiply, $y \leftarrow y + \alpha\cdot op(A) \cdot x$, where $A = A^T$ and $op(A) \in \{A, A^H\}$.

Todo:
Test the case when indices are unsorted.

At present, the multiple-vector implementation just repeatedly calls the single-vector implementation.


Generated on Wed Sep 19 16:41:22 2007 for BeBOP Optimized Sparse Kernel Interface Library by  doxygen 1.4.6