Skip to content

Commit 5344df8

Browse files
authored
modify MT functions
1 parent 7a0be2d commit 5344df8

File tree

1 file changed

+30
-6
lines changed

1 file changed

+30
-6
lines changed

include/sampling/sample_correlation_matrices.hpp

+30-6
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,27 @@ template
4141
typename WalkTypePolicy,
4242
typename PointType,
4343
typename RNGType,
44-
typename PointList
44+
typename MT
4545
>
4646
void uniform_correlation_sampling_MT( const unsigned int &n,
47-
PointList &randPoints,
47+
std::list<MT> &randCorMatrices,
4848
const unsigned int &walkL,
4949
const unsigned int &num_points,
5050
unsigned int const& nburns){
51+
using PointList = std::vector<PointType>;
52+
PointList randPoints;
53+
5154
CorrelationSpectrahedron_MT<PointType> P(n);
5255
const unsigned int d = P.dimension();
5356
PointType startingPoint(n);
5457
RNGType rng(d);
5558

5659
uniform_sampling<WalkTypePolicy>(randPoints, P, rng, walkL, num_points, startingPoint, nburns);
60+
61+
for(const auto&p : randPoints){
62+
MT final_cor_mat = p.mat + p.mat.transpose() - MT::Identity(n, n);
63+
randCorMatrices.push_back(final_cor_mat);
64+
}
5765
}
5866

5967
template
@@ -83,21 +91,29 @@ template
8391
typename WalkTypePolicy,
8492
typename PointType,
8593
typename RNGType,
86-
typename PointList,
94+
typename MT,
8795
typename NT
8896
>
8997
void gaussian_correlation_sampling_MT( const unsigned int &n,
90-
PointList &randPoints,
98+
std::list<MT> &randCorMatrices,
9199
const unsigned int &walkL,
92100
const unsigned int &num_points,
93101
const NT &a,
94102
unsigned int const& nburns = 0){
103+
using PointList = std::vector<PointType>;
104+
PointList randPoints;
105+
95106
CorrelationSpectrahedron_MT<PointType> P(n);
96107
const unsigned int d = P.dimension();
97108
PointType startingPoint(n);
98109
RNGType rng(d);
99110

100111
gaussian_sampling<WalkTypePolicy>(randPoints, P, rng, walkL, num_points, a, startingPoint, nburns);
112+
113+
for(const auto&p : randPoints){
114+
MT final_cor_mat = p.mat + p.mat.transpose() - MT::Identity(n, n);
115+
randCorMatrices.push_back(final_cor_mat);
116+
}
101117
}
102118

103119
template
@@ -130,24 +146,32 @@ template
130146
typename WalkTypePolicy,
131147
typename PointType,
132148
typename RNGType,
133-
typename PointList,
149+
typename MT,
134150
typename NT,
135151
typename VT
136152
>
137153
void exponential_correlation_sampling_MT( const unsigned int &n,
138-
PointList &randPoints,
154+
std::list<MT> &randCorMatrices,
139155
const unsigned int &walkL,
140156
const unsigned int &num_points,
141157
const VT &c,
142158
const NT &T,
143159
unsigned int const& nburns = 0){
160+
using PointList = std::vector<PointType>;
161+
PointList randPoints;
162+
144163
CorrelationSpectrahedron_MT<PointType> P(n);
145164
const unsigned int d = P.dimension();
146165
PointType startingPoint(n);
147166
RNGType rng(d);
148167
PointType _c(c);
149168

150169
exponential_sampling<WalkTypePolicy>(randPoints, P, rng, walkL, num_points, _c, T, startingPoint, nburns);
170+
171+
for(const auto&p : randPoints){
172+
MT final_cor_mat = p.mat + p.mat.transpose() - MT::Identity(n, n);
173+
randCorMatrices.push_back(final_cor_mat);
174+
}
151175
}
152176

153177
#endif //VOLESTI_SAMPLING_SAMPLE_CORRELATION_MATRICES_HPP

0 commit comments

Comments
 (0)