This folder contains a comprehensive suite of test programs to check the
correctness of the BLAS-RMD adjoints. There are two groups of tests as outlined
below, primary and additional.

The source programs for the additional tests are automatically generated in the
folder test/more when make is issued, using the following files:
   build-more-tests.awk
   test-more-param.txt
   test-more-template.txt

The following targes exist in the Makefile:
   make test         Make all the test program executables but do not run them
   make stest        Make the primary single precision tests
   make dtest        - primary double precision tests
   make moretest     Make the additional tests
   make testrun      Run all the tests, making first if necessary
   make stestrun     Run the single precision tests, making first
   make dtestrun     Run the double precision tests, making first
   make basetestrun  Run all the primary tests, making first
   make moretestrun  Run the additional tests, making first
   make clean        Remove all object and executable files and the
                     folder more along with all its contents.

PRIMARY TESTS (test of correct derivatives).
   These involve comparison with numerical derivatives. There are custom written
   test routines for each RMD-operation, that carry out the comparison for
   random matrices of all sizes and shapes upto 5, bandwidths from 0-3, all
   possible combinations of the control character options (side, uplo, diag and
   trans_), and random alpha and beta, as apropriate.

ADDITIONAL TESTS
   Check, for all RMD-operations, that:
      (a) all arrays retained from blas call remain unchanged
      (b) not selected adjoints always remain unchanged
      (c) selected adjoints always have the same values
      (d) added to adjoints are indeed added to
   Because (c) compares with the results of the primary tests, it is not
   necessary to compare with numerical derivatives. These tests are carried out
   for matrix size 4, bandwidth 2, all possible values of sel, and all
   combinations of side, uplo, diag and trans_.

FORMULAE FOR TESTING
  Let
    u ---> BLAS ---> v
    va,u,v ---> RMD ---> ua (va, ua are adjoints)

  Analytical Jacobian:
    df/dui = sum_j df/dvj * dvj/dui
    ua = J(u)*va

    so if va = ei then ua = i-th column of J. Use this to compute J:

    for i = 1...n:
       J(:,i) = RMD(ei,u,v)

  Numerical Jacobian:

    Jnum(i,j) = delta-vj/delta-ui = (vj(u+h*ei) - vj(u-h*ei))/(2*h)

  Then compare J and Jnum
  
    
