#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <oski/config.h>
#include <oski/common.h>
#include <oski/modloader.h>
#include <oski/matrix.h>
#include <oski/CSR/format.h>
#include <oski/CSR/module.h>
#include <oski/BCSR/format.h>
#include <oski/BCSR/module.h>
#include <oski/xforms_internal.h>
Functions | |
static int | ConvertFullBlocksFromCSR (const oski_index_t *ptr, const oski_index_t *ind, const oski_value_t *val, oski_index_t base, oski_index_t m, oski_index_t n, oski_index_t r, oski_index_t c, oski_index_t **p_bptr, oski_index_t **p_bind, oski_value_t **p_bval) |
Given an CSR matrix , convert the first rows into BCSR format. | |
static int | ConvertFromCSR (oski_matBCSR_t *A, oski_index_t r, oski_index_t c, const oski_index_t *ptr, const oski_index_t *ind, const oski_value_t *val, oski_index_t m, oski_index_t n, oski_index_t base) |
Convert from full CSR to BCSR. | |
static int | ExpandSymm (const oski_matCSR_t *mat, const oski_matcommon_t *props, oski_matCSR_t **p_mat_full) |
void * | oski_CreateMatReprFromCSR (const oski_matCSR_t *mat, const oski_matcommon_t *props,...) |
Method: Instantiate from an existing CSR representation. | |
static void | CopyOne (const oski_matBCSR_t *A, oski_matCSR_t *B, oski_index_t i0) |
static int | ConvertToCSR (const oski_matBCSR_t *A, const oski_matcommon_t *props, oski_matCSR_t *B) |
oski_matCSR_t * | oski_ConvertMatReprToCSR (const void *mat, const oski_matcommon_t *props) |
Method: Convert to CSR format. | |
void * | oski_CopyMatRepr (const void *mat, const oski_matcommon_t *props) |
Method: Duplicate a matrix representation. | |
void | oski_DestroyMatRepr (void *mat) |
Method: Destroy matrix type-specific representation. | |
int | oski_CreateLuaMatReprFromCSR (lua_State *L) |
Matrix-type specific method to convert from a CSR matrix, with arguments passed on the Lua stack. |
|
Convert from full CSR to BCSR.
|
|
Given an CSR matrix , convert the first rows into BCSR format. If the converted matrix has blocks, this implementation executes in time, but requires auxiliary storage space to store a dense copy of one block row. This long procedure is divided into two phases:
This routine assumes the CSR matrix uses full storage, but otherwise is flexible with regard to the following variations:
|