Changeset 51 for tests

Show
Ignore:
Timestamp:
09/26/07 17:13:25 (1 year ago)
Author:
pernet
Message:

Make test-fgesv work. No bugs known.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • tests/test-fgesv.C

    r50 r51  
    1212#include <iomanip> 
    1313#include <iostream> 
     14using namespace std; 
     15 
    1416#include "fflas-ffpack/modular-balanced.h" 
    1517#include "timer.h" 
     
    1820 
    1921 
    20 using namespace std; 
    2122 
    2223typedef Modular<double> Field; 
     
    3738        F.init(zero,0.0); 
    3839        F.init(one,1.0); 
    39         Field::Element * A, *B, *B2, *X; 
     40        Field::Element * A, *B, *B2, *X=NULL; 
    4041        A = read_field(F,argv[2],&m,&n); 
    4142        B = read_field(F,argv[3],&mb,&nb); 
     
    4344        FFLAS::FFLAS_SIDE side = (atoi(argv[5])) ? FFLAS::FflasRight :  FFLAS::FflasLeft; 
    4445                 
    45         size_t ldx; 
     46        size_t ldx=0; 
    4647        size_t rhs = (side == FFLAS::FflasLeft) ? nb : mb; 
    4748        if (m != n) 
     
    5051                        ldx = nb; 
    5152                } else { 
    52                         X = new Field::Element[m*mb]; 
     53                        X = new Field::Element[mb*m]; 
    5354                        ldx = m; 
    5455                } 
    5556         
    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)) ) { 
    5859                cerr<<"Error in the dimensions of the input matrices"<<endl; 
    5960                exit(-1); 
     
    7172                else 
    7273                        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                         
    7379                t.stop(); 
    7480                time+=t.usertime();