Changeset e9b8bb for src/builder.cpp


Ignore:
Timestamp:
Aug 6, 2008, 9:02:01 AM (17 years ago)
Author:
Frederik Heber <heber@…>
Branches:
Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
Children:
5e0d1f
Parents:
d7e30c
Message:

Rename of class vector to Vector to avoid conflict with vector from STL.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/builder.cpp

    rd7e30c re9b8bb  
    6363{
    6464  atom *first, *second, *third, *fourth;
    65   vector **atoms;
    66   vector x,y,z,n;  // coordinates for absolute point in cell volume
     65  Vector **atoms;
     66  Vector x,y,z,n;  // coordinates for absolute point in cell volume
    6767  double a,b,c;
    6868  char choice;  // menu choice char
     
    9999          cout << Verbose(0) << "Enter relative coordinates." << endl;
    100100          first->x.AskPosition(mol->cell_size, false);
    101           first->x.AddVector((const vector *)&x);
     101          first->x.AddVector((const Vector *)&x);
    102102          cout << Verbose(0) << "\n";
    103         } while (!(valid = mol->CheckBounds((const vector *)&first->x)));
     103        } while (!(valid = mol->CheckBounds((const Vector *)&first->x)));
    104104        first->type = periode->AskElement();  // give type
    105105        mol->AddAtom(first);  // add to molecule
     
    117117            first->x.x[i] += second->x.x[i];
    118118          }
    119         } while (!(valid = mol->CheckBounds((const vector *)&first->x)));
     119        } while (!(valid = mol->CheckBounds((const Vector *)&first->x)));
    120120        first->type = periode->AskElement();  // give type
    121121        mol->AddAtom(first);  // add to molecule
     
    219219          first->x.Output((ofstream *)&cout);
    220220          cout << Verbose(0) << endl;
    221         } while (!(valid = mol->CheckBounds((const vector *)&first->x)));
     221        } while (!(valid = mol->CheckBounds((const Vector *)&first->x)));
    222222        first->type = periode->AskElement();  // give type
    223223        mol->AddAtom(first);  // add to molecule
     
    226226      case 'e': // least square distance position to a set of atoms
    227227        first = new atom;
    228         atoms = new (vector*[128]);
     228        atoms = new (Vector*[128]);
    229229        valid = true;
    230230        for(int i=128;i--;)
     
    259259static void CenterAtoms(molecule *mol)
    260260{
    261   vector x, y;
     261  Vector x, y;
    262262  char choice;  // menu choice char
    263263 
     
    315315{
    316316  atom *first, *second, *third;
    317   vector x,n;
     317  Vector x,n;
    318318  char choice;  // menu choice char
    319319
     
    335335      third = mol->AskAtom("Enter third atom: ");
    336336
    337       n.MakeNormalVector((const vector *)&first->x,(const vector *)&second->x,(const vector *)&third->x);
     337      n.MakeNormalVector((const Vector *)&first->x,(const Vector *)&second->x,(const Vector *)&third->x);
    338338      break;
    339339    case 'b': // normal vector of mirror plane
     
    346346      second = mol->AskAtom("Enter second atom: ");
    347347
    348       n.CopyVector((const vector *)&first->x); 
    349       n.SubtractVector((const vector *)&second->x); 
     348      n.CopyVector((const Vector *)&first->x); 
     349      n.SubtractVector((const Vector *)&second->x); 
    350350      n.Normalize();
    351351      break;       
    352352    case 'd':
    353353      char shorthand[4];
    354       vector a;
     354      Vector a;
    355355      struct lsq_params param;
    356356      do {
     
    383383{
    384384  atom *first, *second, *third;
    385   vector n;
     385  Vector n;
    386386  char choice;  // menu choice char
    387387 
     
    402402      third = mol->AskAtom("Enter third atom: ");
    403403
    404       n.MakeNormalVector((const vector *)&first->x,(const vector *)&second->x,(const vector *)&third->x);
     404      n.MakeNormalVector((const Vector *)&first->x,(const Vector *)&second->x,(const Vector *)&third->x);
    405405      break;
    406406    case 'b': // normal vector of mirror plane
     
    413413      second = mol->AskAtom("Enter second atom: ");
    414414
    415       n.CopyVector((const vector *)&first->x); 
    416       n.SubtractVector((const vector *)&second->x); 
     415      n.CopyVector((const Vector *)&first->x); 
     416      n.SubtractVector((const Vector *)&second->x); 
    417417      n.Normalize();
    418418      break;         
     
    421421  n.Output((ofstream *)&cout);
    422422  cout << Verbose(0) << endl;
    423   mol->Mirror((const vector *)&n);
     423  mol->Mirror((const Vector *)&n);
    424424};
    425425
     
    458458      while(first->next != mol->end) {
    459459        first = first->next;
    460         if (first->x.Distance((const vector *)&second->x) > tmp1*tmp1) // distance to first above radius ...
     460        if (first->x.Distance((const Vector *)&second->x) > tmp1*tmp1) // distance to first above radius ...
    461461          mol->RemoveAtom(first);
    462462      }
     
    488488{
    489489  atom *first, *second, *third;
    490   vector x,y;
     490  Vector x,y;
    491491  double min[256], tmp1, tmp2, tmp3;
    492492  int Z;
     
    519519        tmp1 = 0.;
    520520        if (first != second) {
    521           x.CopyVector((const vector *)&first->x);
    522           x.SubtractVector((const vector *)&second->x);
     521          x.CopyVector((const Vector *)&first->x);
     522          x.SubtractVector((const Vector *)&second->x);
    523523          tmp1 = x.Norm();
    524524        }
     
    535535      for (int i=NDIM;i--;)
    536536        min[i] = 0.;
    537       x.CopyVector((const vector *)&first->x);
    538       x.SubtractVector((const vector *)&second->x);
     537      x.CopyVector((const Vector *)&first->x);
     538      x.SubtractVector((const Vector *)&second->x);
    539539      tmp1 = x.Norm();
    540540      cout << Verbose(1) << "Distance vector is ";
     
    549549      third  = mol->AskAtom("Enter last atom: ");
    550550      tmp1 = tmp2 = tmp3 = 0.;
    551       x.CopyVector((const vector *)&first->x);
    552       x.SubtractVector((const vector *)&second->x);
    553       y.CopyVector((const vector *)&third->x);
    554       y.SubtractVector((const vector *)&second->x);
     551      x.CopyVector((const Vector *)&first->x);
     552      x.SubtractVector((const Vector *)&second->x);
     553      y.CopyVector((const Vector *)&third->x);
     554      y.SubtractVector((const Vector *)&second->x);
    555555      cout << Verbose(0) << "Bond angle between first atom Nr." << first->nr << ", central atom Nr." << second->nr << " and last atom Nr." << third->nr << ": ";
    556       cout << Verbose(0) << (acos(x.ScalarProduct((const vector *)&y)/(y.Norm()*x.Norm()))/M_PI*180.) << " degrees" << endl;         
     556      cout << Verbose(0) << (acos(x.ScalarProduct((const Vector *)&y)/(y.Norm()*x.Norm()))/M_PI*180.) << " degrees" << endl;         
    557557      break;
    558558    case 'd':
     
    727727static int ParseCommandLineOptions(int argc, char **argv, molecule *&mol, periodentafel *&periode, config& configuration, char *&ConfigFileName, char *&PathToDatabases)
    728728{
    729   vector x,y,z,n;  // coordinates for absolute point in cell volume
     729  Vector x,y,z,n;  // coordinates for absolute point in cell volume
    730730  double *factor; // unit factor if desired
    731731  ifstream test;
     
    889889              for (int i=NDIM;i--;)
    890890                x.x[i] = atof(argv[argptr+i]);
    891               mol->Translate((const vector *)&x);
     891              mol->Translate((const Vector *)&x);
    892892              argptr+=3;
    893893              break;
     
    958958                mol->cell_size[j] += x.x[i]*2.;
    959959              }
    960               mol->Translate((const vector *)&x);
     960              mol->Translate((const Vector *)&x);
    961961              break;
    962962            case 'O':
     
    10341034                int count;
    10351035                element ** Elements;
    1036                 vector ** vectors;
     1036                Vector ** vectors;
    10371037                if (faktor < 1) {
    10381038                  cerr << Verbose(0) << "ERROR: Repetition faktor mus be greater than 1!" << endl;
     
    10431043                  count = mol->AtomCount;   // is changed becausing of adding, thus has to be stored away beforehand
    10441044                  Elements = new element *[count];
    1045                   vectors = new vector *[count];
     1045                  vectors = new Vector *[count];
    10461046                  j = 0;
    10471047                  first = mol->start;
     
    11171117  atom *first, *second;
    11181118  char choice;  // menu choice char
    1119   vector x,y,z,n;  // coordinates for absolute point in cell volume
     1119  Vector x,y,z,n;  // coordinates for absolute point in cell volume
    11201120        double *factor; // unit factor if desired
    11211121  bool valid; // flag if input was valid or not
     
    11321132  clock_t start,end;
    11331133  element **Elements;
    1134   vector **vectors;
     1134  Vector **vectors;
    11351135
    11361136  // =========================== PARSE COMMAND LINE OPTIONS ====================================
     
    12311231          count = mol->AtomCount;   // is changed becausing of adding, thus has to be stored away beforehand
    12321232          Elements = new element *[count];
    1233           vectors = new vector *[count];
     1233          vectors = new Vector *[count];
    12341234          j = 0;
    12351235          first = mol->start;
     
    13351335       cout << Verbose(0) << "Enter translation vector." << endl;       
    13361336       x.AskPosition(mol->cell_size,0);
    1337        mol->Translate((const vector *)&x);
     1337       mol->Translate((const Vector *)&x);
    13381338       break;
    13391339 
Note: See TracChangeset for help on using the changeset viewer.