• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

nasa / cml / 29777181804

20 Jul 2026 08:41PM UTC coverage: 85.517% (+0.2%) from 85.284%
29777181804

Pull #51

github

web-flow
Merge 9177babb3 into 783b48963
Pull Request #51: Fix all compiler warnings and treat them as errors

7833 of 8923 branches covered (87.78%)

Branch coverage included in aggregate %.

310 of 539 new or added lines in 196 files covered. (57.51%)

6 existing lines in 6 files now uncovered.

17930 of 21203 relevant lines covered (84.56%)

110707.49 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/models/utilities/table_interp_cpp/include/table_lookup__transpose_data.hh
1
/*******************************TRICK HEADER******************************
2
PURPOSE: (
3
     Provides a table-lookup-set when the data is presented in a
4
     transpose  presentation.  The format assumed for data presentation
5
     by the table-interpolation model is variable-by-variable:
6
         {var1(x_1), var1(x_2), var1(x_3), ...,
7
          var2(x_1), var2(x_2), var2(x_3), ...,
8
          var3(x_1), var3(x_2), var3(x_3), ...}
9
     This format easily supports multi-variable interpolation.
10
     However, in the case of only one independent variable, the data may
11
     often be presented line-by-line based on the value of the independent
12
     variable:
13
       {{var1(x_1), var2(x_1), var3(x_1), ...}
14
        {var1(x_2), var2(x_2), var3(x_2), ...}
15
        {var1(x_3), var2(x_3), var3(x_3), ...}}
16

17
     This class supports data presented in the latter format.  The data
18
     may be subdivided into as many tables as necessary or desired.)
19

20
LIBRARY DEPENDENCY:
21
   ((../src/table_lookup__transpose_data.cc))
22

23
PROGRAMMERS:
24
  (((Gary Turner) (OSR) (Nov 2017) (Antares) (initial)))
25
**********************************************************************/
26
#ifndef CML_TABLE_LOOKUP__TRANSPOSE_DATA_HH
27
#define CML_TABLE_LOOKUP__TRANSPOSE_DATA_HH
28

29
#include <vector>
30
#include <list>
31

32
#include "generic_multi_input_table.hh"
33
#include "table_lookup_set.hh"
34
#include "abstract_table_lookup.hh"
35
#include "table_type_defs.hh"
36

37
#include "cml/models/utilities/cml_message/include/cml_message.hh"
38

39
/*****************************************************************************
40
TableLookupTransposeDataSet_TableConfig
41
Purpose:( Provides configuration information for an instance of a table that
42
          will hold a subset of the data from the incoming data file.)
43
Assumptions: ((Data for this table is contiguous within each line of the
44
               specified data.)
45
             ((Data for this table is found at the same indices on every
46
               line of the specified data.)
47
             )
48
*****************************************************************************/
49
class TableLookupTransposeDataSet_TableConfig
50
{
51
 friend class TableLookupTransposeDataSet;
52
 public:
53
  typedef std::list<DoubleVec>   DoubleVecList;
54

55
  std::string name; /* (--) Name of this table-configuration.*/
56
  bool block_independent_addition; /* (--)
57
    When used to configure the specific data-set, the corresponding Table
58
    (table_ptr) will by default be added to the table-manager
59
    (TableLookupTransposeDataSet). This flag blocks this addition.
60
    This is used when the configured table is only to be used indirectly.
61
    Default: false. */
62
  size_t index_low; /* (--)
63
    First index in the data file containing contiguous data for this table.
64
    If the data is not contiguous, specify indices as a vector. */
65
  size_t index_high; /* (--)
66
    Last index in the data file containing contiguous data for this table.
67
    If the data is not contiguous, specify indices as a vector. */
68
  std::vector<size_t> indices; /* (--)
69
     Set of indices in the data file containing data for this table.
70
     Used when data is not contiguous and cannot be specified by a range
71
     [index_low,index_high].
72
     If this vector is empty, model will use index_low, index_high.
73
     If this vector is non-empty, model will ignore index_low, index_high. */
74

75
  GenericMultiInputTable * table_ptr; /* (--) pointer to this model's
76
                            data-table.  May be left NULL, in which case a
77
                            table will be created on-the-fly. */
78
  DoublePtrVec  dependent_variables; /* (--) STL-vector containing pointers
79
                            to the dependent variables; these variables will
80
                            be populated by the table found at table_ptr.  Used
81
                            only if the table is being constructed on-the-fly.*/
82
  AbstractTableLookup::TableType table_type;/* (--) Type of table to be created if
83
                            creating a table on-the-fly. Otherwise, this is
84
                            unused.  Default: Generic.*/
85
  TableIndependentVariable::LookupMethod lookup_method; /* (--) Type of lookup
86
                            method to be used by the associated independent
87
                            variable.*/
88
 private:
89
  DoubleVec  data_scratch;  /* (--) STL-vector containing the data for
90
                            the variables represented by this table.  This is a
91
                            temporary storage location, available for
92
                            constructing the data vector from the
93
                            transpose data before being sent to table_ptr for
94
                            permanent storage.*/
95
  size_t num_variables;  /* (count) number of variables in the associated table.*/
96
  size_t total_num_lines;/* (count) number of lines of data coming in. Set by call
97
                          from
98
                          TableLookupTransposeDataSet::process_transpose_data()*/
99

100
 public:
101
  TableLookupTransposeDataSet_TableConfig();
NEW
102
  virtual ~TableLookupTransposeDataSet_TableConfig() = default;
×
103

104
 private: // called from TableLookupTransposeDataSet
105
  void initialize(size_t num_lines);
106
  void check_indices();
107
  void parse_line( size_t line_num,
108
                   const DoubleVec & data_line);
109
  void populate_table();
110

111
  // Using default copy-constructor
112
};
113

