lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [4877] Respell certain arguments


From: Greg Chicares
Subject: [lmi-commits] [4877] Respell certain arguments
Date: Sat, 01 May 2010 01:42:16 +0000

Revision: 4877
          http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=4877
Author:   chicares
Date:     2010-05-01 01:42:15 +0000 (Sat, 01 May 2010)
Log Message:
-----------
Respell certain arguments

Modified Paths:
--------------
    lmi/trunk/dbvalue.cpp
    lmi/trunk/ihs_dbvalue.cpp
    lmi/trunk/ihs_dbvalue.hpp

Modified: lmi/trunk/dbvalue.cpp
===================================================================
--- lmi/trunk/dbvalue.cpp       2010-05-01 01:15:24 UTC (rev 4876)
+++ lmi/trunk/dbvalue.cpp       2010-05-01 01:42:15 UTC (rev 4877)
@@ -56,51 +56,51 @@
 
 //============================================================================
 TDBValue::TDBValue
-    (int                inputkey
-    ,int                inputndims
-    ,int const*         inputdims
-    ,double const*      inputdata
+    (int                key
+    ,int                ndims
+    ,int const*         dims
+    ,double const*      data
     ,std::string const& gloss
     )
-    :key_   (inputkey)
-    ,ndims_ (inputndims)
+    :key_   (key)
+    ,ndims_ (ndims)
     ,gloss_ (gloss)
 {
     dims_ = new int[ndims_];
-    deprecated::dupmem(dims_, inputdims, ndims_);
+    deprecated::dupmem(dims_, dims, ndims_);
     ndata_ = getndata();
 
     data_ = new double[ndata_];
-    deprecated::dupmem(data_, inputdata, ndata_);
+    deprecated::dupmem(data_, data, ndata_);
 }
 
 //============================================================================
-TDBValue::TDBValue(TDBValue const& rhs)
+TDBValue::TDBValue(TDBValue const& z)
     :obstruct_slicing<TDBValue>()
-    ,key_   (rhs.key_)
-    ,ndims_ (rhs.ndims_)
-    ,ndata_ (rhs.ndata_)
+    ,key_   (z.key_  )
+    ,ndims_ (z.ndims_)
+    ,ndata_ (z.ndata_)
 {
     dims_ = new int[ndims_];
-    deprecated::dupmem(dims_, rhs.dims_, ndims_);
+    deprecated::dupmem(dims_, z.dims_, ndims_);
     data_ = new double[ndata_];
-    deprecated::dupmem(data_, rhs.data_, ndata_);
+    deprecated::dupmem(data_, z.data_, ndata_);
 }
 
 //============================================================================
-TDBValue& TDBValue::operator=(TDBValue const& rhs)
+TDBValue& TDBValue::operator=(TDBValue const& z)
 {
-    if(this != &rhs)
+    if(this != &z)
         {
-        key_   = rhs.key_;
-        ndata_ = rhs.ndata_;
-        ndims_ = rhs.ndims_;
+        key_   = z.key_;
+        ndata_ = z.ndata_;
+        ndims_ = z.ndims_;
         delete[]dims_;
         delete[]data_;
         dims_ = new int[ndims_];
-        deprecated::dupmem(dims_, rhs.dims_, ndims_);
+        deprecated::dupmem(dims_, z.dims_, ndims_);
         data_ = new double[ndata_];
-        deprecated::dupmem(data_, rhs.data_, ndata_);
+        deprecated::dupmem(data_, z.data_, ndata_);
         }
     return *this;
 }

Modified: lmi/trunk/ihs_dbvalue.cpp
===================================================================
--- lmi/trunk/ihs_dbvalue.cpp   2010-05-01 01:15:24 UTC (rev 4876)
+++ lmi/trunk/ihs_dbvalue.cpp   2010-05-01 01:42:15 UTC (rev 4877)
@@ -84,32 +84,32 @@
 /// Handy ctor for writing programs to generate '.database' files.
 
 TDBValue::TDBValue
-    (int                a_key
-    ,int                a_ndims
-    ,int const*         a_dims
-    ,double const*      a_data
-    ,std::string const& a_gloss
+    (int                key
+    ,int                ndims
+    ,int const*         dims
+    ,double const*      data
+    ,std::string const& gloss
     )
-    :key_          (a_key)
-    ,gloss_        (a_gloss)
+    :key_          (key)
+    ,gloss_        (gloss)
 {
-    axis_lengths_ .assign(a_dims, a_dims + a_ndims);
-    data_values_  .assign(a_data, a_data + getndata());
+    axis_lengths_ .assign(dims, dims + ndims);
+    data_values_  .assign(data, data + getndata());
 
     ParanoidCheck();
 }
 
 //============================================================================
 TDBValue::TDBValue
-    (int                        a_key
-    ,std::vector<int> const&    a_dims
-    ,std::vector<double> const& a_data
-    ,std::string const&         a_gloss
+    (int                        key
+    ,std::vector<int> const&    dims
+    ,std::vector<double> const& data
+    ,std::string const&         gloss
     )
-    :key_          (a_key)
-    ,axis_lengths_ (a_dims)
-    ,data_values_  (a_data)
-    ,gloss_        (a_gloss)
+    :key_          (key)
+    ,axis_lengths_ (dims)
+    ,data_values_  (data)
+    ,gloss_        (gloss)
 {
     ParanoidCheck();
 }
@@ -117,15 +117,15 @@
 /// Handy ctor for scalar data.
 
 TDBValue::TDBValue
-    (int                a_key
-    ,double             a_datum
-    ,std::string const& a_gloss
+    (int                key
+    ,double             datum
+    ,std::string const& gloss
     )
-    :key_          (a_key)
-    ,gloss_        (a_gloss)
+    :key_          (key)
+    ,gloss_        (gloss)
 {
     axis_lengths_ .assign(ScalarDims, ScalarDims + e_number_of_axes);
-    data_values_  .push_back(a_datum);
+    data_values_  .push_back(datum);
 }
 
 //============================================================================
@@ -230,9 +230,9 @@
 }
 
 //============================================================================
-double& TDBValue::operator[](std::vector<int> const& a_idx)
+double& TDBValue::operator[](std::vector<int> const& idx)
 {
-    LMI_ASSERT(e_number_of_axes == a_idx.size());
+    LMI_ASSERT(e_number_of_axes == idx.size());
 
     if(e_number_of_axes != axis_lengths_.size())
         {
@@ -253,8 +253,8 @@
         {
         if(1 != axis_lengths_[j])
             {
-            LMI_ASSERT(a_idx[j] < axis_lengths_[j]);
-            z = z * axis_lengths_[j] + a_idx[j];
+            LMI_ASSERT(idx[j] < axis_lengths_[j]);
+            z = z * axis_lengths_[j] + idx[j];
             }
         }
 // TODO ?? erase    z *= axis_lengths_.back();
@@ -272,9 +272,9 @@
 }
 
 //============================================================================
-double const* TDBValue::operator[](TDBIndex const& a_idx) const
+double const* TDBValue::operator[](TDBIndex const& idx) const
 {
-    std::vector<double>idx(a_idx.GetIdx());
+    std::vector<double> index(idx.GetIdx());
 
     LMI_ASSERT(0 < axis_lengths_.size());
     int z = 0;
@@ -283,8 +283,8 @@
         {
         if(1 != axis_lengths_[j])
             {
-            LMI_ASSERT(idx[j] < axis_lengths_[j]);
-            z = z * axis_lengths_[j] + static_cast<int>(idx[j]);
+            LMI_ASSERT(index[j] < axis_lengths_[j]);
+            z = z * axis_lengths_[j] + static_cast<int>(index[j]);
             }
         }
     z *= axis_lengths_.back();
@@ -302,52 +302,52 @@
 }
 
 //============================================================================
-void TDBValue::Reshape(std::vector<int> const& a_dims)
+void TDBValue::Reshape(std::vector<int> const& dims)
 {
     // Create a new instance of this class having the same
     // key but the desired number of axes
     std::vector<double> new_data
         (
         std::accumulate
-            (a_dims.begin()
-            ,a_dims.end()
+            (dims.begin()
+            ,dims.end()
             ,1
             ,std::multiplies<int>()
             )
         );
     TDBValue new_object
         (GetKey()
-        ,a_dims
+        ,dims
         ,new_data
         );
 
-    // ET !! std::vector<int> max_dims_used = max(axis_lengths_, a_dims);
+    // ET !! std::vector<int> max_dims_used = max(axis_lengths_, dims);
     // ...and then expunge this comment:
     // greater length of src or dst along each axis
     std::vector<int> max_dims_used(e_number_of_axes);
     std::transform
         (axis_lengths_.begin()
         ,axis_lengths_.end()
-        ,a_dims.begin()
+        ,dims.begin()
         ,max_dims_used.begin()
         ,greater_of<int>()
         );
     // TODO ?? Oops--erase above std::transform() call--want only dst axes.
-    max_dims_used = a_dims;
+    max_dims_used = dims;
 
     // Number of times we'll go through the assignment loop.
-    // TODO ?? prolly should use max_dims_used instead of a_dims here (they're 
the same).
+    // TODO ?? prolly should use max_dims_used instead of dims here (they're 
the same).
     int n_iter = std::accumulate
-        (a_dims.begin()
-        ,a_dims.end()
+        (dims.begin()
+        ,dims.end()
         ,1
         ,std::multiplies<int>()
         );
 
-    // ET !! std::vector<int> dst_max_idx = a_dims - 1;
+    // ET !! std::vector<int> dst_max_idx = dims - 1;
     // ...and then expunge this comment:
     // max index of dst along each axis
-    std::vector<int> dst_max_idx(a_dims);
+    std::vector<int> dst_max_idx(dims);
     std::transform
         (dst_max_idx.begin()
         ,dst_max_idx.end()
@@ -408,7 +408,7 @@
         }
 
 // erase    (*this) = new_object;
-    axis_lengths_ = a_dims;
+    axis_lengths_ = dims;
     data_values_ = new_object.data_values_;
 }
 
@@ -514,10 +514,10 @@
 }
 
 //============================================================================
-int TDBValue::GetLength(int a_axis) const
+int TDBValue::GetLength(int axis) const
 {
-    LMI_ASSERT(0 <= a_axis && a_axis < static_cast<int>(axis_lengths_.size()));
-    return axis_lengths_[a_axis];
+    LMI_ASSERT(0 <= axis && axis < static_cast<int>(axis_lengths_.size()));
+    return axis_lengths_[axis];
 }
 
 //============================================================================

Modified: lmi/trunk/ihs_dbvalue.hpp
===================================================================
--- lmi/trunk/ihs_dbvalue.hpp   2010-05-01 01:15:24 UTC (rev 4876)
+++ lmi/trunk/ihs_dbvalue.hpp   2010-05-01 01:42:15 UTC (rev 4877)
@@ -78,38 +78,38 @@
 
     TDBValue();
     TDBValue
-        (int                a_key
-        ,int                a_ndims
-        ,int const*         a_dims
-        ,double const*      a_data
-        ,std::string const& a_gloss = std::string()
+        (int                key
+        ,int                ndims
+        ,int const*         dims
+        ,double const*      data
+        ,std::string const& gloss = std::string()
         );
     TDBValue
-        (int                        a_key
-        ,std::vector<int> const&    a_dims
-        ,std::vector<double> const& a_data
-        ,std::string const&         a_gloss = std::string()
+        (int                        key
+        ,std::vector<int> const&    dims
+        ,std::vector<double> const& data
+        ,std::string const&         gloss = std::string()
         );
     TDBValue
-        (int                a_key
-        ,double             a_datum
-        ,std::string const& a_gloss = std::string()
+        (int                key
+        ,double             datum
+        ,std::string const& gloss = std::string()
         );
     TDBValue(TDBValue const&);
     TDBValue& operator=(TDBValue const&);
     ~TDBValue();
 
-    double const* operator[](TDBIndex const& a_idx) const;
-    double&       operator[](std::vector<int> const& a_idx);
+    double const* operator[](TDBIndex const& idx) const;
+    double&       operator[](std::vector<int> const& idx);
 
-    int GetKey()              const;
+    int GetKey()            const;
     // TODO ?? Isn't the following function useless?
-    int GetNDims()            const;
-    int GetLength()           const;
-    int GetLength(int a_axis) const;
+    int GetNDims()          const;
+    int GetLength()         const;
+    int GetLength(int axis) const;
     std::vector<int> const& GetAxisLengths() const;
 
-    void Reshape(std::vector<int> const& a_dims);
+    void Reshape(std::vector<int> const& dims);
 
     std::ostream& write(std::ostream&) const;
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]