This module implements "efficient" (i.e., O(nnz)) checks of various asserted input matrix properties.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <oski/config.h>
#include <oski/common.h>
#include <oski/matrix.h>
#include <oski/CSR/module.h>
Functions | |
static int | oski_CheckIndNonDecreasing (const oski_index_t *ptr, oski_index_t m) |
Returns 1 <==> pointers are non-decreasing. | |
static int | oski_CheckIndexBase (const oski_index_t *ptr, const oski_index_t *ind, oski_index_t m, oski_index_t n, oski_index_t base_index) |
Returns 1 <==> indices match the specified base. | |
static int | oski_CheckHasSortedInds (const oski_index_t *ptr, const oski_index_t *ind, oski_index_t m, oski_index_t b, int *p_has_sorted_indices) |
Returns 1 <==> column indices are, within each row, sorted. | |
static int | oski_CheckHasUniqueInds (const oski_index_t *ptr, const oski_index_t *ind, oski_index_t m, oski_index_t n, oski_index_t b, int *p_has_unique_indices) |
Returns 1 <==> column indices are, within each row, unique. | |
static int | oski_CheckIsUpperTriangular (const oski_index_t *ptr, const oski_index_t *ind, oski_index_t m, oski_index_t b) |
Returns 0 <==> Pattern is upper triangular, and returns the offending logical row number (1-based) otherwise. | |
static int | oski_CheckIsLowerTriangular (const oski_index_t *ptr, const oski_index_t *ind, oski_index_t m, oski_index_t b) |
Returns 0 <==> Pattern is lower triangular, and returns the offending logical row number (1-based) otherwise. | |
static int | oski_CheckPattern (const oski_index_t *ptr, const oski_index_t *ind, oski_index_t m, oski_index_t n, oski_index_t b, oski_inmatprop_t pattern) |
Verify that the stored part of the CSR matrix matches the specified pattern. | |
static int | oski_CheckUnitDiagImplicit (const oski_index_t *ptr, const oski_index_t *ind, oski_index_t m, oski_index_t b, int has_unit_diag_implicit) |
Verify whether or not matrix has an implicit unit diagonal. | |
static int | BypassCheck (void) |
Check run-time environment variable, OSKI_BYPASS_CHECK, to see whether the user wants us to skip the checking of asserted input matrix properties. | |
int | oski_CheckCSR (const oski_index_t *ptr, const oski_index_t *ind, oski_index_t m, oski_index_t n, oski_inmatpropset_t *props) |
Verify that a CSR matrix representation satisfies asserted properties. |
|
Verify that a CSR matrix representation satisfies asserted properties. This routine verifies that the following properties, if asserted, are true:
The implementation relies on O(nnz) algorithms to verify these properties. If any of the properties can be strengthened to improve kernel performance, then the properties are modified to reflect the stronger assertion. There are two specific examples:
|
|
Returns 1 <==> column indices are, within each row, sorted.
|
|
Returns 1 <==> column indices are, within each row, unique.
|
|
Returns 1 <==> indices match the specified base.
|
|
Returns 1 <==> pointers are non-decreasing.
|
|
Returns 0 <==> Pattern is lower triangular, and returns the offending logical row number (1-based) otherwise. This implementation does not call the error handler if the pattern is not lower triangular.
|
|
Returns 0 <==> Pattern is upper triangular, and returns the offending logical row number (1-based) otherwise. This implementation does not call the error handler if the pattern is not upper triangular.
|
|
Verify that the stored part of the CSR matrix matches the specified pattern.
|
|
Verify whether or not matrix has an implicit unit diagonal.
|