114

115
/*****************************************************************************
116
TableLookupTransposeDataSet
117
Purpose:(A TableLookup that populates and holds a set of data populated by
118
         data presented in a transposed format.)
119
*****************************************************************************/
120
class TableLookupTransposeDataSet : public TableLookupSet
121
{
122
 public:
123
  typedef std::list<DoubleVec>   DoubleVecList;
124

125
  std::vector<TableLookupTransposeDataSet_TableConfig> table_config; /* (--)
126
              A set of table-configurations; these are used to extract the data
127
              from the consolidated data set for loading onto each instance of
128
              GenericMultiInputTable used by this manager.*/
129
  const double * independent_var; /* (--)
130
              A pointer to the variable used as the independent-variable.
131
              Used only if the TableIndependentVariable is being created
132
              on-the-fly.*/
133
  TableIndependentVariable::Continuity indep_continuity; /* (--)
134
              Indicates how the edges of the independent data are to be treated.
135
              Used only if the TableIndependentVariable is being created
136
              on-the-fly.*/
137

138
  bool populate_independent_from_file; /* (--)
139
              Flag indicating that the data for the independent variable is
140
              also found in the data file.*/
141
  size_t indep_index; /* (--)
142
              The index of the data for the independent variable.
143
              Used only if populate_independent_from_file is true */
144
 private:
145
  size_t min_length;     /* (count) number of variables on the shortest line in
146
                          the data set.*/
147
  size_t min_length_line;/* (count) line number of the shortest line.*/
148
  bool data_processed; /* (--) flag indicating that the process_data method
149
                               has executed and the tables been populated.*/
150

151
 public:
152
  TableLookupTransposeDataSet();
NEW
153
  ~TableLookupTransposeDataSet() override = default;
×
154

155
  bool process_data( const std::string & filename,
156
                     size_t terminate_on_line = 100000);
157
  bool process_data( const DoubleVecList & data_file);
158
  bool convert_txt_to_list_vec( const std::string & filename,
159
                                DoubleVecList & data_list,
160
                                size_t terminate_on_line = 100000);
161
  TableLookupTransposeDataSet_TableConfig * get_config( const char * name);
162
  TableLookupTransposeDataSet_TableConfig * get_config( const std::string & name);
163
  void add_config( TableLookupTransposeDataSet_TableConfig & new_config)
164
    {  table_config.push_back(new_config);}
165
  bool remove_config( TableLookupTransposeDataSet_TableConfig & config);
166
 private:
167
  void check_independent();
168
  // Disable the copy/assignment operators
169
  TableLookupTransposeDataSet ( const TableLookupTransposeDataSet&);
170
  TableLookupTransposeDataSet& operator = ( const TableLookupTransposeDataSet&);
171
};
172
#endif
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc