BeBOP Optimized Sparse Kernel Interface Library
1.0.1h
|
Basic test of the CSR/CSC sparse triangular solve. More...
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <oski/common.h>
#include <oski/mangle.h>
#include <oski/matrix.h>
#include <oski/trisolve.h>
#include "abort_prog.h"
#include "testvec.h"
Functions | |
static oski_matrix_t | GenTriMat (oski_index_t m, oski_inmatprop_t shape, int unitdiag, int sorted, int indbase) |
Returns a handle to a newly allocated matrix. | |
static void | Check (const oski_vecview_t x_true, oski_vecview_t x) |
Checks a solution ![]() ![]() | |
static void | TestKernel (oski_index_t m, oski_matrix_t T, const oski_vecview_t x_true) |
static void | TestVec (oski_index_t m, oski_matrix_t T) |
static void | TestAll (oski_index_t m) |
int | main (int argc, char *argv[]) |
Matrix parameter test lists. | |
#define | NUM_UNIT_DIAG 2 |
#define | NUM_SHAPE 2 |
#define | NUM_SORT_INDS 2 |
#define | NUM_INDBASE 2 |
static const int | TL_unit_diag [NUM_UNIT_DIAG] = { 0, 1 } |
static const oski_inmatprop_t | TL_shape [NUM_SHAPE] |
static const int | TL_sort_inds [NUM_SORT_INDS] = { 0, 1 } |
static const int | TL_indbase [NUM_INDBASE] = { 0, 1 } |
Vector parameter test lists. | |
#define | NUM_NUM_VECS 2 |
#define | NUM_USE_MINSTRIDE 2 |
#define | NUM_ORIENT 2 |
static const oski_index_t | TL_num_vecs [NUM_NUM_VECS] = { 1, 3 } |
static const int | TL_use_minstride [NUM_USE_MINSTRIDE] = { 0, 1 } |
static const oski_storage_t | TL_orient [NUM_ORIENT] |
Triangular solve kernel parameter test lists. | |
#define | NUM_OP 3 |
#define | NUM_ALPHA 3 |
static const oski_matop_t | TL_op [NUM_OP] |
static const oski_value_t | TL_alpha [NUM_ALPHA] |
Basic test of the CSR/CSC sparse triangular solve.
Comprehensive test of sparse triangular solve for an arbitrary data structure transformation (specified by an OSKI-Lua program).
This program generates random but well-conditioned triangular matrices, and uses a crude norm-check to test the results of calling oski_MatTrisolve().
This program will test CSR by default. To test CSC, re-compile and define the compile-time macro, TEST_CSC, to a non-zero value.
This program generates random but well-conditioned triangular matrices, and uses a crude norm-check to test the results of calling oski_MatTrisolve().
This initial matrix starts, by default, in CSR format. To start initially in CSC format, define the compile-time macro, TEST_CSC. If no transform is specified on the command-line, this will by default test CSC format if the initial format is CSR, or CSR format if the initial format is CSC.
static oski_matrix_t GenTriMat | ( | oski_index_t | m, |
oski_inmatprop_t | shape, | ||
int | unitdiag, | ||
int | sorted, | ||
int | indbase | ||
) | [static] |
Returns a handle to a newly allocated matrix.
References ABORT, COPY_INPUTMAT, ERR_OUT_OF_MEMORY, INDEX_ONE_BASED, INDEX_SORTED, INDEX_UNSORTED, INDEX_ZERO_BASED, INVALID_MAT, MAT_DIAG_EXPLICIT, MAT_UNIT_DIAG_IMPLICIT, oski_Free, and testmat_GenTriCSR().
const oski_value_t TL_alpha[NUM_ALPHA] [static] |
{ MAKE_VAL_COMPLEX (1.0, 0.0), MAKE_VAL_COMPLEX (-1.0, 0.0), }
const oski_matop_t TL_op[NUM_OP] [static] |
{ OP_NORMAL, OP_TRANS, OP_CONJ_TRANS }
const oski_storage_t TL_orient[NUM_ORIENT] [static] |
const oski_inmatprop_t TL_shape[NUM_SHAPE] [static] |