Changeset 2f1a7a for src


Ignore:
Timestamp:
Jun 26, 2010, 11:17:50 AM (15 years ago)
Author:
Tillmann Crueger <crueger@…>
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:
d0f111
Parents:
c7b39a
Message:

Removed Vector::InverseMatrixMultiplication() method

Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/vector.cpp

    rc7b39a r2f1a7a  
    574574};
    575575
    576 /** Do a matrix multiplication with the \a *A' inverse.
    577  * \param *matrix NDIM_NDIM array
    578  */
    579 bool Vector::InverseMatrixMultiplication(const double * const A)
    580 {
    581   /*
    582   double B[NDIM*NDIM];
    583   double detA = RDET3(A);
    584   double detAReci;
    585 
    586   // calculate the inverse B
    587   if (fabs(detA) > MYEPSILON) {;  // RDET3(A) yields precisely zero if A irregular
    588     detAReci = 1./detA;
    589     B[0] =  detAReci*RDET2(A[4],A[5],A[7],A[8]);    // A_11
    590     B[1] = -detAReci*RDET2(A[1],A[2],A[7],A[8]);    // A_12
    591     B[2] =  detAReci*RDET2(A[1],A[2],A[4],A[5]);    // A_13
    592     B[3] = -detAReci*RDET2(A[3],A[5],A[6],A[8]);    // A_21
    593     B[4] =  detAReci*RDET2(A[0],A[2],A[6],A[8]);    // A_22
    594     B[5] = -detAReci*RDET2(A[0],A[2],A[3],A[5]);    // A_23
    595     B[6] =  detAReci*RDET2(A[3],A[4],A[6],A[7]);    // A_31
    596     B[7] = -detAReci*RDET2(A[0],A[1],A[6],A[7]);    // A_32
    597     B[8] =  detAReci*RDET2(A[0],A[1],A[3],A[4]);    // A_33
    598 
    599     MatrixMultiplication(B);
    600 
    601     return true;
    602   } else {
    603     return false;
    604   }
    605   */
    606   Matrix mat = Matrix(A);
    607   try{
    608     (*this) *= mat.invert();
    609     return true;
    610   }
    611   catch(MathException &excpt){
    612     return false;
    613   }
    614 };
    615 
    616 
    617576/** Creates this vector as the b y *factors' components scaled linear combination of the given three.
    618577 * this vector = x1*factors[0] + x2* factors[1] + x3*factors[2]
     
    721680 * @param three vectors forming the matrix that defines the shape of the parallelpiped
    722681 */
    723 bool Vector::IsInParallelepiped(const Vector &offset, const double * const parallelepiped) const
     682bool Vector::IsInParallelepiped(const Vector &offset, const double * const _parallelepiped) const
    724683{
    725684  Vector a = (*this)-offset;
    726   a.InverseMatrixMultiplication(parallelepiped);
     685  Matrix parallelepiped = Matrix(_parallelepiped).invert();
     686  a.MatrixMultiplication(parallelepiped);
    727687  bool isInside = true;
    728688
  • src/vector.hpp

    rc7b39a r2f1a7a  
    6161  void Scale(const double factor);
    6262  void MatrixMultiplication(const Matrix &M);
    63   bool InverseMatrixMultiplication(const double * const M);
    6463  void KeepPeriodic(const double * const matrix);
    6564  bool GetOneNormalVector(const Vector &x1);
Note: See TracChangeset for help on using the changeset viewer.