trisolve.c File Reference

Detailed Description

Basic test of the CSR/CSC sparse triangular solve.

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.

#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"

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_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]


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 $x$ computed by a triangular solve routine against the true solution $x_{\mathrm{true}}$, assuming the original triangular matrix had condition number bounded by 1.
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[])

Variable Documentation

const oski_value_t TL_alpha[NUM_ALPHA] [static]

Initial value:

  MAKE_VAL_COMPLEX (1.0, 0.0),
  MAKE_VAL_COMPLEX (-1.0, 0.0),


const oski_matop_t TL_op[NUM_OP] [static]

Initial value:

const oski_storage_t TL_orient[NUM_ORIENT] [static]

Initial value:

const oski_inmatprop_t TL_shape[NUM_SHAPE] [static]

Initial value:

Generated on Wed Sep 19 16:41:23 2007 for BeBOP Optimized Sparse Kernel Interface Library by  doxygen 1.4.6