[6f43ab] | 1 | /*
|
---|
| 2 | * Formula.cpp
|
---|
| 3 | *
|
---|
| 4 | * Created on: Jul 21, 2010
|
---|
| 5 | * Author: crueger
|
---|
| 6 | */
|
---|
| 7 |
|
---|
| 8 | #include "Formula.hpp"
|
---|
| 9 |
|
---|
| 10 | #include <sstream>
|
---|
| 11 |
|
---|
| 12 | #include "World.hpp"
|
---|
| 13 | #include "periodentafel.hpp"
|
---|
| 14 | #include "element.hpp"
|
---|
| 15 | #include "Helpers/Assert.hpp"
|
---|
[ee86a0] | 16 | #include "Helpers/Range.hpp"
|
---|
[6f43ab] | 17 |
|
---|
| 18 | using namespace std;
|
---|
| 19 |
|
---|
| 20 | Formula::Formula() :
|
---|
| 21 | numElements(0)
|
---|
| 22 | {}
|
---|
| 23 |
|
---|
| 24 | Formula::Formula(const Formula &src) :
|
---|
| 25 | elementCounts(src.elementCounts),
|
---|
| 26 | numElements(src.numElements)
|
---|
| 27 | {}
|
---|
| 28 |
|
---|
[d03bb1] | 29 | Formula::Formula(const string &formula) :
|
---|
| 30 | numElements(0)
|
---|
| 31 | {
|
---|
| 32 | fromString(formula);
|
---|
| 33 | }
|
---|
| 34 |
|
---|
[6f43ab] | 35 | Formula::~Formula()
|
---|
| 36 | {}
|
---|
| 37 |
|
---|
| 38 | Formula &Formula::operator=(const Formula &rhs){
|
---|
| 39 | // No self-assignment check needed
|
---|
| 40 | elementCounts=rhs.elementCounts;
|
---|
| 41 | numElements=rhs.numElements;
|
---|
| 42 | return *this;
|
---|
| 43 | }
|
---|
| 44 |
|
---|
| 45 | std::string Formula::toString() const{
|
---|
| 46 | stringstream sstr;
|
---|
[add42a] | 47 | for(const_iterator iter=end();iter!=begin();){
|
---|
| 48 | --iter;
|
---|
[a6d6a9] | 49 | sstr << (*iter).first->symbol;
|
---|
| 50 | if((*iter).second>1)
|
---|
| 51 | sstr << (*iter).second;
|
---|
[6f43ab] | 52 | }
|
---|
| 53 | return sstr.str();
|
---|
| 54 | }
|
---|
| 55 |
|
---|
[d03bb1] | 56 | void Formula::fromString(const std::string &formula) throw(ParseError){
|
---|
[4d1d43] | 57 | // make this transactional, in case an error is thrown
|
---|
| 58 | Formula res;
|
---|
| 59 | string::const_iterator begin = formula.begin();
|
---|
| 60 | string::const_iterator end = formula.end();
|
---|
| 61 | res.parseFromString(begin,end,static_cast<char>(0));
|
---|
| 62 | (*this)=res;
|
---|
| 63 | }
|
---|
| 64 |
|
---|
| 65 | int Formula::parseMaybeNumber(string::const_iterator &it,string::const_iterator &end) throw(ParseError){
|
---|
| 66 | static const range<char> Numbers = makeRange('0',static_cast<char>('9'+1));
|
---|
| 67 | int count = 0;
|
---|
| 68 | while(it!=end && Numbers.isInRange(*it))
|
---|
| 69 | count = (count*10) + ((*it++)-Numbers.first);
|
---|
| 70 | // one is implicit
|
---|
| 71 | count = (count!=0)?count:1;
|
---|
| 72 | return count;
|
---|
| 73 | }
|
---|
| 74 |
|
---|
| 75 | void Formula::parseFromString(string::const_iterator &it,string::const_iterator &end,char delimiter) throw(ParseError){
|
---|
[d03bb1] | 76 | // some constants needed for parsing... Assumes ASCII, change if other encodings are used
|
---|
[ee86a0] | 77 | static const range<char> CapitalLetters = makeRange('A',static_cast<char>('Z'+1));
|
---|
| 78 | static const range<char> SmallLetters = makeRange('a',static_cast<char>('z'+1));
|
---|
[4d1d43] | 79 | map<char,char> delimiters;
|
---|
| 80 | delimiters['('] = ')';
|
---|
| 81 | delimiters['['] = ']';
|
---|
[d03bb1] | 82 | // clean the formula
|
---|
| 83 | clear();
|
---|
[4d1d43] | 84 | for(/*send from above*/;it!=end && *it!=delimiter;/*updated in loop*/){
|
---|
| 85 | // we might have a sub formula
|
---|
| 86 | if(delimiters.count(*it)){
|
---|
| 87 | Formula sub;
|
---|
| 88 | char nextdelim=delimiters[*it];
|
---|
| 89 | sub.parseFromString(++it,end,nextdelim);
|
---|
| 90 | int count = parseMaybeNumber(++it,end);
|
---|
| 91 | addFormula(sub,count);
|
---|
| 92 | continue;
|
---|
| 93 | }
|
---|
[d03bb1] | 94 | string shorthand;
|
---|
| 95 | // Atom names start with a capital letter
|
---|
[ee86a0] | 96 | if(!CapitalLetters.isInRange(*it))
|
---|
[d03bb1] | 97 | throw(ParseError(__FILE__,__LINE__));
|
---|
| 98 | shorthand+=(*it++);
|
---|
| 99 | // the rest of the name follows
|
---|
[ee86a0] | 100 | while(it!=end && SmallLetters.isInRange(*it))
|
---|
[d03bb1] | 101 | shorthand+=(*it++);
|
---|
[4d1d43] | 102 | int count = parseMaybeNumber(it,end);
|
---|
[fefe0d] | 103 | // test if the shorthand exists
|
---|
| 104 | if(!World::getInstance().getPeriode()->FindElement(shorthand))
|
---|
| 105 | throw(ParseError(__FILE__,__LINE__));
|
---|
[d03bb1] | 106 | // done, we can get the next one
|
---|
| 107 | addElements(shorthand,count);
|
---|
| 108 | }
|
---|
[4d1d43] | 109 | if(it==end && delimiter!=0){
|
---|
| 110 | throw(ParseError(__FILE__,__LINE__));
|
---|
| 111 | }
|
---|
[d03bb1] | 112 | }
|
---|
| 113 |
|
---|
[6f43ab] | 114 | bool Formula::checkOut(ostream *output) const{
|
---|
| 115 | bool result = true;
|
---|
| 116 | int No = 1;
|
---|
| 117 |
|
---|
| 118 | if (output != NULL) {
|
---|
| 119 | *output << "# Ion type data (PP = PseudoPotential, Z = atomic number)" << endl;
|
---|
| 120 | *output << "#Ion_TypeNr.\tAmount\tZ\tRGauss\tL_Max(PP)L_Loc(PP)IonMass\t# chemical name, symbol" << endl;
|
---|
| 121 | for(const_iterator iter=begin(); iter!=end();++iter){
|
---|
| 122 | (*iter).first->No = No;
|
---|
| 123 | result = result && (*iter).first->Checkout(output, No++, (*iter).second);
|
---|
| 124 | }
|
---|
| 125 | return result;
|
---|
| 126 | } else
|
---|
| 127 | return false;
|
---|
| 128 | }
|
---|
| 129 |
|
---|
[a6d6a9] | 130 | unsigned int Formula::getElementCount() const{
|
---|
[6f43ab] | 131 | return numElements;
|
---|
| 132 | }
|
---|
| 133 |
|
---|
| 134 | bool Formula::hasElement(const element *element) const{
|
---|
| 135 | ASSERT(element,"Invalid pointer in Formula::hasElement(element*)");
|
---|
| 136 | return hasElement(element->getNumber());
|
---|
| 137 | }
|
---|
| 138 |
|
---|
| 139 | bool Formula::hasElement(atomicNumber_t Z) const{
|
---|
| 140 | ASSERT(Z>0,"Invalid atomic Number");
|
---|
| 141 | ASSERT(World::getInstance().getPeriode()->FindElement(Z),"No Element with this number in Periodentafel");
|
---|
| 142 | return elementCounts.size()>=Z && elementCounts[Z-1];
|
---|
| 143 | }
|
---|
| 144 |
|
---|
| 145 | bool Formula::hasElement(const string &shorthand) const{
|
---|
| 146 | element * element = World::getInstance().getPeriode()->FindElement(shorthand);
|
---|
| 147 | return hasElement(element);
|
---|
| 148 | }
|
---|
| 149 |
|
---|
| 150 | void Formula::operator+=(const element *element){
|
---|
| 151 | ASSERT(element,"Invalid pointer in increment of Formula");
|
---|
| 152 | operator+=(element->getNumber());
|
---|
| 153 | }
|
---|
| 154 |
|
---|
| 155 | void Formula::operator+=(atomicNumber_t Z){
|
---|
| 156 | ASSERT(Z>0,"Invalid atomic Number");
|
---|
| 157 | ASSERT(World::getInstance().getPeriode()->FindElement(Z),"No Element with this number in Periodentafel");
|
---|
[fefe0d] | 158 | elementCounts.resize(max<atomicNumber_t>(Z,elementCounts.size()),0); // No-op when we already have the right size
|
---|
[6f43ab] | 159 | // might need to update number of elements
|
---|
| 160 | if(!elementCounts[Z-1]){
|
---|
| 161 | numElements++;
|
---|
| 162 | }
|
---|
| 163 | elementCounts[Z-1]++; // atomic numbers start at 1
|
---|
| 164 | }
|
---|
| 165 |
|
---|
| 166 | void Formula::operator+=(const string &shorthand){
|
---|
| 167 | element * element = World::getInstance().getPeriode()->FindElement(shorthand);
|
---|
| 168 | operator+=(element);
|
---|
| 169 | }
|
---|
| 170 |
|
---|
| 171 | void Formula::operator-=(const element *element){
|
---|
| 172 | ASSERT(element,"Invalid pointer in decrement of Formula");
|
---|
| 173 | operator-=(element->getNumber());
|
---|
| 174 | }
|
---|
| 175 |
|
---|
| 176 | void Formula::operator-=(atomicNumber_t Z){
|
---|
| 177 | ASSERT(Z>0,"Invalid atomic Number");
|
---|
| 178 | ASSERT(World::getInstance().getPeriode()->FindElement(Z),"No Element with this number in Periodentafel");
|
---|
| 179 | ASSERT(elementCounts.size()>=Z && elementCounts[Z-1], "Element not in Formula upon decrement");
|
---|
| 180 | elementCounts[Z-1]--; // atomic numbers start at 1
|
---|
| 181 | // might need to update number of elements
|
---|
| 182 | if(!elementCounts[Z-1]){
|
---|
| 183 | numElements--;
|
---|
[d8a0ec] | 184 | // resize the Array if this was at the last position
|
---|
| 185 | if(Z==elementCounts.size()){
|
---|
| 186 | // find the first element from the back that is not equal to zero
|
---|
| 187 | set_t::reverse_iterator riter = find_if(elementCounts.rbegin(),
|
---|
| 188 | elementCounts.rend(),
|
---|
| 189 | bind1st(not_equal_to<mapped_type>(),0));
|
---|
| 190 | // see how many elements are in this range
|
---|
| 191 | set_t::reverse_iterator::difference_type diff = riter - elementCounts.rbegin();
|
---|
| 192 | elementCounts.resize(elementCounts.size()-diff);
|
---|
| 193 | }
|
---|
[6f43ab] | 194 | }
|
---|
| 195 | }
|
---|
| 196 |
|
---|
| 197 | void Formula::operator-=(const string &shorthand){
|
---|
| 198 | element * element = World::getInstance().getPeriode()->FindElement(shorthand);
|
---|
| 199 | operator-=(element);
|
---|
| 200 | }
|
---|
| 201 |
|
---|
[d03bb1] | 202 | void Formula::addElements(const element *element,unsigned int count){
|
---|
| 203 | ASSERT(element,"Invalid pointer in Formula::addElements(element*)");
|
---|
| 204 | addElements(element->getNumber(),count);
|
---|
| 205 | }
|
---|
| 206 |
|
---|
| 207 | void Formula::addElements(atomicNumber_t Z,unsigned int count){
|
---|
| 208 | if(count==0) return;
|
---|
| 209 | ASSERT(Z>0,"Invalid atomic Number");
|
---|
| 210 | ASSERT(World::getInstance().getPeriode()->FindElement(Z),"No Element with this number in Periodentafel");
|
---|
[fefe0d] | 211 | elementCounts.resize(max<atomicNumber_t>(Z,elementCounts.size()),0); // No-op when we already have the right size
|
---|
[d03bb1] | 212 | // might need to update number of elements
|
---|
| 213 | if(!elementCounts[Z-1]){
|
---|
| 214 | numElements++;
|
---|
| 215 | }
|
---|
| 216 | elementCounts[Z-1]+=count;
|
---|
| 217 | }
|
---|
| 218 |
|
---|
| 219 | void Formula::addElements(const string &shorthand,unsigned int count){
|
---|
| 220 | element * element = World::getInstance().getPeriode()->FindElement(shorthand);
|
---|
| 221 | addElements(element,count);
|
---|
| 222 | }
|
---|
| 223 |
|
---|
[9d5803] | 224 | void Formula::addFormula(const Formula &formula,unsigned int n){
|
---|
| 225 | for(Formula::const_iterator iter=formula.begin();iter!=formula.end();++iter){
|
---|
| 226 | this->addElements(iter->first,iter->second*n);
|
---|
| 227 | }
|
---|
| 228 | }
|
---|
| 229 |
|
---|
[a6d6a9] | 230 | const unsigned int Formula::operator[](const element *element) const{
|
---|
[6f43ab] | 231 | ASSERT(element,"Invalid pointer in access of Formula");
|
---|
| 232 | return operator[](element->getNumber());
|
---|
| 233 | }
|
---|
| 234 |
|
---|
[a6d6a9] | 235 | const unsigned int Formula::operator[](atomicNumber_t Z) const{
|
---|
[6f43ab] | 236 | ASSERT(Z>0,"Invalid atomic Number");
|
---|
| 237 | ASSERT(World::getInstance().getPeriode()->FindElement(Z),"No Element with this number in Periodentafel");
|
---|
[a6d6a9] | 238 | if(elementCounts.size()<Z)
|
---|
| 239 | return 0;
|
---|
[6f43ab] | 240 | return elementCounts[Z-1]; // atomic numbers start at 1
|
---|
| 241 | }
|
---|
| 242 |
|
---|
[a6d6a9] | 243 | const unsigned int Formula::operator[](string shorthand) const{
|
---|
[6f43ab] | 244 | element * element = World::getInstance().getPeriode()->FindElement(shorthand);
|
---|
| 245 | return operator[](element);
|
---|
| 246 | }
|
---|
| 247 |
|
---|
| 248 | bool Formula::operator==(const Formula &rhs) const{
|
---|
| 249 | // quick check... number of elements used
|
---|
| 250 | if(numElements != rhs.numElements){
|
---|
| 251 | return false;
|
---|
| 252 | }
|
---|
[d8a0ec] | 253 | // second quick check, size of vectors (== last element in formula)
|
---|
| 254 | if(elementCounts.size()!=rhs.elementCounts.size()){
|
---|
| 255 | return false;
|
---|
| 256 | }
|
---|
[6f43ab] | 257 | // slow check: all elements
|
---|
| 258 | // direct access to internal structure means all element-counts have to be compared
|
---|
| 259 | // this avoids access to periodentafel to find elements though and is probably faster
|
---|
| 260 | // in total
|
---|
| 261 | return equal(elementCounts.begin(),
|
---|
| 262 | elementCounts.end(),
|
---|
| 263 | rhs.elementCounts.begin());
|
---|
| 264 | }
|
---|
| 265 |
|
---|
| 266 | bool Formula::operator!=(const Formula &rhs) const{
|
---|
| 267 | return !operator==(rhs);
|
---|
| 268 | }
|
---|
| 269 |
|
---|
| 270 | Formula::iterator Formula::begin(){
|
---|
| 271 | return iterator(elementCounts,0);
|
---|
| 272 | }
|
---|
| 273 | Formula::const_iterator Formula::begin() const{
|
---|
[d8a0ec] | 274 | // this is the only place where this is needed, so this is better than making it mutable
|
---|
| 275 | return const_iterator(const_cast<set_t&>(elementCounts),0);
|
---|
[6f43ab] | 276 | }
|
---|
| 277 | Formula::iterator Formula::end(){
|
---|
| 278 | return iterator(elementCounts);
|
---|
| 279 | }
|
---|
| 280 | Formula::const_iterator Formula::end() const{
|
---|
[d8a0ec] | 281 | // this is the only place where this is needed, so this is better than making it mutable
|
---|
| 282 | return const_iterator(const_cast<set_t&>(elementCounts));
|
---|
[6f43ab] | 283 | }
|
---|
| 284 |
|
---|
[d03bb1] | 285 | void Formula::clear(){
|
---|
| 286 | elementCounts.clear();
|
---|
| 287 | numElements = 0;
|
---|
| 288 | }
|
---|
| 289 |
|
---|
[6f43ab] | 290 | /**************** Iterator structure ********************/
|
---|
| 291 |
|
---|
| 292 | template <class result_type>
|
---|
| 293 | Formula::_iterator<result_type>::_iterator(set_t &_set) :
|
---|
| 294 | set(&_set)
|
---|
| 295 | {
|
---|
| 296 | pos=set->size();
|
---|
| 297 | }
|
---|
| 298 |
|
---|
| 299 | template <class result_type>
|
---|
| 300 | Formula::_iterator<result_type>::_iterator(set_t &_set,size_t _pos) :
|
---|
| 301 | set(&_set),pos(_pos)
|
---|
| 302 | {
|
---|
| 303 | ASSERT(pos<=set->size(),"invalid position in iterator construction");
|
---|
[a6d6a9] | 304 | while(pos<set->size() && (*set)[pos]==0) ++pos;
|
---|
[6f43ab] | 305 | }
|
---|
| 306 |
|
---|
[a6d6a9] | 307 | template <class result_type>
|
---|
| 308 | Formula::_iterator<result_type>::_iterator(const _iterator &rhs) :
|
---|
| 309 | set(rhs.set),pos(rhs.pos)
|
---|
| 310 | {}
|
---|
| 311 |
|
---|
[6f43ab] | 312 | template <class result_type>
|
---|
| 313 | Formula::_iterator<result_type>::~_iterator(){}
|
---|
| 314 |
|
---|
| 315 | template <class result_type>
|
---|
| 316 | Formula::_iterator<result_type>&
|
---|
| 317 | Formula::_iterator<result_type>::operator=(const _iterator<result_type> &rhs){
|
---|
| 318 | set=rhs.set;
|
---|
| 319 | pos=rhs.pos;
|
---|
| 320 | return *this;
|
---|
| 321 | }
|
---|
| 322 |
|
---|
| 323 | template <class result_type>
|
---|
| 324 | bool
|
---|
| 325 | Formula::_iterator<result_type>::operator==(const _iterator<result_type> &rhs){
|
---|
| 326 | return set==rhs.set && pos==rhs.pos;
|
---|
| 327 | }
|
---|
| 328 |
|
---|
| 329 | template <class result_type>
|
---|
| 330 | bool
|
---|
| 331 | Formula::_iterator<result_type>::operator!=(const _iterator<result_type> &rhs){
|
---|
| 332 | return !operator==(rhs);
|
---|
| 333 | }
|
---|
| 334 |
|
---|
| 335 | template <class result_type>
|
---|
| 336 | Formula::_iterator<result_type>
|
---|
| 337 | Formula::_iterator<result_type>::operator++(){
|
---|
| 338 | ASSERT(pos!=set->size(),"Incrementing Formula::iterator beyond end");
|
---|
[a6d6a9] | 339 | pos++;
|
---|
| 340 | while(pos<set->size() && (*set)[pos]==0) ++pos;
|
---|
[6f43ab] | 341 | return *this;
|
---|
| 342 | }
|
---|
| 343 |
|
---|
[a6d6a9] | 344 | template <class result_type>
|
---|
| 345 | Formula::_iterator<result_type>
|
---|
| 346 | Formula::_iterator<result_type>::operator++(int){
|
---|
| 347 | Formula::_iterator<result_type> retval = *this;
|
---|
| 348 | ++(*this);
|
---|
| 349 | return retval;
|
---|
| 350 | }
|
---|
| 351 |
|
---|
[6f43ab] | 352 | template <class result_type>
|
---|
| 353 | Formula::_iterator<result_type>
|
---|
| 354 | Formula::_iterator<result_type>::operator--(){
|
---|
[a6d6a9] | 355 | ASSERT(pos!=0,"Decrementing Formula::iterator beyond begin");
|
---|
| 356 | pos--;
|
---|
| 357 | while(pos>0 && (*set)[pos]==0) --pos;
|
---|
[6f43ab] | 358 | return *this;
|
---|
| 359 | }
|
---|
| 360 |
|
---|
[a6d6a9] | 361 | template <class result_type>
|
---|
| 362 | Formula::_iterator<result_type>
|
---|
| 363 | Formula::_iterator<result_type>::operator--(int){
|
---|
| 364 | Formula::_iterator<result_type> retval = *this;
|
---|
| 365 | --(*this);
|
---|
| 366 | return retval;
|
---|
| 367 | }
|
---|
| 368 |
|
---|
[6f43ab] | 369 | template <class result_type>
|
---|
| 370 | result_type
|
---|
| 371 | Formula::_iterator<result_type>::operator*(){
|
---|
| 372 | element *element = World::getInstance().getPeriode()->FindElement(pos+1);
|
---|
| 373 | ASSERT(element,"Element with position of iterator not found");
|
---|
| 374 | return make_pair(element,(*set)[pos]);
|
---|
| 375 | }
|
---|
| 376 |
|
---|
| 377 | template <class result_type>
|
---|
| 378 | result_type*
|
---|
| 379 | Formula::_iterator<result_type>::operator->(){
|
---|
| 380 | // no one can keep this value around, so a static is ok to avoid temporaries
|
---|
| 381 | static value_type value=make_pair(reinterpret_cast<element*>(0),0); // no default constructor for std::pair
|
---|
| 382 | element *element = World::getInstance().getPeriode()->FindElement(pos+1);
|
---|
| 383 | ASSERT(element,"Element with position of iterator not found");
|
---|
| 384 | value = make_pair(element,(*set)[pos]);
|
---|
| 385 | return &value;
|
---|
| 386 | }
|
---|
| 387 |
|
---|
[a6d6a9] | 388 | // explicit instantiation of all iterator template methods
|
---|
| 389 | // this is quite ugly, but there is no better way unless we expose iterator implementation
|
---|
| 390 |
|
---|
| 391 | // instantiate Formula::iterator
|
---|
[c83b98] | 392 | template Formula::iterator::_iterator(set_t&);
|
---|
| 393 | template Formula::iterator::_iterator(set_t&,size_t);
|
---|
| 394 | template Formula::iterator::_iterator(const Formula::iterator&);
|
---|
| 395 | template Formula::iterator::~_iterator();
|
---|
| 396 | template Formula::iterator &Formula::iterator::operator=(const Formula::iterator&);
|
---|
| 397 | template bool Formula::iterator::operator==(const Formula::iterator&);
|
---|
| 398 | template bool Formula::iterator::operator!=(const Formula::iterator&);
|
---|
| 399 | template Formula::iterator Formula::iterator::operator++();
|
---|
| 400 | template Formula::iterator Formula::iterator::operator++(int);
|
---|
| 401 | template Formula::iterator Formula::iterator::operator--();
|
---|
| 402 | template Formula::iterator Formula::iterator::operator--(int);
|
---|
| 403 | template Formula::value_type Formula::iterator::operator*();
|
---|
| 404 | template Formula::value_type *Formula::iterator::operator->();
|
---|
[a6d6a9] | 405 |
|
---|
| 406 | // instantiate Formula::const_iterator
|
---|
[c83b98] | 407 | template Formula::const_iterator::_iterator(set_t&);
|
---|
| 408 | template Formula::const_iterator::_iterator(set_t&,size_t);
|
---|
| 409 | template Formula::const_iterator::_iterator(const Formula::const_iterator&);
|
---|
| 410 | template Formula::const_iterator::~_iterator();
|
---|
| 411 | template Formula::const_iterator &Formula::const_iterator::operator=(const Formula::const_iterator&);
|
---|
| 412 | template bool Formula::const_iterator::operator==(const Formula::const_iterator&);
|
---|
| 413 | template bool Formula::const_iterator::operator!=(const Formula::const_iterator&);
|
---|
| 414 | template Formula::const_iterator Formula::const_iterator::operator++();
|
---|
| 415 | template Formula::Formula::const_iterator Formula::const_iterator::operator++(int);
|
---|
| 416 | template Formula::Formula::const_iterator Formula::const_iterator::operator--();
|
---|
| 417 | template Formula::Formula::const_iterator Formula::const_iterator::operator--(int);
|
---|
| 418 | template const Formula::value_type Formula::const_iterator::operator*();
|
---|
| 419 | template const Formula::value_type *Formula::const_iterator::operator->();
|
---|
[a6d6a9] | 420 |
|
---|
[6f43ab] | 421 | /********************** I/O of Formulas ************************************************/
|
---|
| 422 |
|
---|
| 423 | std::ostream &operator<<(std::ostream &ost,const Formula &formula){
|
---|
| 424 | ost << formula.toString();
|
---|
| 425 | return ost;
|
---|
| 426 | }
|
---|