TBTK
DualIndex.h
Go to the documentation of this file.
1 /* Copyright 2017 Kristofer Bj√∂rnson
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
23 #ifndef COM_DAFER45_TBTK_DUAL_INDEX
24 #define COM_DAFER45_TBTK_DUAL_INDEX
25 
26 #include "TBTK/Index.h"
27 #include "TBTK/TBTKMacros.h"
28 
29 #include <vector>
30 
31 namespace TBTK{
32 
33 class DualIndex : public Index, public std::vector<double>{
34 public:
36  DualIndex(
37  const Index &index,
38  const std::vector<double> &continuousIndex
39  );
40 
42  ~DualIndex();
43 
45 // const std::vector<double>& getContinuousIndex() const;
46 private:
47 // const std::vector<double> continuousIndex;
48 };
49 
51  const Index &index,
52  const std::vector<double> &continuousIndex
53 ) :
54  Index(index),
55 // continuousIndex(continuousIndex)
56  std::vector<double>(continuousIndex)
57 {
58  TBTKAssert(
59  index.getSize() == continuousIndex.size(),
60  "DualIndex::DualIndex()",
61  "Incompatible index sizes.",
62  "'index' and 'continuousIndex' must have the same number of"
63  << " components."
64  );
65 }
66 
68 }
69 
70 /*inline const std::vector<double>& DualIndex::getContinuousIndex() const{
71  return continuousIndex;
72 }*/
73 
74 }; //End of namespace TBTK
75 
76 #endif
Flexible physical index.
Precompiler macros.
Definition: DualIndex.h:33
Flexible physical index.
Definition: Index.h:70
Definition: ModelFactory.h:35
unsigned int getSize() const
Definition: Index.h:342
~DualIndex()
Definition: DualIndex.h:67
DualIndex(const Index &index, const std::vector< double > &continuousIndex)
Definition: DualIndex.h:50