source: src/Fragmentation/Summation/SetValues/IndexedVectors.hpp@ 346b0c

FitPartialCharges_GlobalError PartialCharges_OrthogonalSummation
Last change on this file since 346b0c was 346b0c, checked in by Frederik Heber <heber@…>, 8 years ago

Extracted IndexedValue from IndexedVectors.

  • we may now sum up indexed values of arbitrary type, i.e. an arbitrary class that fulfills a certain interface, and each instance connected to a specific index (within index sets).
  • added detail::force where std::vector<double> is specialized for three components.
  • IndexedVectors is now a specialization of IndexedValue for detail::force.
  • adapated usage signatures in AnalyseFragmentationResultsAction, InterfaceVMGJob, and MPQCCommandJob.
  • slight changes in IndexedVectorsUnitTest because boost::assign is no longer used for detail::force.
  • Property mode set to 100644
File size: 1.2 KB
RevLine 
[7d92f1]1/*
2 * IndexedVectors.hpp
3 *
[346b0c]4 * Created on: Jun 12, 2016
[7d92f1]5 * Author: heber
6 */
7
[346b0c]8
[7d92f1]9#ifndef INDEXEDVECTORS_HPP_
10#define INDEXEDVECTORS_HPP_
11
12// include config.h
13#ifdef HAVE_CONFIG_H
14#include <config.h>
15#endif
16
[346b0c]17#include "Fragmentation/Summation/SetValues/detail.hpp"
18#include "Fragmentation/Summation/SetValues/IndexedValue.hpp"
19#include "Fragmentation/Summation/ZeroInstance.hpp"
[7d92f1]20
[346b0c]21/** This struct is basically just a typedef for an IndexedValue with
22 * detail::force as the code was refactored into this more general state
23 * from the original IndexedVectors class.
[7d92f1]24 *
[346b0c]25 * Also, we need to implement the ZeroInstance here, as nested template
26 * declarations a la ZeroInstance< IndexedValue<detail::force> > are
27 * ambiguous with ZeroInstance< detail::force >.
[7d92f1]28 */
[346b0c]29class IndexedVectors : public IndexedValue<detail::force>
[7d92f1]30{
31public:
[346b0c]32 IndexedVectors(
33 const typename IndexedValue<detail::force>::indices_t &_indices,
34 const typename IndexedValue<detail::force>::values_t &_vectors) :
35 IndexedValue<detail::force>(_indices, _vectors)
36 {}
37
38 IndexedVectors()
39 {}
[7d92f1]40};
41
[beb16e]42template<typename T> T ZeroInstance();
[346b0c]43template<> IndexedVectors ZeroInstance< IndexedVectors >();
44template<> detail::force ZeroInstance< detail::force >();
[7d92f1]45
46#endif /* INDEXEDVECTORS_HPP_ */
Note: See TracBrowser for help on using the repository browser.