15 #ifndef polybori_ring_CVariableNames_h_
16 #define polybori_ring_CVariableNames_h_
64 void reset(idx_type idx = 0);
71 return m_data[idx].c_str();
75 void set(idx_type idx,
const varname_type& varname) {
77 size_type nlen = m_data.size();
80 m_data.resize((size_type)idx + 1);
81 reset((idx_type)nlen);
84 m_data[idx] = varname;
88 static const_reference
undefName() {
return "UNDEF"; }
99 for (; idx < nlen; ++idx){
100 std::ostringstream sstrg;
101 sstrg <<
"x(" << idx <<
')';
102 m_data[idx] = sstrg.str();
CVariableNames(const self &rhs)
Copy Constructor.
Definition: CVariableNames.h:61
#define END_NAMESPACE_PBORI
Finish project's namespace.
Definition: pbori_defs.h:77
vartext_type const_reference
Define type for outputing variable names.
Definition: CVariableNames.h:52
#define BEGIN_NAMESPACE_PBORI
Start project's namespace.
Definition: pbori_defs.h:74
CTypes::idx_type idx_type
Definition: CVariableNames.h:36
const_reference operator[](idx_type idx) const
Get name of variable with index idx.
Definition: CVariableNames.h:67
static const_reference undefName()
Definition: CVariableNames.h:88
CTypes::size_type size_type
Definition: CVariableNames.h:35
Definition: CVariableNames.h:30
std::vector< varname_type > storage_type
Define type for storing names of variables.
Definition: CVariableNames.h:46
int idx_type
Type for indices.
Definition: pbori_defs.h:228
void set(idx_type idx, const varname_type &varname)
Get writable reference to name of variable with index idx.
Definition: CVariableNames.h:75
const char * vartext_type
Type for setting/getting names of variables.
Definition: pbori_defs.h:249
polybori::CTypes::idx_type idx_type
Definition: groebner_defs.h:44
std::size_t size_type
Type for lengths, dimensions, etc.
Definition: pbori_defs.h:219
std::string varname_type
Define type for storing names of variables.
Definition: CVariableNames.h:43
CVariableNames(size_type nvars)
Constructor.
Definition: CVariableNames.h:58
#define PBORI_UNLIKELY(expression)
Definition: pbori_defs.h:59
storage_type::reference reference
Define type for write accessing elements.
Definition: CVariableNames.h:49
CTypes::vartext_type vartext_type
Define type for setting/getting names of variables.
Definition: CVariableNames.h:40