Changeset ee4f2d for LinearAlgebra/src


Ignore:
Timestamp:
Aug 20, 2014, 1:09:40 PM (11 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, Candidate_v1.7.0, 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:
fc3aff
Parents:
2a03b0 (diff), 343c5a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'EnhancingHydrogenSaturation' into stable

Location:
LinearAlgebra/src/LinearAlgebra
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • LinearAlgebra/src/LinearAlgebra/Makefile.am

    r2a03b0 ree4f2d  
    44INCLUDES = -I$(top_srcdir)/src
    55
    6 AM_LDFLAGS = ${CodePatterns_LIBS} -ldl
     6AM_LDFLAGS = -ldl
    77AM_CPPFLAGS = $(BOOST_CPPFLAGS) ${CodePatterns_CFLAGS}
    88
     
    5252libLinearAlgebra_la_LIBADD = \
    5353        $(BOOST_SERIALIZATION_LDFLAGS) $(BOOST_SERIALIZATION_LIBS) \
     54        ${CodePatterns_LIBS} \
    5455        $(GSL_LIBS)
    5556nobase_libLinearAlgebra_la_include_HEADERS = ${LINALGHEADER}
  • LinearAlgebra/src/LinearAlgebra/Plane.cpp

    r2a03b0 ree4f2d  
    5757  Vector x1 = y1 - y2;
    5858  Vector x2 = y3 - y2;
    59   if ((x1.Norm() <= LINALG_MYEPSILON())) {
     59  if ((x1.NormSquared() <= LINALG_MYEPSILON())) {
    6060    throw LinearDependenceException() << LinearAlgebraVectorPair( make_pair(&y1, &y2) );
    6161  }
    62   if ((x2.Norm() <= LINALG_MYEPSILON())) {
     62  if ((x2.NormSquared() <= LINALG_MYEPSILON())) {
    6363    throw LinearDependenceException() << LinearAlgebraVectorPair( make_pair(&y2, &y3) );
    6464  }
    65   if((fabs(x1.Angle(x2)) <= LINALG_MYEPSILON())) {
     65  const Vector lineardependent = x1.Projection(x2) - x1;
     66  if((lineardependent.NormSquared() <= LINALG_MYEPSILON())) {
    6667    throw LinearDependenceException() << LinearAlgebraVectorPair( make_pair(&x1, &x2) );
    6768  }
  • LinearAlgebra/src/LinearAlgebra/Vector.cpp

    r2a03b0 ree4f2d  
    290290
    291291/** Checks whether vector has all components zero.
     292 * @param epsilon numerical tolerance for equality
    292293 * @return true - vector is zero, false - vector is not
    293294 */
    294 bool Vector::IsZero() const
    295 {
    296   return (fabs(at(0))+fabs(at(1))+fabs(at(2)) < LINALG_MYEPSILON());
     295bool Vector::IsZero(const double _epsilon) const
     296{
     297  return (fabs(at(0))+fabs(at(1))+fabs(at(2)) < _epsilon);
    297298};
    298299
    299300/** Checks whether vector has length of 1.
     301 * @param epsilon numerical tolerance for equality
    300302 * @return true - vector is normalized, false - vector is not
    301303 */
    302 bool Vector::IsOne() const
    303 {
    304   return (fabs(Norm() - 1.) < LINALG_MYEPSILON());
     304bool Vector::IsOne(const double _epsilon) const
     305{
     306  return (fabs(Norm() - 1.) < _epsilon);
    305307};
    306308
    307309/** Checks whether vector is normal to \a *normal.
     310 * @param normal other supposedly normal vector
     311 * @param epsilon numerical tolerance for equality
    308312 * @return true - vector is normalized, false - vector is not
    309313 */
    310 bool Vector::IsNormalTo(const Vector &normal) const
    311 {
    312   if (ScalarProduct(normal) < LINALG_MYEPSILON())
     314bool Vector::IsNormalTo(const Vector &normal, const double _epsilon) const
     315{
     316  if (ScalarProduct(normal) < _epsilon)
    313317    return true;
    314318  else
     
    316320};
    317321
     322/** Checks whether vector is parallel to \a *parallel.
     323 * @param parallel other supposedly parallel vector
     324 * @param epsilon numerical tolerance for equality
     325 * @return true - vector is parallel/linear dependent, false - vector is not
     326 */
     327bool Vector::IsParallelTo(const Vector &parallel, const double _epsilon) const
     328{
     329  if (1.-fabs(ScalarProduct(parallel)/parallel.Norm()/this->Norm()) < _epsilon)
     330    return true;
     331  else
     332    return false;
     333};
     334
    318335/** Checks whether vector is normal to \a *normal.
     336 * @param a other vector
     337 * @param epsilon numerical tolerance for equality
    319338 * @return true - vector is normalized, false - vector is not
    320339 */
    321 bool Vector::IsEqualTo(const Vector &a) const
     340bool Vector::IsEqualTo(const Vector &a, const double _epsilon) const
    322341{
    323342  bool status = true;
    324343  for (int i=0;i<NDIM;i++) {
    325     if (fabs(at(i) - a[i]) > LINALG_MYEPSILON())
     344    if (fabs(at(i) - a[i]) > _epsilon)
    326345      status = false;
    327346  }
  • LinearAlgebra/src/LinearAlgebra/Vector.hpp

    r2a03b0 ree4f2d  
    4646  double ScalarProduct(const Vector &y) const;
    4747  double Angle(const Vector &y) const;
    48   bool IsZero() const;
    49   bool IsOne() const;
    50   bool IsNormalTo(const Vector &normal) const;
    51   bool IsEqualTo(const Vector &a) const;
     48  bool IsZero(const double epsilon = LINALG_MYEPSILON()) const;
     49  bool IsOne(const double epsilon = LINALG_MYEPSILON()) const;
     50  bool IsNormalTo(const Vector &normal, const double epsilon = LINALG_MYEPSILON()) const;
     51  bool IsParallelTo(const Vector &normal, const double epsilon = LINALG_MYEPSILON()) const;
     52  bool IsEqualTo(const Vector &a, const double epsilon = LINALG_MYEPSILON()) const;
    5253
    5354  void AddVector(const Vector &y);
  • LinearAlgebra/src/LinearAlgebra/VectorContent.cpp

    r2a03b0 ree4f2d  
    504504{
    505505  double factor = Norm();
    506   (*this) *= 1/factor;
     506  if (fabs(factor) > LINALG_MYEPSILON())
     507    (*this) *= 1./factor;
    507508};
    508509
Note: See TracChangeset for help on using the changeset viewer.