Changeset fdc567
- Timestamp:
- Oct 10, 2016, 12:34:32 PM (9 years ago)
- Branches:
- Fix_FitPartialCharges
- Children:
- eb40e3
- Parents:
- 213f9d
- Location:
- src/Potentials
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Potentials/PartialNucleiChargeFitter.cpp
r213f9d rfdc567 305 305 } 306 306 307 VectorContent PartialNucleiChargeFitter::calculateResiduum() 308 { 309 // need to reconstruct matrix as it was overwritten by SVD 310 if (PotentialFromCharges == NULL) 311 constructMatrix(); 312 313 // calculate residual vector 314 VectorContent residuum = (*PotentialFromCharges) * (*PartialCharges) - SampledPotential; 315 316 return residuum; 317 } 318 307 319 double PartialNucleiChargeFitter::operator()() 308 320 { … … 327 339 LOG(2, "DEBUG: Norm of right-hand side is " << SampledPotential.Norm()); 328 340 329 // need to reconstruct matrix as it was overwritten by SVD 330 constructMatrix(); 331 332 // calculate residual vector 333 VectorContent residuum = (*PotentialFromCharges) * (*PartialCharges) - SampledPotential; 341 // calculate residuum (force matrix reconstruction) 342 delete PotentialFromCharges; 343 VectorContent residuum = calculateResiduum(); 334 344 335 345 #ifndef NDEBUG -
src/Potentials/PartialNucleiChargeFitter.hpp
r213f9d rfdc567 105 105 charges_t getSolutionAsCharges_t() const; 106 106 107 /** Helper function to construct the discretized Coulomb operator for the 108 * nuclei charges. 109 * 110 */ 107 111 void writeMatrix(); 112 113 /** Setter for solution as charges_t 114 * 115 * \param _charges solution vector x as type charges_t 116 */ 117 void setCharges(const charges_t &_charges) const; 118 119 /** Calculates the residuum for the currently set charges. 120 * 121 * \return residual for every charge 122 */ 123 VectorContent calculateResiduum(); 108 124 109 125 private:
Note:
See TracChangeset
for help on using the changeset viewer.