getset.c File Reference

BCSR get/set value routines. More...

#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)


Detailed Description

BCSR get/set value routines.


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.

References tagBebop_matBCSR_t::bind, tagBebop_matBCSR_t::bptr, tagBebop_matBCSR_t::bval, tagBebop_matBCSR_t::col_block_size, ERR_BAD_MAT, tagBebop_matBCSR_t::leftover, tagBebop_matBCSR_t::num_block_rows, tagBebop_matBCSR_t::row_block_size, VAL_INC, and VAL_SET_ZERO.

Referenced by oski_GetMatReprEntry().

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.

References ERR_BAD_ARG, GetEntryRaw(), tagBebop_matBCSR_t::has_unit_diag_implicit, MACRO_TO_STRING, oski_HandleError, and VAL_SET_ONE.

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

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.

References tagBebop_matBCSR_t::bind, tagBebop_matBCSR_t::bptr, tagBebop_matBCSR_t::bval, tagBebop_matBCSR_t::col_block_size, ERR_BAD_MAT, ERR_ZERO_ENTRY, tagBebop_matBCSR_t::leftover, tagBebop_matBCSR_t::num_block_rows, tagBebop_matBCSR_t::row_block_size, STORE_CONJ, STORE_HERM, STORE_SINGLE, STORE_SYMM, VAL_ASSIGN, VAL_ASSIGN_CONJ, and VAL_SET_ZERO.

Referenced by oski_SetMatReprEntry().


Generated on Fri Apr 8 22:35:19 2011 for BeBOP Optimized Sparse Kernel Interface Library by  doxygen 1.5.9