Changeset 1137


Ignore:
Timestamp:
Feb 24, 2008, 1:51:58 AM (13 years ago)
Author:
Peter
Message:

refs #327 for utility::matrix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/view_test.cc

    r1131 r1137  
    5151    data1(i,0)=7+i;
    5252  }
     53 
    5354
    5455  Matrix data2(3,1,1.0);
     
    5657  VectorConstView a=data1.column_const_view(0);
    5758  VectorView b=data2.column_view(0);
     59  VectorView bajs(data2, 0, false);
     60  if (a(0)!=data1(0,0)){
     61    *message << "Matrix::column_const_view failed\n";
     62    ok =false;
     63  }
     64  if (b(0)!=data2(0,0)){
     65    *message << "Matrix::column_view failed\n";
     66    ok =false;
     67  }
    5868
    5969  data1.column_const_view(0);
     
    6474  if ( !(b(0)==1 && b(1)==(1) && b(2)==1) )
    6575    ok = false;
     76
     77  if (a.begin()!=data1.begin_column(0)){
     78    ok=false;
     79    *message << "VectorConstView::begin should equal "
     80             << "Matrix::begin_column(size_t)\n";
     81  }
     82  if (a.end()!=data1.end_column(0)) {
     83    ok=false;
     84    *message << "VectorConstView::end should equal "
     85             << "Matrix::end_column(size_t)\n";
     86  }
     87  if (b.begin()!=data2.begin_column(0)){
     88    ok=false;
     89    *message << "VectorView::begin "
     90             << b.begin().base() << " should equal\n"
     91             << "Matrix::begin_column(size_t) "
     92             << data1.begin_column(0).base() << std::endl;
     93  }
     94  if (b.end()!=data2.end_column(0)){
     95    ok=false;
     96    *message << "VectorView::end should equal "
     97             << "Matrix::end_column(size_t)\n";
     98  }
     99  VectorConstView c=data1.row_const_view(0);
     100  VectorView d=data2.row_view(0);
     101  if (c.begin()!=data1.begin_row(0)) {
     102    ok=false;
     103    *message << "VectorConstView::begin should equal "
     104             << "Matrix::begin_row(size_t)\n";
     105  }
     106  if (c.end()!=data1.end_row(0)){
     107    ok=false;
     108    *message << "VectorConstView::end should equal "
     109             << "Matrix::end_row(size_t)\n";
     110  }
     111  if (d.begin()!=data2.begin_row(0)){
     112    ok=false;
     113    *message << "VectorView::begin should equal "
     114             << "Matrix::begin_row(size_t)\n";
     115  }
     116  if (d.end()!=data2.end_row(0)){
     117    ok=false;
     118    *message << "VectorView::end should equal "
     119             << "Matrix::end_row(size_t)\n";
     120  }
     121
    66122
    67123  // test that VectorConstView created from VectorView is independent
Note: See TracChangeset for help on using the changeset viewer.