lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [4875] Remove gratuitous dissimilarities


From: Greg Chicares
Subject: [lmi-commits] [4875] Remove gratuitous dissimilarities
Date: Sat, 01 May 2010 00:27:54 +0000

Revision: 4875
          http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=4875
Author:   chicares
Date:     2010-05-01 00:27:54 +0000 (Sat, 01 May 2010)
Log Message:
-----------
Remove gratuitous dissimilarities

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

Modified: lmi/trunk/ChangeLog
===================================================================
--- lmi/trunk/ChangeLog 2010-04-30 17:09:24 UTC (rev 4874)
+++ lmi/trunk/ChangeLog 2010-05-01 00:27:54 UTC (rev 4875)
@@ -25159,3 +25159,33 @@
   } // Unnamed namespace.
 which differs in that "Unnamed" is not the unnamed namespace's name.
 
+20100430T0121Z <address@hidden> [738]
+
+  ihs_dbvalue.cpp
+  ihs_dbvalue.hpp
+Simplify.
+
+20100430T1429Z <address@hidden> [738]
+
+  ihs_dbdict.cpp
+  ihs_dbvalue.cpp
+  ihs_dbvalue.hpp
+  workhorse.make
+Permit annotations in '.database' files.
+
+20100430T1709Z <address@hidden> [737]
+
+  ihs_basicval.cpp
+  ihs_dbdict.cpp
+  ihs_dbvalue.cpp
+  ihs_dbvalue.hpp
+Simplify.
+
+20100501T0027Z <address@hidden> [737]
+
+  dbvalue.cpp
+  dbvalue.hpp
+  ihs_dbvalue.cpp
+  ihs_dbvalue.hpp
+Remove gratuitous dissimilarities.
+

Modified: lmi/trunk/dbvalue.cpp
===================================================================
--- lmi/trunk/dbvalue.cpp       2010-04-30 17:09:24 UTC (rev 4874)
+++ lmi/trunk/dbvalue.cpp       2010-05-01 00:27:54 UTC (rev 4875)
@@ -1,4 +1,4 @@
-// Product database entity type.
+// Product-database entity.
 //
 // Copyright (C) 1998, 2001, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 
Gregory W. Chicares.
 //
@@ -56,13 +56,15 @@
 
 //============================================================================
 TDBValue::TDBValue
