#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) |
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.
[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. |
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 | |||
) |
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 | |||
) |
References ERR_INMATPROP_CONFLICT, tagBebop_matBCSR_t::has_unit_diag_implicit, oski_matcommon_t::is_herm, oski_matcommon_t::is_symm, IS_VAL_ONE, OSKI_ERR_MOD_UNIT_DIAG_COMPLEX, OSKI_ERR_MOD_UNIT_DIAG_REAL, 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_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.
[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. |
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().