lib_ex_pour_HZpp/Partie_2/algebre_lineaire/sparselib++/sp1_5c/testing/tsl.cc

1 line
12 KiB
C++
Raw Normal View History

/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ /* ******** *** SparseLib++ */ /* ******* ** *** *** *** v. 1.5c */ /* ***** *** ******** ******** */ /* ***** *** ******** ******** R. Pozo */ /* ** ******* *** ** *** *** K. Remington */ /* ******** ******** A. Lumsdaine */ /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ /* */ /* */ /* SparseLib++ : Sparse Matrix Library */ /* */ /* National Institute of Standards and Technology */ /* University of Notre Dame */ /* Authors: R. Pozo, K. Remington, A. Lumsdaine */ /* */ /* NOTICE */ /* */ /* Permission to use, copy, modify, and distribute this software and */ /* its documentation for any purpose and without fee is hereby granted */ /* provided that the above notice appear in all copies and supporting */ /* documentation. */ /* */ /* Neither the Institutions (National Institute of Standards and Technology, */ /* University of Notre Dame) nor the Authors make any representations about */ /* the suitability of this software for any purpose. This software is */ /* provided ``as is'' without expressed or implied warranty. */ /* */ /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ #include <stdlib.h> #include "compcol_double.h" #include "comprow_double.h" #include "coord_double.h" #include "iohb_double.h" #include <console.h> // sp<73>cific mac : GR #include <SIOUX.h> // sp<73>cific mac : GR int main(int argc, char * argv[]) { argc = ccommand( &argv ); // sp<73>cific mac : GR if (argc < 2) { cerr << "Usage: " << argv[0] << " HBfile [-v]" << endl; exit(-1); } int verbose = 0; if (argc > 2 ) { if (argv[2][1] == 'v') verbose = 1; else { cerr << "Usage: " << argv[0] << " HBfile [-v]" << endl; exit(-1); } } /******************************************************************/ // Testing readHB functions... // /******************************************************************/ if (verbose) cout << "Testing readHB functions:" << endl << endl; CompCol_Mat_double A1; int M, N, nonzeros, nrhs; readHB_info(argv[1], &M, &N, &nonzeros, &nrhs); if (verbose) { cout << "Return values from readHB_info:" << endl; cout << "M = " << M << " N = " << N ; cout << " Nonzeros = " << nonzeros << " Nrhs = " << nrhs << endl; cout << "Output from readHB_info in verbose mode: " << endl; cout << "......................................................"<<endl; readHB_info(argv[1], &M, &N, &nonzeros, &nrhs); cout << "......................................................"<<endl << endl; cout << "Reading the matrix from " << argv[1] << "..." << endl; } readHB_mat(argv[1], &A1); if ( nrhs > 0) {