getset.c File Reference


Detailed Description

BCSR get/set value routines.

#include <assert.h>
#include <stdio.h>
#include <oski/config.h>
#include <oski/common.h>
#include <oski/matrix.h>
#include <oski/getset.h>
#include <oski/CSR/format.h>
#include <oski/CSR/module.h>
#include <oski/BCSR/format.h>
#include <oski/BCSR/module.h>

Defines

#define STORE_SINGLE   0
 Store specified element only.
#define STORE_CONJ   1
 Store the conjugate only.
#define STORE_SYMM   2
 Store element and its symmetric image.
#define STORE_HERM   3
 Store element and its Hermitian image.

Functions

static int GetEntryRaw (const oski_matBCSR_t *A, oski_index_t i0, oski_index_t j0, oski_value_t *p_value)
 Reads a matrix entry.
int oski_GetMatReprEntry (const void *mat, const oski_matcommon_t *props, oski_index_t row, oski_index_t col, oski_value_t *p_value)
static int SetEntryRaw (oski_matBCSR_t *A, int store_op, oski_index_t i0, oski_index_t j0, oski_value_t new_val)
 Changes a matrix entry to a given value.
int oski_SetMatReprEntry (void *mat, const oski_matcommon_t *props, oski_index_t row, oski_index_t col, oski_value_t new_val)


Function Documentation

static int GetEntryRaw const oski_matBCSR_t A,
oski_index_t  i0,
oski_index_t  j0,
oski_value_t *  p_value
[static]
 

Reads a matrix entry.

Parameters:
[in,out] A BCSR matrix. Must be non-NULL.
[in] i0 Row of element (0-based).
[in] j0 Column of element (0-based).
[in] p_value Pointer to buffer to store return value. Must be non-NULL.
Returns:
0 on success, or an error code otherwise.
This routine operates on the raw explicit storage only (i.e., does not account for an implicit unit diagonal). The caller must ensure that the requested entry (i0, j0) is valid.

int oski_GetMatReprEntry const void *  mat,
const oski_matcommon_t props,
oski_index_t  row,
oski_index_t  col,
oski_value_t *  p_value
 

Note:
As written, this routine ignores 'props.' This point is critical because this routine calls itself on the leftover rows if the requested entry lies there, and 'props' is set to NULL in that call.

int oski_SetMatReprEntry void *  mat,
const oski_matcommon_t props,
oski_index_t  row,
oski_index_t  col,
oski_value_t  new_val
 

Note:
This routine only depends on 'props' if the matrix is symmetric/Hermitian/triangular. Otherwise, it is OK to pass 'props' as NULL.

static int SetEntryRaw oski_matBCSR_t A,
int  store_op,
oski_index_t  i0,
oski_index_t  j0,
oski_value_t  new_val
[static]
 

Changes a matrix entry to a given value.

Parameters:
[in,out] A BCSR matrix. Must be non-NULL.
[in] store_op What to store: STORE_SINGLE, STORE_CONJ, STORE_SYMM, and STORE_HERM.
[in] i0 Row of element (0-based).
[in] j0 Column of element (0-based).
[in] new_val New value.
Returns:
0 on success, or an error code otherwise.
This routine operates on the raw explicit storage only (i.e., does not account for an implicit unit diagonal). The caller must ensure that the requested entry (i0, j0) is valid.


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