Changeset 9eb7580


Ignore:
Timestamp:
Dec 4, 2010, 11:54:32 PM (14 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:
3bc926
Parents:
cfc53b
git-author:
Frederik Heber <heber@…> (11/15/10 10:29:25)
git-committer:
Frederik Heber <heber@…> (12/04/10 23:54:32)
Message:

Renamed Matrix setter functions to unify naming.

  • Matrix::one -> Matrix::setIdentity
  • Matrix::zero -> Matrix::setZero
  • Matrix::rotation -> Matrix::setRotation
Location:
src
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/AnalysisAction/PrincipalAxisSystemAction.cpp

    rcfc53b r9eb7580  
    4848
    4949    // reset inertia tensor
    50     InertiaTensor.zero();
     50    InertiaTensor.setZero();
    5151
    5252    // sum up inertia tensor
  • src/Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.cpp

    rcfc53b r9eb7580  
    5454
    5555    // reset inertia tensor
    56     InertiaTensor.zero();
     56    InertiaTensor.setZero();
    5757
    5858    // sum up inertia tensor
     
    105105    // summing anew for debugging (resulting matrix has to be diagonal!)
    106106    // reset inertia tensor
    107     InertiaTensor.zero();
     107    InertiaTensor.setZero();
    108108
    109109    // sum up inertia tensor
  • src/Actions/SelectionAction/AllAtomsInsideCuboidAction.cpp

    rcfc53b r9eb7580  
    5050  getParametersfromValueStorage();
    5151
    52   RotationMatrix.rotation(params.Xangle, params.Yangle, params.Zangle);
     52  RotationMatrix.setRotation(params.Xangle, params.Yangle, params.Zangle);
    5353
    5454  DoLog(1) && (Log() << Verbose(1) << "Selecting all atoms inside a rotated " << RotationMatrix << " cuboid at " << params.position << " and extension of " << params.extension << "." << endl);
     
    7272  Matrix RotationMatrix;
    7373
    74   RotationMatrix.rotation(state->params.Xangle, state->params.Yangle, state->params.Zangle);
     74  RotationMatrix.setRotation(state->params.Xangle, state->params.Yangle, state->params.Zangle);
    7575  Shape s = translate(transform(stretch(Cuboid(),state->params.extension),RotationMatrix),state->params.position);
    7676  World::getInstance().selectAllAtoms(AtomByShape(s));
  • src/Actions/SelectionAction/NotAllAtomsInsideCuboidAction.cpp

    rcfc53b r9eb7580  
    4949  // obtain information
    5050  getParametersfromValueStorage();
    51   RotationMatrix.rotation(params.Xangle, params.Yangle, params.Zangle);
     51  RotationMatrix.setRotation(params.Xangle, params.Yangle, params.Zangle);
    5252
    5353  DoLog(1) && (Log() << Verbose(1) << "Unselecting all atoms inside a rotated " << RotationMatrix << " cuboid at " << params.position << " and extension of " << params.extension << "." << endl);
     
    7272  Matrix RotationMatrix;
    7373
    74   RotationMatrix.rotation(state->params.Xangle, state->params.Yangle, state->params.Zangle);
     74  RotationMatrix.setRotation(state->params.Xangle, state->params.Yangle, state->params.Zangle);
    7575  Shape s = translate(transform(stretch(Cuboid(),state->params.extension),RotationMatrix),state->params.position);
    7676  World::getInstance().unselectAllAtoms(AtomByShape(s));
  • src/Box.cpp

    rcfc53b r9eb7580  
    3939{
    4040  M= new Matrix();
    41   M->one();
     41  M->setIdentity();
    4242  Minv = new Matrix();
    43   Minv->one();
     43  Minv->setIdentity();
    4444  conditions.resize(3);
    4545  conditions[0] = conditions[1] = conditions[2] = Wrap;
     
    253253void Box::setCuboid(const Vector &endpoint){
    254254  ASSERT(endpoint[0]>0 && endpoint[1]>0 && endpoint[2]>0,"Vector does not define a full cuboid");
    255   M->one();
     255  M->setIdentity();
    256256  M->diagonal()=endpoint;
    257257  Vector &dinv = Minv->diagonal();
  • src/LinearAlgebra/Matrix.cpp

    rcfc53b r9eb7580  
    106106}
    107107
    108 void Matrix::one(){
     108void Matrix::setIdentity(){
    109109  for(int i=NDIM;i--;){
    110110    for(int j=NDIM;j--;){
     
    114114}
    115115
    116 void Matrix::zero(){
     116void Matrix::setZero(){
    117117  for(int i=NDIM;i--;){
    118118    for(int j=NDIM;j--;){
     
    122122}
    123123
    124 void Matrix::rotation(const double x, const double y, const double z)
     124void Matrix::setRotation(const double x, const double y, const double z)
    125125{
    126126  set(0,0, cos(y)*cos(z));
  • src/LinearAlgebra/Matrix.hpp

    rcfc53b r9eb7580  
    4848   * Set the matrix to a unit matrix.
    4949   */
    50   void one();
     50  void setIdentity();
    5151
    5252  /**
    5353   * Set all matrix entries to zero.
    5454   */
    55   void zero();
     55  void setZero();
    5656
    5757  /**
     
    6060   * with given angles.
    6161   */
    62   void rotation(const double x, const double y, const double z);
     62  void setRotation(const double x, const double y, const double z);
    6363
    6464  /**
  • src/UIElements/Qt4/Pipe/BoxQtQueryPipe.cpp

    rcfc53b r9eb7580  
    3434{
    3535  tmpM = new Matrix();
    36   tmpM->zero();
     36  tmpM->setZero();
    3737}
    3838
  • src/unittests/BoxUnittest.cpp

    rcfc53b r9eb7580  
    4141  ASSERT_DO(Assert::Throw);
    4242  unit = new Matrix;
    43   unit->one();
     43  unit->setIdentity();
    4444  zero = new Matrix;
    4545  invertible = new Matrix;
     
    5252  unitBox = new Box;
    5353  stretchedBox1 = new Box;
    54   boxMat.one();
     54  boxMat.setIdentity();
    5555  boxMat.diagonal() = Vector(1,2,3);
    5656  stretchedBox1->setM(boxMat);
    5757
    5858  stretchedBox2 = new Box;
    59   boxMat.one();
     59  boxMat.setIdentity();
    6060  boxMat.diagonal() = Vector(2,3,1);
    6161  stretchedBox2->setM(boxMat);
    6262
    6363  stretchedBox3 = new Box;
    64   boxMat.one();
     64  boxMat.setIdentity();
    6565  boxMat.diagonal() = Vector(3,1,2);
    6666  stretchedBox3->setM(boxMat);
    6767
    6868  stretchedBox4 = new Box;
    69   boxMat.one();
     69  boxMat.setIdentity();
    7070  boxMat.diagonal() = Vector(2,2,2);
    7171  stretchedBox4->setM(boxMat);
    7272
    7373  tiltedBox1 = new Box;
    74   boxMat.one();
     74  boxMat.setIdentity();
    7575  boxMat.column(0) = Vector(1,0,1);
    7676  tiltedBox1->setM(boxMat);
    7777
    7878  tiltedBox2 = new Box;
    79   boxMat.one();
     79  boxMat.setIdentity();
    8080  boxMat.column(0) = Vector(1,1,1);
    8181  tiltedBox2->setM(boxMat);
    8282
    8383  tiltedBox3 = new Box;
    84   boxMat.one();
     84  boxMat.setIdentity();
    8585  boxMat.column(1) = Vector(0,1,1);
    8686  tiltedBox3->setM(boxMat);
    8787
    8888  tiltedBox4 = new Box;
    89   boxMat.one();
     89  boxMat.setIdentity();
    9090  boxMat.column(0) = Vector(1,1,1);
    9191  boxMat.column(1) = Vector(0,1,1);
  • src/unittests/MatrixUnittest.cpp

    rcfc53b r9eb7580  
    121121  CPPUNIT_ASSERT_EQUAL(mat.diagonal(),zeroVec);
    122122
    123   mat.one();
     123  mat.setIdentity();
    124124  CPPUNIT_ASSERT_EQUAL(mat.row(0),unitVec[0]);
    125125  CPPUNIT_ASSERT_EQUAL(mat.row(1),unitVec[1]);
     
    171171
    172172  // transpose of unit is unit
    173   res.one();
     173  res.setIdentity();
    174174  (const Matrix)res.transpose();
    175175  CPPUNIT_ASSERT_EQUAL(res,*one);
    176176
    177177  // transpose of transpose is same matrix
    178   res.zero();
     178  res.setZero();
    179179  res.set(2,2, 1.);
    180180  CPPUNIT_ASSERT_EQUAL(res.transpose().transpose(),res);
     
    258258
    259259  // zero rotation angles yields unity matrix
    260   res.rotation(0,0,0);
     260  res.setRotation(0,0,0);
    261261  CPPUNIT_ASSERT_EQUAL(*one, res);
    262262
    263263  // arbitrary rotation matrix has det = 1
    264   res.rotation(M_PI/3.,1.,M_PI/7.);
     264  res.setRotation(M_PI/3.,1.,M_PI/7.);
    265265  CPPUNIT_ASSERT(fabs(fabs(res.determinant()) -1.) < MYEPSILON);
    266266
    267267  // inverse is rotation matrix with negative angles
    268   res.rotation(M_PI/3.,0.,0.);
    269   inverse.rotation(-M_PI/3.,0.,0.);
     268  res.setRotation(M_PI/3.,0.,0.);
     269  inverse.setRotation(-M_PI/3.,0.,0.);
    270270  CPPUNIT_ASSERT_EQUAL(*one, res * inverse);
    271271
    272272  // ... or transposed
    273   res.rotation(M_PI/3.,0.,0.);
     273  res.setRotation(M_PI/3.,0.,0.);
    274274  CPPUNIT_ASSERT_EQUAL(inverse, ((const Matrix) res).transpose());
    275275}
Note: See TracChangeset for help on using the changeset viewer.