source: src/SingleVector.hpp@ 1bd79e

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
Last change on this file since 1bd79e was 1bd79e, checked in by Tillmann Crueger <crueger@…>, 15 years ago

Changed implementation of Vector to forward operations to contained objects

  • Property mode set to 100755
File size: 2.7 KB
Line 
1#ifndef SINGLEVECTOR_HPP_
2#define SINGLEVECTOR_HPP_
3
4using namespace std;
5
6/*********************************************** includes ***********************************/
7
8// include config.h
9#ifdef HAVE_CONFIG_H
10#include <config.h>
11#endif
12
13#include <iostream>
14#include <gsl/gsl_vector.h>
15#include <gsl/gsl_multimin.h>
16#include "vector.hpp"
17
18#include "defs.hpp"
19
20/********************************************** declarations *******************************/
21
22/** Single vector.
23 * basically, just a x[3] but with helpful functions
24 */
25class SingleVector : public Vector {
26public:
27
28 SingleVector();
29 SingleVector(const double x1, const double x2, const double x3);
30 SingleVector(const Vector& src);
31 virtual ~SingleVector();
32
33 virtual double DistanceSquared(const Vector &y) const;
34 virtual double DistanceToPlane(const Vector &PlaneNormal, const Vector &PlaneOffset) const;
35 virtual double PeriodicDistance(const Vector &y, const double * const cell_size) const;
36 virtual double PeriodicDistanceSquared(const Vector &y, const double * const cell_size) const;
37 virtual double ScalarProduct(const Vector &y) const;
38 virtual double Angle(const Vector &y) const;
39 virtual bool IsZero() const;
40 virtual bool IsOne() const;
41 virtual bool IsNormalTo(const Vector &normal) const;
42 virtual bool IsEqualTo(const Vector &a) const;
43
44 virtual void AddVector(const Vector &y);
45 virtual void SubtractVector(const Vector &y);
46 virtual void VectorProduct(const Vector &y);
47 virtual void ProjectOntoPlane(const Vector &y);
48 virtual void ProjectIt(const Vector &y);
49 virtual Vector Projection(const Vector &y) const;
50 virtual void Mirror(const Vector &x);
51 virtual void ScaleAll(const double *factor);
52 virtual void Scale(const double factor);
53 virtual void MatrixMultiplication(const double * const M);
54 virtual bool InverseMatrixMultiplication(const double * const M);
55 virtual void KeepPeriodic(const double * const matrix);
56 virtual bool GetOneNormalVector(const Vector &x1);
57 virtual bool MakeNormalTo(const Vector &y1);
58 virtual bool IsInParallelepiped(const Vector &offset, const double * const parallelepiped) const;
59 virtual void WrapPeriodically(const double * const M, const double * const Minv);
60
61 // Accessors ussually come in pairs... and sometimes even more than that
62 virtual double& operator[](size_t i);
63 virtual const double& operator[](size_t i) const;
64
65 // Access to internal structure
66 virtual double* get();
67protected:
68
69private:
70 // method used for protection, i.e. to avoid infinite recursion
71 // when our internal rep becomes messed up
72 virtual bool isBaseClass() const;
73 virtual SingleVector *clone() const;
74 void CopyVector(SingleVector &rhs);
75 double x[NDIM];
76
77};
78
79#endif /*SINGLEVECTOR_HPP_*/
Note: See TracBrowser for help on using the repository browser.