Skip to content

Commit

Permalink
modify MT functions
Browse files Browse the repository at this point in the history
  • Loading branch information
atrayees authored Jul 19, 2024
1 parent 7a0be2d commit 5344df8
Showing 1 changed file with 30 additions and 6 deletions.
36 changes: 30 additions & 6 deletions include/sampling/sample_correlation_matrices.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,27 @@ template
typename WalkTypePolicy,
typename PointType,
typename RNGType,
typename PointList
typename MT
>
void uniform_correlation_sampling_MT( const unsigned int &n,
PointList &randPoints,
std::list<MT> &randCorMatrices,
const unsigned int &walkL,
const unsigned int &num_points,
unsigned int const& nburns){
using PointList = std::vector<PointType>;
PointList randPoints;

CorrelationSpectrahedron_MT<PointType> P(n);
const unsigned int d = P.dimension();
PointType startingPoint(n);
RNGType rng(d);

uniform_sampling<WalkTypePolicy>(randPoints, P, rng, walkL, num_points, startingPoint, nburns);

for(const auto&p : randPoints){
MT final_cor_mat = p.mat + p.mat.transpose() - MT::Identity(n, n);
randCorMatrices.push_back(final_cor_mat);
}
}

template
Expand Down Expand Up @@ -83,21 +91,29 @@ template
typename WalkTypePolicy,
typename PointType,
typename RNGType,
typename PointList,
typename MT,
typename NT
>
void gaussian_correlation_sampling_MT( const unsigned int &n,
PointList &randPoints,
std::list<MT> &randCorMatrices,
const unsigned int &walkL,
const unsigned int &num_points,
const NT &a,
unsigned int const& nburns = 0){
using PointList = std::vector<PointType>;
PointList randPoints;

CorrelationSpectrahedron_MT<PointType> P(n);
const unsigned int d = P.dimension();
PointType startingPoint(n);
RNGType rng(d);

gaussian_sampling<WalkTypePolicy>(randPoints, P, rng, walkL, num_points, a, startingPoint, nburns);

for(const auto&p : randPoints){
MT final_cor_mat = p.mat + p.mat.transpose() - MT::Identity(n, n);
randCorMatrices.push_back(final_cor_mat);
}
}

template
Expand Down Expand Up @@ -130,24 +146,32 @@ template
typename WalkTypePolicy,
typename PointType,
typename RNGType,
typename PointList,
typename MT,
typename NT,
typename VT
>
void exponential_correlation_sampling_MT( const unsigned int &n,
PointList &randPoints,
std::list<MT> &randCorMatrices,
const unsigned int &walkL,
const unsigned int &num_points,
const VT &c,
const NT &T,
unsigned int const& nburns = 0){
using PointList = std::vector<PointType>;
PointList randPoints;

CorrelationSpectrahedron_MT<PointType> P(n);
const unsigned int d = P.dimension();
PointType startingPoint(n);
RNGType rng(d);
PointType _c(c);

exponential_sampling<WalkTypePolicy>(randPoints, P, rng, walkL, num_points, _c, T, startingPoint, nburns);

for(const auto&p : randPoints){
MT final_cor_mat = p.mat + p.mat.transpose() - MT::Identity(n, n);
randCorMatrices.push_back(final_cor_mat);
}
}

#endif //VOLESTI_SAMPLING_SAMPLE_CORRELATION_MATRICES_HPP

0 comments on commit 5344df8

Please sign in to comment.