Ignore:
Timestamp:
Dec 5, 2010, 12:19:19 AM (15 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:
f03705
Parents:
589112 (diff), bbf1bd (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 'MatrixVectorContentRefactoring' into stable

File:
1 moved

Legend:

Unmodified
Added
Removed
  • src/LinearAlgebra/RealSpaceMatrix.hpp

    r589112 r6e06bd  
    11/*
    2  * Matrix.hpp
     2 * RealSpaceMatrix.hpp
    33 *
    44 *  Created on: Jun 25, 2010
     
    66 */
    77
    8 #ifndef MATRIX_HPP_
    9 #define MATRIX_HPP_
     8#ifndef REALSPACEMATRIX_HPP_
     9#define REALSPACEMATRIX_HPP_
    1010
    1111#include <iosfwd>
     
    1919class MatrixContent;
    2020
    21 class Matrix
     21/** 3x3 Matrix class.
     22 * This class has some specific features for 3D space such as rotations or
     23 * hard-coded determinants.
     24 */
     25class RealSpaceMatrix
    2226{
    23   friend Vector operator*(const Matrix&,const Vector&);
     27  friend Vector operator*(const RealSpaceMatrix&,const Vector&);
    2428public:
    25   Matrix();
     29  RealSpaceMatrix();
    2630
    2731  /**
     
    4145   *
    4246   */
    43   Matrix(const double*);
    44   Matrix(const Matrix&);
    45   virtual ~Matrix();
     47  RealSpaceMatrix(const double*);
     48  RealSpaceMatrix(const RealSpaceMatrix&);
     49  RealSpaceMatrix(const MatrixContent&);
     50  virtual ~RealSpaceMatrix();
    4651
    4752  /**
    4853   * Set the matrix to a unit matrix.
    4954   */
    50   void one();
     55  void setIdentity();
    5156
    5257  /**
    5358   * Set all matrix entries to zero.
    5459   */
    55   void zero();
     60  void setZero();
    5661
    5762  /**
     
    6065   * with given angles.
    6166   */
    62   void rotation(const double x, const double y, const double z);
     67  void setRotation(const double x, const double y, const double z);
    6368
    6469  /**
     
    106111   * Rather costly, so use precomputation as often as possible.
    107112   */
    108   Matrix invert() const;
     113  RealSpaceMatrix invert() const;
    109114
    110115  /**
     
    119124   * Calculate the transpose of the matrix.
    120125   */
    121   Matrix transpose() const;
    122   Matrix &transpose();
     126  RealSpaceMatrix transpose() const;
     127  RealSpaceMatrix &transpose();
    123128
    124129  // operators
    125   Matrix &operator=(const Matrix&);
     130  RealSpaceMatrix &operator=(const RealSpaceMatrix&);
    126131
    127   const Matrix &operator+=(const Matrix&);
    128   const Matrix &operator-=(const Matrix&);
    129   const Matrix &operator*=(const Matrix&);
     132  const RealSpaceMatrix &operator+=(const RealSpaceMatrix&);
     133  const RealSpaceMatrix &operator-=(const RealSpaceMatrix&);
     134  const RealSpaceMatrix &operator*=(const RealSpaceMatrix&);
    130135
    131   const Matrix &operator*=(const double);
     136  const RealSpaceMatrix &operator*=(const double);
    132137
    133   const Matrix operator+(const Matrix&) const;
    134   const Matrix operator-(const Matrix&) const;
    135   const Matrix operator*(const Matrix&) const;
     138  const RealSpaceMatrix operator+(const RealSpaceMatrix&) const;
     139  const RealSpaceMatrix operator-(const RealSpaceMatrix&) const;
     140  const RealSpaceMatrix operator*(const RealSpaceMatrix&) const;
    136141
    137   bool operator==(const Matrix&) const;
     142  bool operator==(const RealSpaceMatrix&) const;
    138143
    139144private:
    140   Matrix(MatrixContent*);
     145  RealSpaceMatrix(MatrixContent*);
    141146  void createViews();
    142147  MatrixContent *content;
     
    147152};
    148153
    149 const Matrix operator*(const double,const Matrix&);
    150 const Matrix operator*(const Matrix&,const double);
     154const RealSpaceMatrix operator*(const double,const RealSpaceMatrix&);
     155const RealSpaceMatrix operator*(const RealSpaceMatrix&,const double);
    151156
    152157/**
     
    164169 * 5 -> (2,2)
    165170 */
    166 Matrix ReturnFullMatrixforSymmetric(const double * const cell_size);
     171RealSpaceMatrix ReturnFullMatrixforSymmetric(const double * const cell_size);
    167172
    168 std::ostream &operator<<(std::ostream&,const Matrix&);
    169 Vector operator*(const Matrix&,const Vector&);
    170 Vector& operator*=(Vector&,const Matrix&);
     173std::ostream &operator<<(std::ostream&,const RealSpaceMatrix&);
     174Vector operator*(const RealSpaceMatrix&,const Vector&);
     175Vector& operator*=(Vector&,const RealSpaceMatrix&);
    171176
    172 #endif /* MATRIX_HPP_ */
     177#endif /* REALSPACEMATRIX_HPP_ */
Note: See TracChangeset for help on using the changeset viewer.