Changeset 2042 for branches/newmole/source/mole_species.cpp
- Timestamp:
- 05/11/08 12:53:42 (8 months ago)
- Files:
-
- 1 modified
-
branches/newmole/source/mole_species.cpp (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/newmole/source/mole_species.cpp
r2027 r2042 50 50 #include <functional> 51 51 52 class MoleCmp : public binary_function<const struct molecule *,const struct molecule *,bool>52 class MoleCmp : public binary_function<const molecule *,const molecule *,bool> 53 53 { 54 54 public: 55 bool operator()(const struct molecule *mol1, const struct molecule *mol2) const55 bool operator()(const molecule *mol1, const molecule *mol2) const 56 56 { 57 57 for (long nelem=LIMELM-1; nelem >= ipHYDROGEN; nelem--) 58 58 { 59 59 if (mol1->nElem[nelem] > mol2->nElem[nelem]) 60 { 60 61 return false; 62 } 61 63 else if (mol1->nElem[nelem] < mol2->nElem[nelem]) 64 { 62 65 return true; 66 } 63 67 } 64 68 return strcmp(mol1->label,mol2->label) < 0; … … 74 78 long int i, 75 79 nelem; 76 structmolecule *sp;80 molecule *sp; 77 81 static realnum one=1.0; 78 82 static bool lgmole_Init_called=false; … … 411 415 #include <string.h> 412 416 #include <ctype.h> 413 STATIC structmolecule *newspecies(417 STATIC molecule *newspecies( 414 418 const char label[7], 415 419 enum spectype type, … … 421 425 char mylab[7], thisel[3], *s; 422 426 long int i, n, nelem, nel; 423 structmolecule *mol;427 molecule *mol; 424 428 struct chem_element_s *el; 425 429 426 430 DEBUG_ENTRY("newspecies()"); 427 431 428 mol = ( struct molecule *) MALLOC(sizeof(structmolecule));432 mol = (molecule *) MALLOC(sizeof(molecule)); 429 433 430 434 for( nelem=ipHYDROGEN; nelem<LIMELM; ++nelem ) … … 568 572 return mol; 569 573 } 570 STATIC bool isactive( structmolecule *p)574 STATIC bool isactive(molecule *p) 571 575 { 572 576 DEBUG_ENTRY("isactive()"); 573 577 return p->state == MOLE_ACTIVE; 574 578 } 575 STATIC bool ispassive( structmolecule *p)579 STATIC bool ispassive(molecule *p) 576 580 { 577 581 … … 580 584 } 581 585 582 structmolecule *findspecies(const char buf[])586 molecule *findspecies(const char buf[]) 583 587 { 584 588 molecule_i p; … … 745 749 { 746 750 long int nelem; 747 struct molecule *mol1=*(struct molecule **)m1, *mol2=*(structmolecule **)m2;751 molecule *mol1=*(molecule **)m1, *mol2=*(molecule **)m2; 748 752 749 753 for (nelem=LIMELM-1; nelem >= ipHYDROGEN; nelem--) … … 844 848 return; 845 849 } 846 groupspecies = ( struct molecule **) MALLOC(mole.num_calc*sizeof(structmolecule *));850 groupspecies = (molecule **) MALLOC(mole.num_calc*sizeof(molecule *)); 847 851 for (i=0,j=0;i<mole.num_calc;i++) 848 852 { … … 862 866 } 863 867 mole.num_compacted = j; 864 groupspecies = ( structmolecule **) REALLOC((void *)groupspecies,865 mole.num_calc*sizeof( structmolecule *));868 groupspecies = (molecule **) REALLOC((void *)groupspecies, 869 mole.num_calc*sizeof(molecule *)); 866 870 867 871 for (i=0;i<mole.num_calc;i++)
