Show
Ignore:
Timestamp:
06/09/10 14:00:40 (14 years ago)
Author:
mido
Message:

astyle applied all over the library

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • library/tests/mat_checks.cpp

    r722 r1064  
    66bool AreClose ( const itpp::vec &expected, const itpp::vec &actual, 
    77                double tolerance ) { 
    8         if ( expected.length() != actual.length() ) { 
    9                 return false; 
    10         } 
     8    if ( expected.length() != actual.length() ) { 
     9        return false; 
     10    } 
    1111 
    12         for ( int i = 0; i < expected.length(); ++i ) { 
    13                 if ( !AreClose ( expected ( i ), actual ( i ), tolerance ) ) { 
    14                         return false; 
    15                 } 
    16         } 
     12    for ( int i = 0; i < expected.length(); ++i ) { 
     13        if ( !AreClose ( expected ( i ), actual ( i ), tolerance ) ) { 
     14            return false; 
     15        } 
     16    } 
    1717 
    18         return true; 
     18    return true; 
    1919} 
    2020 
    2121bool AreClose ( const itpp::vec &expected, const itpp::vec &actual, 
    2222                const itpp::vec &tolerance ) { 
    23         if ( ( expected.length() != actual.length() ) || 
    24                 ( actual.length() != tolerance.length() ) ) { 
    25                 return false; 
    26         } 
     23    if ( ( expected.length() != actual.length() ) || 
     24            ( actual.length() != tolerance.length() ) ) { 
     25        return false; 
     26    } 
    2727 
    28         for ( int i = 0; i < expected.length(); ++i ) { 
    29                 if ( !AreClose ( expected ( i ), actual ( i ), tolerance ( i ) ) ) { 
    30                         return false; 
    31                 } 
    32         } 
     28    for ( int i = 0; i < expected.length(); ++i ) { 
     29        if ( !AreClose ( expected ( i ), actual ( i ), tolerance ( i ) ) ) { 
     30            return false; 
     31        } 
     32    } 
    3333 
    34         return true; 
     34    return true; 
    3535} 
    3636 
    3737bool AreClose ( const itpp::mat &expected, const itpp::mat &actual, double tolerance ) { 
    38         if ( ( expected.rows() != actual.rows() ) || 
    39                 ( expected.cols() != actual.cols() ) ) { 
    40                 return false; 
    41         } 
     38    if ( ( expected.rows() != actual.rows() ) || 
     39            ( expected.cols() != actual.cols() ) ) { 
     40        return false; 
     41    } 
    4242 
    43         for ( int i = 0; i < expected.rows(); ++i ) { 
    44                 for ( int j = 0; j < expected.cols(); ++j ) { 
    45                         if ( !AreClose ( expected ( i, j ), actual ( i, j ), tolerance ) ) { 
    46                                 return false; 
    47                         } 
    48                 } 
    49         } 
     43    for ( int i = 0; i < expected.rows(); ++i ) { 
     44        for ( int j = 0; j < expected.cols(); ++j ) { 
     45            if ( !AreClose ( expected ( i, j ), actual ( i, j ), tolerance ) ) { 
     46                return false; 
     47            } 
     48        } 
     49    } 
    5050 
    51         return true; 
     51    return true; 
    5252} 
    5353 
     
    5959 
    6060CurrentContext::CurrentContext ( const char *name, int idx ) { 
    61         config_name = name; 
    62         index = idx; 
     61    config_name = name; 
     62    index = idx; 
    6363} 
    6464 
    6565CurrentContext::~CurrentContext() { 
    66         config_name = "???"; 
    67         index = -1; 
     66    config_name = "???"; 
     67    index = -1; 
    6868} 
    6969 
    7070std::string CurrentContext::format_context ( int ln ) { 
    71         std::stringstream ss; 
    72         ss << "error at " << config_name << '[' << index << ']'; 
     71    std::stringstream ss; 
     72    ss << "error at " << config_name << '[' << index << ']'; 
    7373 
    74         if ( ln >= 0 ) { 
    75                 ss << ", harness line " << ln; 
    76         } 
     74    if ( ln >= 0 ) { 
     75        ss << ", harness line " << ln; 
     76    } 
    7777 
    78         ss << ": "; 
    79         return ss.str(); 
     78    ss << ": "; 
     79    return ss.str(); 
    8080}