Debian Codegraph @

src/math/aslProbeTemplates.h

raw
1 /*
2 * Advanced Simulation Library <http://asl.org.il>
3 *
4 * Copyright 2015 Avtech Scientific <http://avtechscientific.com>
5 *
6 *
7 * This file is part of Advanced Simulation Library (ASL).
8 *
9 * ASL is free software: you can redistribute it and/or modify it
10 * under the terms of the GNU Affero General Public License as
11 * published by the Free Software Foundation, version 3 of the License.
12 *
13 * ASL is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Affero General Public License for more details.
17 *
18 * You should have received a copy of the GNU Affero General Public License
19 * along with ASL. If not, see <http://www.gnu.org/licenses/>.
20 *
21 */
22
23
24 #ifndef ASLPROBETEMPLATES_H
25 #define ASLPROBETEMPLATES_H
26
27 #include "aslVectors.h"
28
29 namespace asl {
30
31
32 class ProbeTemplate
33 {
34 public:
35 std::vector<AVec<double> > vectors;
36 ProbeTemplate(int n, AVec<double>* vec);
37
38 inline unsigned int numberOfDimentions() const;
39 };
40
41
42 /// A triangular probe 1D space
43 /**
44 \ingroup Templates
45
46 \image html probeD1Q2.png "1D triangular probe"
47 */
48 extern ProbeTemplate probeD1q2;
49
50
51 /// A triangular probe 2D space
52 /**
53 \ingroup Templates
54
55 \image html probeD2Q3.png "2D triangular probe"
56 */
57 extern ProbeTemplate probeD2q3;
58
59 /// A triangular probe 3D space
60 /**
61 \ingroup Templates
62
63 \image html probeD3Q4.png "3D triangular probe"
64 */
65 extern ProbeTemplate probeD3q4;
66
67
68 /// returns template corresponding to minimal probes \ingroup Templates
69 /** asl::probeD1q2, asl::probeD2q3, asl::probeD3q4
70 */
71 inline const ProbeTemplate* allMinimalProbeTemplate(unsigned int dimNumber);
72
73 // ----------------------------- Implementation -------------------------
74
75 unsigned int ProbeTemplate::numberOfDimentions() const
76 {
77 return vectors[0].getSize();
78 }
79
80 inline const ProbeTemplate* minimalProbeTemplate(unsigned int dimNumber)
81 {
82 static ProbeTemplate* vt[3]={&probeD1q2,&probeD2q3,&probeD3q4};
83 return vt[dimNumber-1];
84 }
85
86 }// asl
87
88 #endif // TEMPL_H_INCLUDED