Changeset 2318


Ignore:
Timestamp:
09/30/11 10:26:52 (13 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: No

Ready for Test: Yes

Interface Changes: No

What Interface Changed: Please list interface changes

Test Programs: List test programs

Put in Release Notes: Yes/No?

Module(s): Module Names change impacts.

Description: Describe your changes here...

Bug fix on handling of POLARIZATION table in MSWriter


File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/MSWriter.cpp

    r2309 r2318  
    422422    makePolMap() ;
    423423    initFrequencies() ;
     424    initCorrProductTemplate() ;
    424425
    425426    //
     
    11941195    for ( Int i = 0 ; i < n ; i++ )
    11951196      c[i] = (Int)polmap[nos[i]] ;
    1196     cp.resize( 2, n ) ;
    1197     if ( n == 1 )
    1198       cp = 0 ;
    1199     else if ( n == 2 ) {
    1200       cp.column( 0 ) = 0 ;
    1201       cp.column( 1 ) = 1 ;
    1202     }
    1203     else {
    1204       cp.column( 0 ) = 0 ;
    1205       cp.column( 1 ) = 1 ;
    1206       cp( 0, 1 ) = 0 ;
    1207       cp( 1, 1 ) = 1 ;
    1208       cp( 0, 2 ) = 1 ;
    1209       cp( 1, 2 ) = 0 ;
     1197    if ( n == 4 &&
     1198         ( poltype == "linear" || poltype == "circular" ) ) {
     1199      Int tmp = c[1] ;
     1200      c[1] = c[2] ;
     1201      c[2] = c[3] ;
     1202      c[3] = tmp ;
     1203    }
     1204    cp = corrProductTemplate[n] ;
     1205  }
     1206  void initCorrProductTemplate()
     1207  {
     1208    Int n = 1 ;
     1209    {
     1210      Matrix<Int> c( 2, n, 0 ) ;
     1211      corrProductTemplate[n] = c ;
     1212    }
     1213    n = 2 ;
     1214    {
     1215      Matrix<Int> c( 2, n, 0 ) ;
     1216      c.column( 1 ) = 1 ;
     1217      corrProductTemplate[n] = c ;
     1218    }
     1219    n = 4 ;
     1220    {
     1221      Matrix<Int> c( 2, n, 0 ) ;
     1222      c( 0, 2 ) = 1 ;
     1223      c( 0, 3 ) = 1 ;
     1224      c( 1, 1 ) = 1 ;
     1225      c( 1, 3 ) = 1 ;
     1226      corrProductTemplate[n] = c ;
    12101227    }
    12111228  }
     
    12741291  MFrequency::Types freqframe;
    12751292  Record srcRec;
     1293  map< Int, Matrix<Int> > corrProductTemplate;
    12761294};
    12771295
Note: See TracChangeset for help on using the changeset viewer.