Changeset 4b94bb
- Timestamp:
- Jul 1, 2010, 2:48:50 PM (15 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:
- 456341
- Parents:
- c550dd
- Location:
- src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Matrix.cpp
rc550dd r4b94bb 11 11 #include "Helpers/fast_functions.hpp" 12 12 #include "Helpers/Assert.hpp" 13 #include "vector.hpp" 13 14 14 15 #include <gsl/gsl_blas.h> … … 192 193 return ost; 193 194 } 195 196 Vector operator*(const Matrix &mat,const Vector &vec){ 197 gsl_vector *res = gsl_vector_calloc(NDIM); 198 gsl_blas_dgemv( CblasNoTrans, 1.0, mat.content, vec.content, 0.0, res); 199 return Vector(res); 200 } 201 202 Vector &operator*=(Vector& lhs,const Matrix &mat){ 203 lhs = mat*lhs; 204 return lhs; 205 } 206 -
src/Matrix.hpp
rc550dd r4b94bb 59 59 60 60 std::ostream &operator<<(std::ostream&,const Matrix&); 61 Vector operator*(const Matrix&,const Vector&); 62 Vector& operator*=(Vector&,const Matrix&); 61 63 62 64 #endif /* MATRIX_HPP_ */ -
src/vector.cpp
rc550dd r4b94bb 8 8 9 9 #include "vector.hpp" 10 #include "Matrix.hpp"11 10 #include "verbose.hpp" 12 11 #include "World.hpp" … … 361 360 return x; 362 361 }; 363 364 Vector &Vector::operator*=(const Matrix &mat){365 (*this) = mat*(*this);366 return *this;367 }368 369 Vector operator*(const Matrix &mat,const Vector &vec){370 gsl_vector *res = gsl_vector_calloc(NDIM);371 gsl_blas_dgemv( CblasNoTrans, 1.0, mat.content, vec.content, 0.0, res);372 return Vector(res);373 }374 375 362 376 363 /** Factors given vector \a a times \a m. -
src/vector.hpp
rc550dd r4b94bb 90 90 Vector const operator+(const Vector& b) const; 91 91 Vector const operator-(const Vector& b) const; 92 Vector& operator*=(const Matrix&);93 92 94 93 // Methods inherited from Space … … 114 113 Vector const operator*(const Vector& a, const double m); 115 114 Vector const operator*(const double m, const Vector& a); 116 Vector operator*(const Matrix&,const Vector&);117 118 115 119 116 #endif /*VECTOR_HPP_*/
Note:
See TracChangeset
for help on using the changeset viewer.