- Timestamp:
- Dec 4, 2010, 11:54:32 PM (14 years ago)
- 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:
- 0d4424
- Parents:
- 3bc926
- git-author:
- Frederik Heber <heber@…> (11/15/10 12:58:27)
- git-committer:
- Frederik Heber <heber@…> (12/04/10 23:54:32)
- Location:
- src
- Files:
-
- 45 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/AnalysisAction/PrincipalAxisSystemAction.cpp
r3bc926 rcca9ef 22 22 #include "Helpers/Log.hpp" 23 23 #include "Helpers/Verbose.hpp" 24 #include "LinearAlgebra/ Matrix.hpp"24 #include "LinearAlgebra/RealSpaceMatrix.hpp" 25 25 #include "LinearAlgebra/Vector.hpp" 26 26 #include "element.hpp" … … 40 40 /** =========== define the function ====================== */ 41 41 Action::state_ptr AnalysisPrincipalAxisSystemAction::performCall() { 42 Matrix InertiaTensor;42 RealSpaceMatrix InertiaTensor; 43 43 44 44 DoLog(0) && (Log() << Verbose(0) << "Evaluating prinicipal axis." << endl); -
src/Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.cpp
r3bc926 rcca9ef 23 23 #include "Helpers/Verbose.hpp" 24 24 #include "LinearAlgebra/Line.hpp" 25 #include "LinearAlgebra/ Matrix.hpp"25 #include "LinearAlgebra/RealSpaceMatrix.hpp" 26 26 #include "LinearAlgebra/Vector.hpp" 27 27 #include "element.hpp" … … 50 50 mol = iter->second; 51 51 DoLog(0) && (Log() << Verbose(0) << "Converting to prinicipal axis system." << endl); 52 Matrix InertiaTensor;52 RealSpaceMatrix InertiaTensor; 53 53 Vector *CenterOfGravity = mol->DetermineCenterOfGravity(); 54 54 -
src/Actions/SelectionAction/AllAtomsInsideCuboidAction.cpp
r3bc926 rcca9ef 25 25 #include "Helpers/Log.hpp" 26 26 #include "Helpers/Verbose.hpp" 27 #include "LinearAlgebra/ Matrix.hpp"27 #include "LinearAlgebra/RealSpaceMatrix.hpp" 28 28 #include "LinearAlgebra/Vector.hpp" 29 29 #include "Shapes/BaseShapes.hpp" … … 45 45 Action::state_ptr SelectionAllAtomsInsideCuboidAction::performCall() { 46 46 std::vector<atom *> selectedAtoms = World::getInstance().getSelectedAtoms(); 47 Matrix RotationMatrix;47 RealSpaceMatrix RotationMatrix; 48 48 49 49 // obtain information … … 70 70 Action::state_ptr SelectionAllAtomsInsideCuboidAction::performRedo(Action::state_ptr _state){ 71 71 SelectionAllAtomsInsideCuboidState *state = assert_cast<SelectionAllAtomsInsideCuboidState*>(_state.get()); 72 Matrix RotationMatrix;72 RealSpaceMatrix RotationMatrix; 73 73 74 74 RotationMatrix.setRotation(state->params.Xangle, state->params.Yangle, state->params.Zangle); -
src/Actions/SelectionAction/NotAllAtomsInsideCuboidAction.cpp
r3bc926 rcca9ef 25 25 #include "Helpers/Log.hpp" 26 26 #include "Helpers/Verbose.hpp" 27 #include "LinearAlgebra/ Matrix.hpp"27 #include "LinearAlgebra/RealSpaceMatrix.hpp" 28 28 #include "LinearAlgebra/Vector.hpp" 29 29 #include "Shapes/BaseShapes.hpp" … … 45 45 Action::state_ptr SelectionNotAllAtomsInsideCuboidAction::performCall() { 46 46 std::vector<atom *> selectedAtoms = World::getInstance().getSelectedAtoms(); 47 Matrix RotationMatrix;47 RealSpaceMatrix RotationMatrix; 48 48 49 49 // obtain information … … 70 70 Action::state_ptr SelectionNotAllAtomsInsideCuboidAction::performRedo(Action::state_ptr _state){ 71 71 SelectionNotAllAtomsInsideCuboidState *state = assert_cast<SelectionNotAllAtomsInsideCuboidState*>(_state.get()); 72 Matrix RotationMatrix;72 RealSpaceMatrix RotationMatrix; 73 73 74 74 RotationMatrix.setRotation(state->params.Xangle, state->params.Yangle, state->params.Zangle); -
src/Actions/ValueStorage.cpp
r3bc926 rcca9ef 31 31 #include "Helpers/Verbose.hpp" 32 32 #include "LinearAlgebra/BoxVector.hpp" 33 #include "LinearAlgebra/ Matrix.hpp"33 #include "LinearAlgebra/RealSpaceMatrix.hpp" 34 34 #include "LinearAlgebra/Vector.hpp" 35 35 #include "atom.hpp" … … 95 95 96 96 void ValueStorage::queryCurrentValue(const char * name, class Box &_T) { 97 Matrix M;97 RealSpaceMatrix M; 98 98 double tmp; 99 99 if (typeid( Box ) == *(OptionRegistry_instance.getOptionByName(name)->getType())) { … … 254 254 void ValueStorage::setCurrentValue(const char * name, class Box &_T) 255 255 { 256 const Matrix &M = _T.getM();256 const RealSpaceMatrix &M = _T.getM(); 257 257 if (typeid( Box ) == *(OptionRegistry_instance.getOptionByName(name)->getType())) { 258 258 std::ostringstream stream; -
src/Actions/WorldAction/CenterOnEdgeAction.cpp
r3bc926 rcca9ef 24 24 #include "LinearAlgebra/Vector.hpp" 25 25 #include "World.hpp" 26 #include "LinearAlgebra/ Matrix.hpp"26 #include "LinearAlgebra/RealSpaceMatrix.hpp" 27 27 28 28 #include <iostream> … … 59 59 } 60 60 // set new box size 61 Matrix domain;61 RealSpaceMatrix domain; 62 62 for (int i=0;i<NDIM;i++) { 63 63 double tmp = Max[i]-Min[i]; -
src/Actions/WorldAction/ChangeBoxAction.cpp
r3bc926 rcca9ef 24 24 #include "World.hpp" 25 25 #include "Box.hpp" 26 #include "LinearAlgebra/ Matrix.hpp"26 #include "LinearAlgebra/RealSpaceMatrix.hpp" 27 27 28 28 #include <iostream> -
src/Actions/WorldAction/RepeatBoxAction.cpp
r3bc926 rcca9ef 25 25 #include "molecule.hpp" 26 26 #include "LinearAlgebra/Vector.hpp" 27 #include "LinearAlgebra/ Matrix.hpp"27 #include "LinearAlgebra/RealSpaceMatrix.hpp" 28 28 #include "Helpers/Verbose.hpp" 29 29 #include "World.hpp" … … 63 63 64 64 (cout << "Repeating box " << params.Repeater << " times for (x,y,z) axis." << endl); 65 Matrix M = World::getInstance().getDomain().getM();66 Matrix newM = M;65 RealSpaceMatrix M = World::getInstance().getDomain().getM(); 66 RealSpaceMatrix newM = M; 67 67 Vector x,y; 68 68 int n[NDIM]; 69 Matrix repMat;69 RealSpaceMatrix repMat; 70 70 for (int axis = 0; axis < NDIM; axis++) { 71 71 params.Repeater[axis] = floor(params.Repeater[axis]); -
src/Actions/WorldAction/ScaleBoxAction.cpp
r3bc926 rcca9ef 26 26 #include "World.hpp" 27 27 #include "Box.hpp" 28 #include "LinearAlgebra/ Matrix.hpp"28 #include "LinearAlgebra/RealSpaceMatrix.hpp" 29 29 30 30 #include <iostream> … … 53 53 } 54 54 55 Matrix M = World::getInstance().getDomain().getM();56 Matrix scale;55 RealSpaceMatrix M = World::getInstance().getDomain().getM(); 56 RealSpaceMatrix scale; 57 57 58 58 for (int i=0;i<NDIM;i++) { -
src/Box.cpp
r3bc926 rcca9ef 26 26 #include <cstdlib> 27 27 28 #include "LinearAlgebra/ Matrix.hpp"28 #include "LinearAlgebra/RealSpaceMatrix.hpp" 29 29 #include "LinearAlgebra/Vector.hpp" 30 30 #include "LinearAlgebra/Plane.hpp" … … 38 38 Box::Box() 39 39 { 40 M= new Matrix();40 M= new RealSpaceMatrix(); 41 41 M->setIdentity(); 42 Minv = new Matrix();42 Minv = new RealSpaceMatrix(); 43 43 Minv->setIdentity(); 44 44 conditions.resize(3); … … 47 47 48 48 Box::Box(const Box& src){ 49 M=new Matrix(*src.M);50 Minv = new Matrix(*src.Minv);49 M=new RealSpaceMatrix(*src.M); 50 Minv = new RealSpaceMatrix(*src.Minv); 51 51 conditions = src.conditions; 52 52 } … … 58 58 } 59 59 60 const Matrix &Box::getM() const{60 const RealSpaceMatrix &Box::getM() const{ 61 61 return *M; 62 62 } 63 const Matrix &Box::getMinv() const{63 const RealSpaceMatrix &Box::getMinv() const{ 64 64 return *Minv; 65 65 } 66 66 67 void Box::setM( Matrix _M){67 void Box::setM(RealSpaceMatrix _M){ 68 68 ASSERT(_M.determinant()!=0,"Matrix in Box construction was not invertible"); 69 69 *M =_M; … … 264 264 delete M; 265 265 delete Minv; 266 M = new Matrix(*src.M);267 Minv = new Matrix(*src.Minv);266 M = new RealSpaceMatrix(*src.M); 267 Minv = new RealSpaceMatrix(*src.Minv); 268 268 conditions = src.conditions; 269 269 } … … 271 271 } 272 272 273 Box &Box::operator=(const Matrix &mat){273 Box &Box::operator=(const RealSpaceMatrix &mat){ 274 274 setM(mat); 275 275 return *this; -
src/Box.hpp
r3bc926 rcca9ef 9 9 #define BOX_HPP_ 10 10 11 class Matrix;11 class RealSpaceMatrix; 12 12 class Vector; 13 13 class Shape; … … 44 44 * Get the matrix describing the form of the parallelepiped 45 45 */ 46 const Matrix &getM() const;46 const RealSpaceMatrix &getM() const; 47 47 48 48 /** 49 49 * Get the inverse of the matrix M (see above). 50 50 */ 51 const Matrix &getMinv() const;51 const RealSpaceMatrix &getMinv() const; 52 52 53 53 /** 54 54 * Set the form of the parallelepiped. 55 55 */ 56 void setM( Matrix);56 void setM(RealSpaceMatrix); 57 57 58 58 Box &operator=(const Box&); 59 Box &operator=(const Matrix&);59 Box &operator=(const RealSpaceMatrix&); 60 60 61 61 /** … … 110 110 private: 111 111 Conditions_t conditions; 112 Matrix *M; //!< Defines the layout of the box113 Matrix *Minv; //!< Inverse of M to avoid recomputation112 RealSpaceMatrix *M; //!< Defines the layout of the box 113 RealSpaceMatrix *Minv; //!< Inverse of M to avoid recomputation 114 114 }; 115 115 -
src/LinearAlgebra/Makefile.am
r3bc926 rcca9ef 18 18 LineSegmentSet.cpp \ 19 19 linearsystemofequations.cpp \ 20 Matrix.cpp \21 20 MatrixContent.cpp \ 22 21 Plane.cpp \ 22 RealSpaceMatrix.cpp \ 23 23 Space.cpp \ 24 24 vector_ops.cpp \ … … 34 34 LineSegmentSet.hpp \ 35 35 linearsystemofequations.hpp \ 36 Matrix.hpp \37 36 MatrixContent.hpp \ 37 RealSpaceMatrix.hpp \ 38 38 Plane.hpp \ 39 39 Space.hpp \ -
src/LinearAlgebra/MatrixContent.cpp
r3bc926 rcca9ef 14 14 #include "Helpers/MemDebug.hpp" 15 15 16 #include "LinearAlgebra/ Matrix.hpp"16 #include "LinearAlgebra/RealSpaceMatrix.hpp" 17 17 #include "Helpers/Assert.hpp" 18 18 #include "Exceptions/NotInvertibleException.hpp" -
src/LinearAlgebra/MatrixContent.hpp
r3bc926 rcca9ef 40 40 { 41 41 friend Vector operator*(const MatrixContent &mat,const Vector &vec); 42 friend class Matrix;42 friend class RealSpaceMatrix; 43 43 public: 44 44 MatrixContent(size_t rows, size_t columns); -
src/LinearAlgebra/RealSpaceMatrix.cpp
r3bc926 rcca9ef 7 7 8 8 /* 9 * Matrix.cpp9 * RealSpaceMatrix.cpp 10 10 * 11 11 * Created on: Jun 25, 2010 … … 20 20 #include "Helpers/MemDebug.hpp" 21 21 22 #include "LinearAlgebra/ Matrix.hpp"22 #include "LinearAlgebra/RealSpaceMatrix.hpp" 23 23 #include "Helpers/Assert.hpp" 24 24 #include "Exceptions/NotInvertibleException.hpp" … … 39 39 using namespace std; 40 40 41 Matrix::Matrix()41 RealSpaceMatrix::RealSpaceMatrix() 42 42 { 43 43 content = new MatrixContent(NDIM, NDIM); … … 45 45 } 46 46 47 Matrix::Matrix(const double* src)47 RealSpaceMatrix::RealSpaceMatrix(const double* src) 48 48 { 49 49 content = new MatrixContent(NDIM, NDIM, src); … … 51 51 } 52 52 53 Matrix::Matrix(constMatrix &src)53 RealSpaceMatrix::RealSpaceMatrix(const RealSpaceMatrix &src) 54 54 { 55 55 content = new MatrixContent(src.content); … … 57 57 } 58 58 59 Matrix::Matrix(const MatrixContent &src)59 RealSpaceMatrix::RealSpaceMatrix(const MatrixContent &src) 60 60 { 61 61 content = new MatrixContent(src); … … 63 63 } 64 64 65 Matrix::Matrix(MatrixContent* _content)65 RealSpaceMatrix::RealSpaceMatrix(MatrixContent* _content) 66 66 { 67 67 content = new MatrixContent(_content); … … 69 69 } 70 70 71 Matrix::~Matrix()71 RealSpaceMatrix::~RealSpaceMatrix() 72 72 { 73 73 // delete all views … … 82 82 } 83 83 84 void Matrix::createViews(){84 void RealSpaceMatrix::createViews(){ 85 85 // create row views 86 86 for(int i=NDIM;i--;){ … … 98 98 } 99 99 100 void Matrix::setIdentity(){100 void RealSpaceMatrix::setIdentity(){ 101 101 content->setIdentity(); 102 102 } 103 103 104 void Matrix::setZero(){104 void RealSpaceMatrix::setZero(){ 105 105 content->setZero(); 106 106 } 107 107 108 void Matrix::setRotation(const double x, const double y, const double z)108 void RealSpaceMatrix::setRotation(const double x, const double y, const double z) 109 109 { 110 110 set(0,0, cos(y)*cos(z)); … … 119 119 } 120 120 121 Matrix &Matrix::operator=(constMatrix &src)121 RealSpaceMatrix &RealSpaceMatrix::operator=(const RealSpaceMatrix &src) 122 122 { 123 123 // MatrixContent checks for self-assignment … … 126 126 } 127 127 128 const Matrix &Matrix::operator+=(constMatrix &rhs)128 const RealSpaceMatrix &RealSpaceMatrix::operator+=(const RealSpaceMatrix &rhs) 129 129 { 130 130 *content += *(rhs.content); … … 132 132 } 133 133 134 const Matrix &Matrix::operator-=(constMatrix &rhs)134 const RealSpaceMatrix &RealSpaceMatrix::operator-=(const RealSpaceMatrix &rhs) 135 135 { 136 136 *content -= *(rhs.content); … … 138 138 } 139 139 140 const Matrix &Matrix::operator*=(constMatrix &rhs)140 const RealSpaceMatrix &RealSpaceMatrix::operator*=(const RealSpaceMatrix &rhs) 141 141 { 142 142 (*content) *= (*rhs.content); … … 144 144 } 145 145 146 const Matrix Matrix::operator+(constMatrix &rhs) const147 { 148 Matrix tmp = *this;146 const RealSpaceMatrix RealSpaceMatrix::operator+(const RealSpaceMatrix &rhs) const 147 { 148 RealSpaceMatrix tmp = *this; 149 149 tmp+=rhs; 150 150 return tmp; 151 151 } 152 152 153 const Matrix Matrix::operator-(constMatrix &rhs) const154 { 155 Matrix tmp = *this;153 const RealSpaceMatrix RealSpaceMatrix::operator-(const RealSpaceMatrix &rhs) const 154 { 155 RealSpaceMatrix tmp = *this; 156 156 tmp-=rhs; 157 157 return tmp; 158 158 } 159 159 160 const Matrix Matrix::operator*(constMatrix &rhs) const161 { 162 Matrix tmp(content);160 const RealSpaceMatrix RealSpaceMatrix::operator*(const RealSpaceMatrix &rhs) const 161 { 162 RealSpaceMatrix tmp(content); 163 163 tmp *= rhs; 164 164 return tmp; 165 165 } 166 166 167 double & Matrix::at(size_t i, size_t j)167 double &RealSpaceMatrix::at(size_t i, size_t j) 168 168 { 169 169 return content->at(i,j); 170 170 } 171 171 172 const double Matrix::at(size_t i, size_t j) const172 const double RealSpaceMatrix::at(size_t i, size_t j) const 173 173 { 174 174 return content->at(i,j); 175 175 } 176 176 177 Vector & Matrix::row(size_t i)177 Vector &RealSpaceMatrix::row(size_t i) 178 178 { 179 179 ASSERT(i>=0&&i<NDIM,"Index i for Matrix access out of range"); … … 181 181 } 182 182 183 const Vector & Matrix::row(size_t i) const183 const Vector &RealSpaceMatrix::row(size_t i) const 184 184 { 185 185 ASSERT(i>=0&&i<NDIM,"Index i for Matrix access out of range"); … … 187 187 } 188 188 189 Vector & Matrix::column(size_t i)189 Vector &RealSpaceMatrix::column(size_t i) 190 190 { 191 191 ASSERT(i>=0&&i<NDIM,"Index i for Matrix access out of range"); … … 193 193 } 194 194 195 const Vector & Matrix::column(size_t i) const195 const Vector &RealSpaceMatrix::column(size_t i) const 196 196 { 197 197 ASSERT(i>=0&&i<NDIM,"Index i for Matrix access out of range"); … … 199 199 } 200 200 201 Vector & Matrix::diagonal()201 Vector &RealSpaceMatrix::diagonal() 202 202 { 203 203 return *diagonal_ptr; 204 204 } 205 205 206 const Vector & Matrix::diagonal() const206 const Vector &RealSpaceMatrix::diagonal() const 207 207 { 208 208 return *diagonal_ptr; 209 209 } 210 210 211 void Matrix::set(size_t i, size_t j, const double value)211 void RealSpaceMatrix::set(size_t i, size_t j, const double value) 212 212 { 213 213 content->set(i,j, value); 214 214 } 215 215 216 double Matrix::determinant() const{216 double RealSpaceMatrix::determinant() const{ 217 217 return at(0,0)*at(1,1)*at(2,2) 218 218 + at(0,1)*at(1,2)*at(2,0) … … 224 224 225 225 226 MatrixMatrix::invert() const{226 RealSpaceMatrix RealSpaceMatrix::invert() const{ 227 227 double det = determinant(); 228 228 if(fabs(det)<MYEPSILON){ … … 231 231 232 232 double detReci = 1./det; 233 Matrix res;233 RealSpaceMatrix res; 234 234 res.set(0,0, detReci*RDET2(at(1,1),at(2,1),at(1,2),at(2,2))); // A_11 235 235 res.set(1,0, -detReci*RDET2(at(1,0),at(2,0),at(1,2),at(2,2))); // A_21 … … 244 244 } 245 245 246 MatrixMatrix::transpose() const246 RealSpaceMatrix RealSpaceMatrix::transpose() const 247 247 { 248 248 std::cout << "const Matrix::transpose()." << std::endl; 249 Matrix res =Matrix(const_cast<const MatrixContent *>(content)->transpose());249 RealSpaceMatrix res = RealSpaceMatrix(const_cast<const MatrixContent *>(content)->transpose()); 250 250 return res; 251 251 } 252 252 253 Matrix &Matrix::transpose()253 RealSpaceMatrix &RealSpaceMatrix::transpose() 254 254 { 255 255 std::cout << "Matrix::transpose()." << std::endl; … … 258 258 } 259 259 260 Vector Matrix::transformToEigenbasis()260 Vector RealSpaceMatrix::transformToEigenbasis() 261 261 { 262 262 gsl_vector *eval = content->transformToEigenbasis(); … … 266 266 } 267 267 268 const Matrix &Matrix::operator*=(const double factor)268 const RealSpaceMatrix &RealSpaceMatrix::operator*=(const double factor) 269 269 { 270 270 *content *= factor; … … 272 272 } 273 273 274 const Matrix operator*(const double factor,constMatrix& mat)275 { 276 Matrix tmp = mat;274 const RealSpaceMatrix operator*(const double factor,const RealSpaceMatrix& mat) 275 { 276 RealSpaceMatrix tmp = mat; 277 277 return tmp *= factor; 278 278 } 279 279 280 const Matrix operator*(constMatrix &mat,const double factor)280 const RealSpaceMatrix operator*(const RealSpaceMatrix &mat,const double factor) 281 281 { 282 282 return factor*mat; 283 283 } 284 284 285 bool Matrix::operator==(constMatrix &rhs) const285 bool RealSpaceMatrix::operator==(const RealSpaceMatrix &rhs) const 286 286 { 287 287 return (*content == *(rhs.content)); … … 292 292 * \return allocated NDIM*NDIM array with the symmetric matrix 293 293 */ 294 Matrix ReturnFullMatrixforSymmetric(const double * const symm)295 { 296 Matrix matrix;294 RealSpaceMatrix ReturnFullMatrixforSymmetric(const double * const symm) 295 { 296 RealSpaceMatrix matrix; 297 297 matrix.set(0,0, symm[0]); 298 298 matrix.set(1,0, symm[1]); … … 307 307 }; 308 308 309 ostream &operator<<(ostream &ost,const Matrix &mat)309 ostream &operator<<(ostream &ost,const RealSpaceMatrix &mat) 310 310 { 311 311 for(int i = 0;i<NDIM;++i){ … … 320 320 } 321 321 322 Vector operator*(const Matrix &mat,const Vector &vec)322 Vector operator*(const RealSpaceMatrix &mat,const Vector &vec) 323 323 { 324 324 return (*mat.content) * vec; 325 325 } 326 326 327 Vector &operator*=(Vector& lhs,const Matrix &mat)327 Vector &operator*=(Vector& lhs,const RealSpaceMatrix &mat) 328 328 { 329 329 lhs = mat*lhs; -
src/LinearAlgebra/RealSpaceMatrix.hpp
r3bc926 rcca9ef 1 1 /* 2 * Matrix.hpp2 * RealSpaceMatrix.hpp 3 3 * 4 4 * Created on: Jun 25, 2010 … … 6 6 */ 7 7 8 #ifndef MATRIX_HPP_9 #define MATRIX_HPP_8 #ifndef REALSPACEMATRIX_HPP_ 9 #define REALSPACEMATRIX_HPP_ 10 10 11 11 #include <iosfwd> … … 19 19 class MatrixContent; 20 20 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 */ 25 class RealSpaceMatrix 22 26 { 23 friend Vector operator*(const Matrix&,const Vector&);27 friend Vector operator*(const RealSpaceMatrix&,const Vector&); 24 28 public: 25 Matrix();29 RealSpaceMatrix(); 26 30 27 31 /** … … 41 45 * 42 46 */ 43 Matrix(const double*);44 Matrix(constMatrix&);45 Matrix(const MatrixContent&);46 virtual ~ Matrix();47 RealSpaceMatrix(const double*); 48 RealSpaceMatrix(const RealSpaceMatrix&); 49 RealSpaceMatrix(const MatrixContent&); 50 virtual ~RealSpaceMatrix(); 47 51 48 52 /** … … 107 111 * Rather costly, so use precomputation as often as possible. 108 112 */ 109 Matrix invert() const;113 RealSpaceMatrix invert() const; 110 114 111 115 /** … … 120 124 * Calculate the transpose of the matrix. 121 125 */ 122 Matrix transpose() const;123 Matrix &transpose();126 RealSpaceMatrix transpose() const; 127 RealSpaceMatrix &transpose(); 124 128 125 129 // operators 126 Matrix &operator=(constMatrix&);130 RealSpaceMatrix &operator=(const RealSpaceMatrix&); 127 131 128 const Matrix &operator+=(constMatrix&);129 const Matrix &operator-=(constMatrix&);130 const Matrix &operator*=(constMatrix&);132 const RealSpaceMatrix &operator+=(const RealSpaceMatrix&); 133 const RealSpaceMatrix &operator-=(const RealSpaceMatrix&); 134 const RealSpaceMatrix &operator*=(const RealSpaceMatrix&); 131 135 132 const Matrix &operator*=(const double);136 const RealSpaceMatrix &operator*=(const double); 133 137 134 const Matrix operator+(constMatrix&) const;135 const Matrix operator-(constMatrix&) const;136 const Matrix operator*(constMatrix&) const;138 const RealSpaceMatrix operator+(const RealSpaceMatrix&) const; 139 const RealSpaceMatrix operator-(const RealSpaceMatrix&) const; 140 const RealSpaceMatrix operator*(const RealSpaceMatrix&) const; 137 141 138 bool operator==(const Matrix&) const;142 bool operator==(const RealSpaceMatrix&) const; 139 143 140 144 private: 141 Matrix(MatrixContent*);145 RealSpaceMatrix(MatrixContent*); 142 146 void createViews(); 143 147 MatrixContent *content; … … 148 152 }; 149 153 150 const Matrix operator*(const double,constMatrix&);151 const Matrix operator*(constMatrix&,const double);154 const RealSpaceMatrix operator*(const double,const RealSpaceMatrix&); 155 const RealSpaceMatrix operator*(const RealSpaceMatrix&,const double); 152 156 153 157 /** … … 165 169 * 5 -> (2,2) 166 170 */ 167 Matrix ReturnFullMatrixforSymmetric(const double * const cell_size);171 RealSpaceMatrix ReturnFullMatrixforSymmetric(const double * const cell_size); 168 172 169 std::ostream &operator<<(std::ostream&,const Matrix&);170 Vector operator*(const Matrix&,const Vector&);171 Vector& operator*=(Vector&,const Matrix&);173 std::ostream &operator<<(std::ostream&,const RealSpaceMatrix&); 174 Vector operator*(const RealSpaceMatrix&,const Vector&); 175 Vector& operator*=(Vector&,const RealSpaceMatrix&); 172 176 173 #endif /* MATRIX_HPP_ */177 #endif /* REALSPACEMATRIX_HPP_ */ -
src/LinearAlgebra/Vector.hpp
r3bc926 rcca9ef 22 22 23 23 class Vector; 24 class Matrix;24 class RealSpaceMatrix; 25 25 class MatrixContent; 26 26 struct VectorContent; … … 33 33 class Vector : public Space{ 34 34 friend Vector operator*(const MatrixContent&,const Vector&); 35 friend class Matrix;35 friend class RealSpaceMatrix; 36 36 public: 37 37 Vector(); -
src/Parser/PcpParser.cpp
r3bc926 rcca9ef 31 31 #include "Helpers/Log.hpp" 32 32 #include "Helpers/Verbose.hpp" 33 #include "LinearAlgebra/ Matrix.hpp"33 #include "LinearAlgebra/RealSpaceMatrix.hpp" 34 34 #include "molecule.hpp" 35 35 #include "PcpParser.hpp" … … 375 375 DoLog(0) && (Log() << Verbose(0) << "Saving changes to pcp." << std::endl); 376 376 377 const Matrix &domain = World::getInstance().getDomain().getM();377 const RealSpaceMatrix &domain = World::getInstance().getDomain().getM(); 378 378 class ThermoStatContainer *Thermostats = World::getInstance().getThermostats(); 379 379 if (!file->fail()) { -
src/Shapes/ShapeOps.cpp
r3bc926 rcca9ef 233 233 /************************* transform *****************/ 234 234 235 Transform_impl::Transform_impl(const Shape::impl_ptr &_arg, const Matrix &_transformation) :235 Transform_impl::Transform_impl(const Shape::impl_ptr &_arg, const RealSpaceMatrix &_transformation) : 236 236 ShapeOpsBase_impl(_arg),transformation(_transformation) 237 237 { … … 254 254 255 255 Vector Transform_impl::translateOutNormal(const Vector& point){ 256 Matrix mat = transformation.invert().transpose();256 RealSpaceMatrix mat = transformation.invert().transpose(); 257 257 return mat * point; 258 258 } … … 272 272 } 273 273 274 Shape transform(const Shape &arg, const Matrix &transformation){274 Shape transform(const Shape &arg, const RealSpaceMatrix &transformation){ 275 275 Shape::impl_ptr impl = Shape::impl_ptr(new Transform_impl(getShapeImpl(arg),transformation)); 276 276 return Shape(impl); -
src/Shapes/ShapeOps.hpp
r3bc926 rcca9ef 11 11 #include "Shapes/Shape.hpp" 12 12 13 class Matrix;13 class RealSpaceMatrix; 14 14 15 15 Shape resize(const Shape&,double); 16 16 Shape translate(const Shape&, const Vector&); 17 17 Shape stretch(const Shape&, const Vector&); 18 Shape transform(const Shape&,const Matrix&);18 Shape transform(const Shape&,const RealSpaceMatrix&); 19 19 20 20 #endif /* SHAPEOPS_HPP_ */ -
src/Shapes/ShapeOps_impl.hpp
r3bc926 rcca9ef 11 11 #include "Shapes/Shape_impl.hpp" 12 12 #include "LinearAlgebra/Vector.hpp" 13 #include "LinearAlgebra/ Matrix.hpp"13 #include "LinearAlgebra/RealSpaceMatrix.hpp" 14 14 15 15 #include <vector> … … 87 87 { 88 88 public: 89 Transform_impl(const Shape::impl_ptr&, const Matrix&);89 Transform_impl(const Shape::impl_ptr&, const RealSpaceMatrix&); 90 90 virtual ~Transform_impl(); 91 91 protected: … … 97 97 virtual std::vector<Vector> getHomogeneousPointsOnSurface(const size_t N) const; 98 98 private: 99 Matrix transformation;100 Matrix transformationInv;99 RealSpaceMatrix transformation; 100 RealSpaceMatrix transformationInv; 101 101 }; 102 102 -
src/UIElements/CommandLineUI/Query/BoxCommandLineQuery.cpp
r3bc926 rcca9ef 25 25 #include "Helpers/Log.hpp" 26 26 #include "Helpers/Verbose.hpp" 27 #include "LinearAlgebra/ Matrix.hpp"27 #include "LinearAlgebra/RealSpaceMatrix.hpp" 28 28 29 29 CommandLineDialog::BoxCommandLineQuery::BoxCommandLineQuery(string title, string _description) : … … 38 38 if (CommandLineParser::getInstance().vm.count(getTitle())) { 39 39 temp = CommandLineParser::getInstance().vm[getTitle()].as< BoxValue >(); 40 Matrix M;40 RealSpaceMatrix M; 41 41 M.set(0,0, temp.xx); 42 42 M.set(0,1, temp.yx); -
src/UIElements/Dialog.cpp
r3bc926 rcca9ef 29 29 class Box; 30 30 class element; 31 class Matrix;31 class RealSpaceMatrix; 32 32 class molecule; 33 33 class Vector; -
src/UIElements/Qt4/Pipe/BoxQtQueryPipe.cpp
r3bc926 rcca9ef 25 25 26 26 #include "Helpers/MemDebug.hpp" 27 #include "LinearAlgebra/ Matrix.hpp"27 #include "LinearAlgebra/RealSpaceMatrix.hpp" 28 28 #include "Box.hpp" 29 29 … … 33 33 inputTable(_inputTable) 34 34 { 35 tmpM = new Matrix();35 tmpM = new RealSpaceMatrix(); 36 36 tmpM->setZero(); 37 37 } -
src/UIElements/Qt4/Pipe/BoxQtQueryPipe.hpp
r3bc926 rcca9ef 15 15 class Box; 16 16 class QtDialog; 17 class Matrix;17 class RealSpaceMatrix; 18 18 19 19 … … 32 32 QTableWidget *inputTable; 33 33 34 Matrix *tmpM;34 RealSpaceMatrix *tmpM; 35 35 }; 36 36 -
src/UIElements/Qt4/Query/BoxQtQuery.cpp
r3bc926 rcca9ef 27 27 #include "UIElements/Qt4/Pipe/BoxQtQueryPipe.hpp" 28 28 29 #include "LinearAlgebra/ Matrix.hpp"29 #include "LinearAlgebra/RealSpaceMatrix.hpp" 30 30 #include "World.hpp" 31 31 … … 47 47 48 48 // fill the box with current matrix 49 const Matrix &domain = World::getInstance().getDomain().getM();49 const RealSpaceMatrix &domain = World::getInstance().getDomain().getM(); 50 50 for (int i=0;i<3;i++) 51 51 for (int j=0;j<3;j++) { -
src/UIElements/TextUI/Query/BoxTextQuery.cpp
r3bc926 rcca9ef 26 26 #include "Helpers/Log.hpp" 27 27 #include "Helpers/Verbose.hpp" 28 #include "LinearAlgebra/ Matrix.hpp"28 #include "LinearAlgebra/RealSpaceMatrix.hpp" 29 29 30 30 … … 46 46 std::cin >> temp[i]; 47 47 } 48 Matrix M;48 RealSpaceMatrix M; 49 49 M.set(0,0, temp[0]); 50 50 M.set(0,1, temp[1]); -
src/UIElements/TextUI/Query/VectorTextQuery.cpp
r3bc926 rcca9ef 27 27 #include "Helpers/Verbose.hpp" 28 28 #include "LinearAlgebra/Vector.hpp" 29 #include "LinearAlgebra/ Matrix.hpp"29 #include "LinearAlgebra/RealSpaceMatrix.hpp" 30 30 #include "World.hpp" 31 31 … … 40 40 bool TextDialog::VectorTextQuery::handle() { 41 41 std::cout << getDescription() << std::endl; 42 const Matrix &M = World::getInstance().getDomain().getM();42 const RealSpaceMatrix &M = World::getInstance().getDomain().getM(); 43 43 char coords[3] = {'x', 'y', 'z'}; 44 44 for (int i=0;i<3;i++) -
src/UIElements/TextUI/Query/VectorsTextQuery.cpp
r3bc926 rcca9ef 27 27 #include "Helpers/Verbose.hpp" 28 28 #include "LinearAlgebra/Vector.hpp" 29 #include "LinearAlgebra/ Matrix.hpp"29 #include "LinearAlgebra/RealSpaceMatrix.hpp" 30 30 #include "World.hpp" 31 31 … … 41 41 std::cout << getDescription() << std::endl; 42 42 char coords[3] = {'x', 'y', 'z'}; 43 const Matrix &M = World::getInstance().getDomain().getM();43 const RealSpaceMatrix &M = World::getInstance().getDomain().getM(); 44 44 for (int i=0;i<3;i++) 45 45 std::cout << coords[i] << "[0.." << M.at(i,i) << ( (i!=2) ? "], " : "]: "); -
src/World.cpp
r3bc926 rcca9ef 38 38 #include "Helpers/Assert.hpp" 39 39 #include "Box.hpp" 40 #include "LinearAlgebra/ Matrix.hpp"40 #include "LinearAlgebra/RealSpaceMatrix.hpp" 41 41 #include "defs.hpp" 42 42 … … 100 100 } 101 101 102 void World::setDomain(const Matrix &mat){102 void World::setDomain(const RealSpaceMatrix &mat){ 103 103 OBSERVE; 104 104 *cell_size = mat; … … 108 108 { 109 109 OBSERVE; 110 Matrix M = ReturnFullMatrixforSymmetric(matrix);110 RealSpaceMatrix M = ReturnFullMatrixforSymmetric(matrix); 111 111 cell_size->setM(M); 112 112 } … … 747 747 { 748 748 cell_size = new Box; 749 Matrix domain;749 RealSpaceMatrix domain; 750 750 domain.at(0,0) = 20; 751 751 domain.at(1,1) = 20; -
src/World.hpp
r3bc926 rcca9ef 41 41 class config; 42 42 class ManipulateAtomsProcess; 43 class Matrix;43 class RealSpaceMatrix; 44 44 class molecule; 45 45 class MoleculeDescriptor; … … 147 147 * Matrix needs to be symmetric 148 148 */ 149 void setDomain(const Matrix &mat);149 void setDomain(const RealSpaceMatrix &mat); 150 150 151 151 /** -
src/analysis_correlation.cpp
r3bc926 rcca9ef 33 33 #include "triangleintersectionlist.hpp" 34 34 #include "LinearAlgebra/Vector.hpp" 35 #include "LinearAlgebra/ Matrix.hpp"35 #include "LinearAlgebra/RealSpaceMatrix.hpp" 36 36 #include "Helpers/Verbose.hpp" 37 37 #include "World.hpp" … … 145 145 outmap = new PairCorrelationMap; 146 146 for (std::vector<molecule *>::const_iterator MolWalker = molecules.begin(); MolWalker != molecules.end(); MolWalker++){ 147 Matrix FullMatrix = World::getInstance().getDomain().getM();148 Matrix FullInverseMatrix = World::getInstance().getDomain().getMinv();147 RealSpaceMatrix FullMatrix = World::getInstance().getDomain().getM(); 148 RealSpaceMatrix FullInverseMatrix = World::getInstance().getDomain().getMinv(); 149 149 DoLog(2) && (Log()<< Verbose(2) << "Current molecule is " << *MolWalker << "." << endl); 150 150 for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) { … … 244 244 outmap = new CorrelationToPointMap; 245 245 for (std::vector<molecule *>::const_iterator MolWalker = molecules.begin(); MolWalker != molecules.end(); MolWalker++) { 246 Matrix FullMatrix = World::getInstance().getDomain().getM();247 Matrix FullInverseMatrix = World::getInstance().getDomain().getMinv();246 RealSpaceMatrix FullMatrix = World::getInstance().getDomain().getM(); 247 RealSpaceMatrix FullInverseMatrix = World::getInstance().getDomain().getMinv(); 248 248 DoLog(2) && (Log() << Verbose(2) << "Current molecule is " << *MolWalker << "." << endl); 249 249 for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) { … … 342 342 BoundaryTriangleSet *ShortestTriangle = NULL; 343 343 for (std::vector<molecule *>::const_iterator MolWalker = molecules.begin(); MolWalker != molecules.end(); MolWalker++) { 344 Matrix FullMatrix = World::getInstance().getDomain().getM();345 Matrix FullInverseMatrix = World::getInstance().getDomain().getMinv();344 RealSpaceMatrix FullMatrix = World::getInstance().getDomain().getM(); 345 RealSpaceMatrix FullInverseMatrix = World::getInstance().getDomain().getMinv(); 346 346 DoLog(2) && (Log() << Verbose(2) << "Current molecule is " << *MolWalker << "." << endl); 347 347 for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) { -
src/atom_atominfo.hpp
r3bc926 rcca9ef 26 26 class AtomInfo; 27 27 class element; 28 class Matrix;28 class RealSpaceMatrix; 29 29 30 30 /********************************************** declarations *******************************/ -
src/boundary.cpp
r3bc926 rcca9ef 40 40 #include "World.hpp" 41 41 #include "LinearAlgebra/Plane.hpp" 42 #include "LinearAlgebra/ Matrix.hpp"42 #include "LinearAlgebra/RealSpaceMatrix.hpp" 43 43 #include "Box.hpp" 44 44 … … 792 792 int N[NDIM]; 793 793 int n[NDIM]; 794 const Matrix &M = World::getInstance().getDomain().getM();795 Matrix Rotations;796 const Matrix &MInverse = World::getInstance().getDomain().getMinv();794 const RealSpaceMatrix &M = World::getInstance().getDomain().getM(); 795 RealSpaceMatrix Rotations; 796 const RealSpaceMatrix &MInverse = World::getInstance().getDomain().getMinv(); 797 797 Vector AtomTranslations; 798 798 Vector FillerTranslations; … … 944 944 int N[NDIM]; 945 945 int n[NDIM]; 946 const Matrix &M = World::getInstance().getDomain().getM();947 Matrix Rotations;948 const Matrix &MInverse = World::getInstance().getDomain().getMinv();946 const RealSpaceMatrix &M = World::getInstance().getDomain().getM(); 947 RealSpaceMatrix Rotations; 948 const RealSpaceMatrix &MInverse = World::getInstance().getDomain().getMinv(); 949 949 Vector AtomTranslations; 950 950 Vector FillerTranslations; -
src/config.cpp
r3bc926 rcca9ef 39 39 #include "ThermoStatContainer.hpp" 40 40 #include "World.hpp" 41 #include "LinearAlgebra/ Matrix.hpp"41 #include "LinearAlgebra/RealSpaceMatrix.hpp" 42 42 #include "Box.hpp" 43 43 … … 637 637 { 638 638 bool result = true; 639 const Matrix &domain = World::getInstance().getDomain().getM();639 const RealSpaceMatrix &domain = World::getInstance().getDomain().getM(); 640 640 ofstream * const output = new ofstream(filename, ios::out); 641 641 if (output != NULL) { -
src/ellipsoid.cpp
r3bc926 rcca9ef 34 34 #include "tesselation.hpp" 35 35 #include "LinearAlgebra/Vector.hpp" 36 #include "LinearAlgebra/ Matrix.hpp"36 #include "LinearAlgebra/RealSpaceMatrix.hpp" 37 37 #include "Helpers/Verbose.hpp" 38 38 … … 48 48 Vector helper, RefPoint; 49 49 double distance = -1.; 50 Matrix Matrix;50 RealSpaceMatrix Matrix; 51 51 double InverseLength[3]; 52 52 double psi,theta,phi; // euler angles in ZX'Z'' convention -
src/molecule.cpp
r3bc926 rcca9ef 43 43 #include "tesselation.hpp" 44 44 #include "LinearAlgebra/Vector.hpp" 45 #include "LinearAlgebra/ Matrix.hpp"45 #include "LinearAlgebra/RealSpaceMatrix.hpp" 46 46 #include "World.hpp" 47 47 #include "Box.hpp" … … 316 316 Vector Orthovector1, Orthovector2; // temporary vectors in coordination construction 317 317 Vector InBondvector; // vector in direction of *Bond 318 const Matrix &matrix = World::getInstance().getDomain().getM();318 const RealSpaceMatrix &matrix = World::getInstance().getDomain().getM(); 319 319 bond *Binder = NULL; 320 320 … … 778 778 void molecule::SetBoxDimension(Vector *dim) 779 779 { 780 Matrix domain;780 RealSpaceMatrix domain; 781 781 for(int i =0; i<NDIM;++i) 782 782 domain.at(i,i) = dim->at(i); … … 862 862 bool molecule::CheckBounds(const Vector *x) const 863 863 { 864 const Matrix &domain = World::getInstance().getDomain().getM();864 const RealSpaceMatrix &domain = World::getInstance().getDomain().getM(); 865 865 bool result = true; 866 866 for (int i=0;i<NDIM;i++) { -
src/molecule_fragmentation.cpp
r3bc926 rcca9ef 34 34 #include "periodentafel.hpp" 35 35 #include "World.hpp" 36 #include "LinearAlgebra/ Matrix.hpp"36 #include "LinearAlgebra/RealSpaceMatrix.hpp" 37 37 #include "Box.hpp" 38 38 #include "stackclass.hpp" … … 1739 1739 atom *Walker = NULL; 1740 1740 atom *OtherWalker = NULL; 1741 Matrix matrix = World::getInstance().getDomain().getM();1741 RealSpaceMatrix matrix = World::getInstance().getDomain().getM(); 1742 1742 enum Shading *ColorList = NULL; 1743 1743 double tmp; -
src/molecule_geometry.cpp
r3bc926 rcca9ef 24 24 #include "Helpers/Verbose.hpp" 25 25 #include "LinearAlgebra/Line.hpp" 26 #include "LinearAlgebra/ Matrix.hpp"26 #include "LinearAlgebra/RealSpaceMatrix.hpp" 27 27 #include "LinearAlgebra/Plane.hpp" 28 28 … … 166 166 { 167 167 Vector *a = new Vector(0.5,0.5,0.5); 168 const Matrix &M = World::getInstance().getDomain().getM();168 const RealSpaceMatrix &M = World::getInstance().getDomain().getM(); 169 169 (*a) *= M; 170 170 return a; … … 287 287 void molecule::DeterminePeriodicCenter(Vector ¢er) 288 288 { 289 const Matrix &matrix = World::getInstance().getDomain().getM();290 const Matrix &inversematrix = World::getInstance().getDomain().getM();289 const RealSpaceMatrix &matrix = World::getInstance().getDomain().getM(); 290 const RealSpaceMatrix &inversematrix = World::getInstance().getDomain().getM(); 291 291 double tmp; 292 292 bool flag; -
src/molecule_graph.cpp
r3bc926 rcca9ef 36 36 #include "Helpers/fast_functions.hpp" 37 37 #include "Helpers/Assert.hpp" 38 #include "LinearAlgebra/ Matrix.hpp"38 #include "LinearAlgebra/RealSpaceMatrix.hpp" 39 39 #include "Box.hpp" 40 40 #include "stackclass.hpp" -
src/moleculelist.cpp
r3bc926 rcca9ef 40 40 #include "tesselation.hpp" 41 41 #include "Helpers/Assert.hpp" 42 #include "LinearAlgebra/ Matrix.hpp"42 #include "LinearAlgebra/RealSpaceMatrix.hpp" 43 43 #include "Box.hpp" 44 44 #include "stackclass.hpp" … … 487 487 int FragmentCounter = 0; 488 488 ofstream output; 489 Matrix cell_size = World::getInstance().getDomain().getM();490 Matrix cell_size_backup = cell_size;489 RealSpaceMatrix cell_size = World::getInstance().getDomain().getM(); 490 RealSpaceMatrix cell_size_backup = cell_size; 491 491 492 492 // store the fragments as config and as xyz … … 629 629 // center at set box dimensions 630 630 mol->CenterEdge(¢er); 631 Matrix domain;631 RealSpaceMatrix domain; 632 632 for(int i =0;i<NDIM;++i) 633 633 domain.at(i,i) = center[i]; -
src/tesselationhelpers.cpp
r3bc926 rcca9ef 38 38 #include "Helpers/Verbose.hpp" 39 39 #include "LinearAlgebra/Plane.hpp" 40 #include "LinearAlgebra/ Matrix.hpp"40 #include "LinearAlgebra/RealSpaceMatrix.hpp" 41 41 42 42 void GetSphere(Vector * const center, const Vector &a, const Vector &b, const Vector &c, const double RADIUS) 43 43 { 44 44 Info FunctionInfo(__func__); 45 Matrix mat;45 RealSpaceMatrix mat; 46 46 double m11, m12, m13, m14; 47 47 -
src/unittests/BoxUnittest.cpp
r3bc926 rcca9ef 29 29 30 30 #include "LinearAlgebra/Vector.hpp" 31 #include "LinearAlgebra/ Matrix.hpp"31 #include "LinearAlgebra/RealSpaceMatrix.hpp" 32 32 #include "Box.hpp" 33 33 #include "Helpers/Assert.hpp" … … 40 40 void BoxUnittest::setUp(){ 41 41 ASSERT_DO(Assert::Throw); 42 unit = new Matrix;42 unit = new RealSpaceMatrix; 43 43 unit->setIdentity(); 44 zero = new Matrix;45 invertible = new Matrix;44 zero = new RealSpaceMatrix; 45 invertible = new RealSpaceMatrix; 46 46 invertible->diagonal() = Vector(1,2,3); 47 uninvertible = new Matrix;47 uninvertible = new RealSpaceMatrix; 48 48 uninvertible->column(0) = Vector(1,0,1); 49 49 uninvertible->column(2) = Vector(1,0,1); 50 50 51 Matrix boxMat;51 RealSpaceMatrix boxMat; 52 52 unitBox = new Box; 53 53 stretchedBox1 = new Box; -
src/unittests/BoxUnittest.hpp
r3bc926 rcca9ef 11 11 #include <cppunit/extensions/HelperMacros.h> 12 12 13 class Matrix;13 class RealSpaceMatrix; 14 14 class Box; 15 15 … … 38 38 void BoundaryMixedTest(); 39 39 40 Matrix *unit;41 Matrix *zero;42 Matrix *invertible;43 Matrix *uninvertible;40 RealSpaceMatrix *unit; 41 RealSpaceMatrix *zero; 42 RealSpaceMatrix *invertible; 43 RealSpaceMatrix *uninvertible; 44 44 45 45 Box *unitBox; -
src/unittests/MatrixUnittest.cpp
r3bc926 rcca9ef 26 26 #include "MatrixUnittest.hpp" 27 27 #include "LinearAlgebra/Vector.hpp" 28 #include "LinearAlgebra/ Matrix.hpp"28 #include "LinearAlgebra/RealSpaceMatrix.hpp" 29 29 #include "Exceptions/NotInvertibleException.hpp" 30 30 … … 37 37 38 38 void MatrixUnittest::setUp(){ 39 zero = new Matrix();39 zero = new RealSpaceMatrix(); 40 40 for(int i =NDIM;i--;) { 41 41 for(int j =NDIM;j--;) { … … 43 43 } 44 44 } 45 one = new Matrix();45 one = new RealSpaceMatrix(); 46 46 for(int i =NDIM;i--;){ 47 47 one->at(i,i)=1.; 48 48 } 49 full=new Matrix();49 full=new RealSpaceMatrix(); 50 50 for(int i=NDIM;i--;){ 51 51 for(int j=NDIM;j--;){ … … 53 53 } 54 54 } 55 diagonal = new Matrix();55 diagonal = new RealSpaceMatrix(); 56 56 for(int i=NDIM;i--;){ 57 57 diagonal->at(i,i)=i+1.; 58 58 } 59 perm1 = new Matrix();59 perm1 = new RealSpaceMatrix(); 60 60 perm1->column(0) = unitVec[0]; 61 61 perm1->column(1) = unitVec[2]; … … 63 63 64 64 65 perm2 = new Matrix();65 perm2 = new RealSpaceMatrix(); 66 66 perm2->column(0) = unitVec[1]; 67 67 perm2->column(1) = unitVec[0]; 68 68 perm2->column(2) = unitVec[2]; 69 69 70 perm3 = new Matrix();70 perm3 = new RealSpaceMatrix(); 71 71 perm3->column(0) = unitVec[1]; 72 72 perm3->column(1) = unitVec[2]; 73 73 perm3->column(2) = unitVec[0]; 74 74 75 perm4 = new Matrix();75 perm4 = new RealSpaceMatrix(); 76 76 perm4->column(0) = unitVec[2]; 77 77 perm4->column(1) = unitVec[1]; 78 78 perm4->column(2) = unitVec[0]; 79 79 80 perm5 = new Matrix();80 perm5 = new RealSpaceMatrix(); 81 81 perm5->column(0) = unitVec[2]; 82 82 perm5->column(1) = unitVec[0]; … … 97 97 98 98 void MatrixUnittest::AccessTest(){ 99 Matrix mat;99 RealSpaceMatrix mat; 100 100 for(int i=NDIM;i--;){ 101 101 for(int j=NDIM;j--;){ … … 119 119 120 120 void MatrixUnittest::VectorTest(){ 121 Matrix mat;121 RealSpaceMatrix mat; 122 122 for(int i=NDIM;i--;){ 123 123 CPPUNIT_ASSERT_EQUAL(mat.row(i),zeroVec); … … 173 173 174 174 void MatrixUnittest::TransposeTest(){ 175 Matrix res;175 RealSpaceMatrix res; 176 176 177 177 // transpose of unit is unit … … 187 187 188 188 void MatrixUnittest::OperationTest(){ 189 Matrix res;189 RealSpaceMatrix res; 190 190 191 191 res =(*zero) *(*zero); … … 260 260 261 261 void MatrixUnittest::RotationTest(){ 262 Matrix res;263 Matrix inverse;262 RealSpaceMatrix res; 263 RealSpaceMatrix inverse; 264 264 265 265 // zero rotation angles yields unity matrix … … 278 278 // ... or transposed 279 279 res.setRotation(M_PI/3.,0.,0.); 280 CPPUNIT_ASSERT_EQUAL(inverse, ((const Matrix) res).transpose());280 CPPUNIT_ASSERT_EQUAL(inverse, ((const RealSpaceMatrix) res).transpose()); 281 281 } 282 282 … … 285 285 CPPUNIT_ASSERT_THROW(full->invert(),NotInvertibleException); 286 286 287 Matrix res;287 RealSpaceMatrix res; 288 288 res = (*one)*one->invert(); 289 289 CPPUNIT_ASSERT_EQUAL(res,*one); -
src/unittests/MatrixUnittest.hpp
r3bc926 rcca9ef 11 11 #include <cppunit/extensions/HelperMacros.h> 12 12 13 class Matrix;13 class RealSpaceMatrix; 14 14 15 15 class MatrixUnittest : public CppUnit::TestFixture … … 39 39 void VecMultTest(); 40 40 41 Matrix *zero;42 Matrix *one;43 Matrix *full;44 Matrix *diagonal;45 Matrix *perm1;46 Matrix *perm2;47 Matrix *perm3;48 Matrix *perm4;49 Matrix *perm5;41 RealSpaceMatrix *zero; 42 RealSpaceMatrix *one; 43 RealSpaceMatrix *full; 44 RealSpaceMatrix *diagonal; 45 RealSpaceMatrix *perm1; 46 RealSpaceMatrix *perm2; 47 RealSpaceMatrix *perm3; 48 RealSpaceMatrix *perm4; 49 RealSpaceMatrix *perm5; 50 50 }; 51 51 -
src/unittests/vectorunittest.cpp
r3bc926 rcca9ef 31 31 #include "LinearAlgebra/Plane.hpp" 32 32 #include "Exceptions/LinearDependenceException.hpp" 33 #include "LinearAlgebra/ Matrix.hpp"33 #include "LinearAlgebra/RealSpaceMatrix.hpp" 34 34 35 35 #ifdef HAVE_TESTRUNNER
Note:
See TracChangeset
for help on using the changeset viewer.