Changeset 51 for tests/test-fgesv.C
- Timestamp:
- 09/26/07 17:13:25 (1 year ago)
- Files:
-
- 1 modified
-
tests/test-fgesv.C (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tests/test-fgesv.C
r50 r51 12 12 #include <iomanip> 13 13 #include <iostream> 14 using namespace std; 15 14 16 #include "fflas-ffpack/modular-balanced.h" 15 17 #include "timer.h" … … 18 20 19 21 20 using namespace std;21 22 22 23 typedef Modular<double> Field; … … 37 38 F.init(zero,0.0); 38 39 F.init(one,1.0); 39 Field::Element * A, *B, *B2, *X ;40 Field::Element * A, *B, *B2, *X=NULL; 40 41 A = read_field(F,argv[2],&m,&n); 41 42 B = read_field(F,argv[3],&mb,&nb); … … 43 44 FFLAS::FFLAS_SIDE side = (atoi(argv[5])) ? FFLAS::FflasRight : FFLAS::FflasLeft; 44 45 45 size_t ldx ;46 size_t ldx=0; 46 47 size_t rhs = (side == FFLAS::FflasLeft) ? nb : mb; 47 48 if (m != n) … … 50 51 ldx = nb; 51 52 } else { 52 X = new Field::Element[m *mb];53 X = new Field::Element[mb*m]; 53 54 ldx = m; 54 55 } 55 56 56 if ( ((side == FFLAS::FflasRight) && ( m!= nb))57 || ((side == FFLAS::FflasLeft)&&( n!= mb)) ) {57 if ( ((side == FFLAS::FflasRight) && (n != nb)) 58 || ((side == FFLAS::FflasLeft)&&(m != mb)) ) { 58 59 cerr<<"Error in the dimensions of the input matrices"<<endl; 59 60 exit(-1); … … 71 72 else 72 73 R = FFPACK::fgesv (F, side, m, n, rhs, A, n, X, ldx, B, nb, &info); 74 if (info > 0){ 75 std::cerr<<"System is inconsistent"<<std::endl; 76 exit(-1); 77 } 78 73 79 t.stop(); 74 80 time+=t.usertime();
