BeBOP Optimized Sparse Kernel Interface Library  1.0.1h
Defines | Functions

BDIAG1 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/BDIAG1/format.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_matBDIAG1_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_matBDIAG1_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

BDIAG1 get/set value routines.


Function Documentation

static int GetEntryRaw ( const oski_matBDIAG1_t A,
oski_index_t  i0,
oski_index_t  j0,
oski_value_t *  p_value 
) [static]

Reads a matrix entry.

Parameters:
[in,out]ABDIAG1 matrix. Must be non-NULL.
[in]i0Row of element (0-based).
[in]j0Column of element (0-based).
[in]p_valuePointer 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 oski_matBDIAG1_t::block_size, oski_matBDIAG1_t::diag, ERR_BAD_MAT, oski_matBDIAG1_t::num_full_blocks, oski_matBDIAG1_t::rem_block_size, VAL_ASSIGN, 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(), MACRO_TO_STRING, and oski_HandleError.

int oski_SetMatReprEntry ( void *  mat,
const oski_matcommon_t props,
oski_index_t  row,
oski_index_t  col,
oski_value_t  new_val 
)
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 oski_matcommon_t::is_herm, oski_matcommon_t::is_symm, OSKI_ERR_ZERO_ENTRY_COMPLEX, OSKI_ERR_ZERO_ENTRY_REAL, oski_matcommon_t::pattern, SetEntryRaw(), STORE_HERM, STORE_SINGLE, and STORE_SYMM.

static int SetEntryRaw ( oski_matBDIAG1_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]ABDIAG1 matrix. Must be non-NULL.
[in]store_opWhat to store: STORE_SINGLE, STORE_CONJ, STORE_SYMM, and STORE_HERM.
[in]i0Row of element (0-based).
[in]j0Column of element (0-based).
[in]new_valNew 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 oski_matBDIAG1_t::block_size, oski_matBDIAG1_t::diag, ERR_BAD_MAT, ERR_ZERO_ENTRY, oski_matBDIAG1_t::num_full_blocks, oski_matBDIAG1_t::rem_block_size, STORE_CONJ, STORE_HERM, STORE_SINGLE, STORE_SYMM, VAL_ASSIGN, and VAL_ASSIGN_CONJ.

Referenced by oski_SetMatReprEntry().