-    (int     inputkey
-    ,int     inputndims
-    ,int*    inputdims
-    ,double* inputdata
+    (int                inputkey
+    ,int                inputndims
+    ,int const*         inputdims
+    ,double const*      inputdata
+    ,std::string const& gloss
     )
-    :key   (inputkey)
-    ,ndims (inputndims)
+    :key    (inputkey)
+    ,ndims  (inputndims)
+    ,gloss_ (gloss)
 {
     dims = new int[ndims];
     deprecated::dupmem(dims, inputdims, ndims);
@@ -111,7 +113,7 @@
 }
 
 //============================================================================
-int TDBValue::getndata()
+int TDBValue::getndata() const
 {
     if(0 == ndims)
         {
@@ -133,7 +135,7 @@
 }
 
 //============================================================================
-double* TDBValue::operator[](int const* idx) const
+double const* TDBValue::operator[](int const* idx) const
 {
     int z = 0;
     for(int j = 0; j < ndims - 1; j++)

Modified: lmi/trunk/dbvalue.hpp
===================================================================
--- lmi/trunk/dbvalue.hpp       2010-04-30 17:09:24 UTC (rev 4874)
+++ lmi/trunk/dbvalue.hpp       2010-05-01 00:27:54 UTC (rev 4875)
@@ -1,4 +1,4 @@
-// Product database entity type.
+// Product-database entity.
 //
 // Copyright (C) 1998, 2001, 2005, 2006, 2007, 2008, 2009, 2010 Gregory W. 
Chicares.
 //
@@ -28,43 +28,60 @@
 
 #include "dbindex.hpp"
 #include "obstruct_slicing.hpp"
+#include "so_attributes.hpp"
 
+#include <string>
 #include <vector>
 
-// Value of an entry in the database dictionary.
+/// Product-database entity.
+///
+/// Each entity varies across zero or more of the following axes:
+///   - gender
+///   - underwriting class
+///   - smoker
+///   - issue age
+///   - underwriting basis
+///   - state
+///   - duration [i.e., number of years since issue]
+/// in that order.
+///
+/// The last index is duration; i.e., duration varies most rapidly of
+/// all axes. In a typical query, all other axes are single-valued,
+/// but all durations are wanted; this axis ordering puts consecutive
+/// durational values in contiguous storage for efficient retrieval.
 
-class TDBValue
+class LMI_SO TDBValue
     :virtual private obstruct_slicing<TDBValue>
 {
   public:
     TDBValue();
     TDBValue
-        (int     key
-        ,int     ndims
-        ,int*    dims
-        ,double* data
+        (int                key
+        ,int                ndims
+        ,int const*         dims
+        ,double const*      data
+        ,std::string const& gloss = std::string()
         );
     TDBValue(TDBValue const&);
     TDBValue& operator=(TDBValue const&);
     ~TDBValue();
 
-    double* operator[](int const* idx) const;
+    double const* operator[](int const* idx) const;
     int GetKey()    const {return key;}
     int GetNDims()  const {return ndims;}
     int GetLength() const {return dims[TDBIndex::MaxIndex];}
 
   private:
-    int     getndata();
+    int  getndata()      const;
 
     int     key;        // Database dictionary key
     int     ndims;      // Number of dimensions
     int*    dims;       // Dimensions
     int     ndata;      // Number of data
     double* data;       // Data
+    std::string         gloss_;
 };
 
-#endif // dbvalue_hpp
-
 /*
 Database items should be allowed to vary across numerous axes, such as
     gender
@@ -114,3 +131,5 @@
 SOA program for reasons of space.
 */
 
+#endif // dbvalue_hpp
+

Modified: lmi/trunk/ihs_dbvalue.cpp
===================================================================
--- lmi/trunk/ihs_dbvalue.cpp   2010-04-30 17:09:24 UTC (rev 4874)
+++ lmi/trunk/ihs_dbvalue.cpp   2010-05-01 00:27:54 UTC (rev 4875)
@@ -1,4 +1,4 @@
-// Database entity type.
+// Product-database entity.
 //
 // Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 
2008, 2009, 2010 Gregory W. Chicares.
 //

Modified: lmi/trunk/ihs_dbvalue.hpp
===================================================================
--- lmi/trunk/ihs_dbvalue.hpp   2010-04-30 17:09:24 UTC (rev 4874)
+++ lmi/trunk/ihs_dbvalue.hpp   2010-05-01 00:27:54 UTC (rev 4875)
@@ -1,4 +1,4 @@
-// Database entities.
+// Product-database entity.
 //
 // Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 
2008, 2009, 2010 Gregory W. Chicares.
 //
@@ -41,7 +41,22 @@
 
 namespace xml_serialize {template<typename T> struct xml_io;}
 
-/// Value of an entry in the database dictionary.
+/// Product-database entity.
+///
+/// Each entity varies across zero or more of the following axes:
+///   - gender
+///   - underwriting class
+///   - smoker
+///   - issue age
+///   - underwriting basis
+///   - state
+///   - duration [i.e., number of years since issue]
+/// in that order.
+///
+/// The last index is duration; i.e., duration varies most rapidly of
+/// all axes. In a typical query, all other axes are single-valued,
+/// but all durations are wanted; this axis ordering puts consecutive
+/// durational values in contiguous storage for efficient retrieval.
 
 class LMI_SO TDBValue
     :virtual private obstruct_slicing<TDBValue>
@@ -103,28 +118,14 @@
     static bool VariesByState(TDBValue const&);
 
   private:
-    int  getndata()                           const;
-    void ParanoidCheck()                      const;
-    bool AreAllAxesOK()                       const;
+    int  getndata()      const;
+    void ParanoidCheck() const;
+    bool AreAllAxesOK()  const;
 
     void read (xml::element const&);
     void write(xml::element&) const;
 
-    int  key;        // Database dictionary key
-
-    // Each database item has a number of axes.
-    // Every item has
-    //   gender
-    //   underwriting class
-    //   smoker
-    //   issue age
-    //   underwriting basis
-    //   state
-    // in that order as its first six axes.
-    // Any item can have any number of additional custom axes after those six.
-    // All items have duration as their last axis. Duration comes last
-    // so that a pointer calculated from all preceding axes points to
-    // consecutive durational elements in contiguous storage.
+    int                 key;
     std::vector<int>    axis_lengths;
     std::vector<double> data_values;
     std::string         gloss_;





reply via email to

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