Changeset 1151 for trunk


Ignore:
Timestamp:
Feb 25, 2008, 11:32:04 PM (14 years ago)
Author:
Peter
Message:

remove operator [] in Vector.

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/matrix_test.cc

    r1121 r1151  
    124124  for (size_t i=0; i<v5subrow.size(); ++i) {
    125125    v5subrow_sum+=v5subrow(i);
    126     v5subrow[i]=0;
     126    v5subrow(i)=0;
    127127  }
    128128  double m5_sum3=0;
  • trunk/test/regression_test.cc

    r1121 r1151  
    218218    polynomialfit.fit(x,ln_y);
    219219    utility::Vector fit=polynomialfit.fit_parameters();
    220     if (fabs(fit[0]-1.012229646706 + fit[1]-0.012561322528 +
    221              fit[2]+1.159674470130)>1e-11) {
     220    if (fabs(fit(0)-1.012229646706 + fit(1)-0.012561322528 +
     221             fit(2)+1.159674470130)>1e-11) {
    222222      *error << "regression_Polynomial: cannot reproduce fit." << std::endl;
    223223      ok=false;
  • trunk/test/svd_test.cc

    r1121 r1151  
    5959  utility::Matrix S(s.size(),s.size());
    6060  for (size_t i=0; i<s.size(); ++i)
    61     S(i,i)=s[i];
     61    S(i,i)=s(i);
    6262  utility::Matrix Vtranspose=svd.V();
    6363  Vtranspose.transpose();
  • trunk/test/vector_test.cc

    r1135 r1151  
    7777  sum_before=0;
    7878  for (size_t i=0; i<vec.size(); i+=2)
    79     sum_before+=vec[i];
     79    sum_before+=vec(i);
    8080  utility::VectorView vec_view(vec,0,6,2);
    8181  sum_after=utility::sum(vec_view);
    8282  ok &= (sum_after==sum_before);
    83   vec[0]=0;
    84   vec_view[0]=24;
    85   ok &= (vec[0]==vec_view[0]);
     83  vec(0)=0;
     84  vec_view(0)=24;
     85  ok &= (vec(0)==vec_view(0));
    8686
    8787  // Test of const view implementation (make sure no zero pointer is
     
    149149  {
    150150    *message << "assignment operator on view" << std::endl;
    151     vec[3]=vec[4]=vec[5]=13;
     151    vec(3)=vec(4)=vec(5)=13;
    152152    utility::VectorView vec_view(vec,3,3,1);
    153153    utility::Vector vec2(3,123.0);
    154154    vec_view=vec2;
    155     if (vec[3]!=vec_view[0] || vec[4]!=vec_view[1] || vec[5]!=vec_view[2]){
     155    if (vec(3)!=vec_view(0) || vec(4)!=vec_view(1) || vec(5)!=vec_view(2)){
    156156      *message << " failed\n";
    157157      ok=false;
     
    187187    *message << "\tcloned vector view independence" << std::endl;
    188188    delete vec_view;
    189     if (vec[3]!=vec_view2[0] || vec[4]!=vec_view2[1] || vec[5]!=vec_view2[2])
     189    if (vec(3)!=vec_view2(0) || vec(4)!=vec_view2(1) || vec(5)!=vec_view2(2))
    190190      this_ok=false;
    191191
  • trunk/yat/utility/VectorBase.cc

    r1121 r1151  
    110110
    111111
    112   const double& VectorBase::operator[](size_t i) const
    113   {
    114     return this->operator()(i);
    115   }
    116 
    117 
    118112  bool VectorBase::operator==(const VectorBase& other) const
    119113  {
  • trunk/yat/utility/VectorBase.h

    r1125 r1151  
    118118    */
    119119    const double& operator()(size_t i) const;
    120     // Peter, remove this one
    121     /// \deprecated
    122     const double& operator[](size_t i) const;
    123120
    124121    /**
  • trunk/yat/utility/VectorMutable.cc

    r1121 r1151  
    122122
    123123
    124   double& VectorMutable::operator[](size_t i)
    125   {
    126     return this->operator()(i);
    127   }
    128 
    129 
    130124  const VectorMutable& VectorMutable::operator+=(double d)
    131125  {
  • trunk/yat/utility/VectorMutable.h

    r1125 r1151  
    159159    */
    160160    double& operator()(size_t i);
    161     // Peter, remove this one
    162     /// \deprecated
    163     double& operator[](size_t i);
     161
    164162    // to allow overload from base class
    165163    using VectorBase::operator();
    166     using VectorBase::operator[];
    167164
    168165    /**
Note: See TracChangeset for help on using the changeset viewer.