Skip to content

Commit

Permalink
fixed compilation error with double type (#17)
Browse files Browse the repository at this point in the history
fixed conflicts with SpecialFunctionsPacketMath (#18)
  • Loading branch information
bab2min committed Mar 30, 2021
1 parent e05c851 commit 272de5e
Show file tree
Hide file tree
Showing 8 changed files with 878 additions and 141 deletions.
6 changes: 3 additions & 3 deletions EigenRand/Dists/Discrete.h
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,7 @@ namespace Eigen
fres = ptruncate(padd(pmul(psqrt_tmean, yx), pmean));

auto p1 = pmul(padd(pmul(yx, yx), pset1<PacketType>(1)), pset1<PacketType>(0.9));
auto p2 = pexp(psub(psub(pmul(fres, plog_mean), plgamma(padd(fres, pset1<PacketType>(1)))), pg1));
auto p2 = pexp(psub(psub(pmul(fres, plog_mean), plgamma_approx(padd(fres, pset1<PacketType>(1)))), pg1));

auto c1 = pcmple(pset1<PacketType>(0), fres);
auto c2 = pcmple(ur.template packetOp<PacketType>(rng), pmul(p1, p2));
Expand Down Expand Up @@ -964,8 +964,8 @@ namespace Eigen
auto p1 = pmul(pmul(pset1<PacketType>(1.2), psqrt_v), padd(pset1<PacketType>(1), pmul(ys, ys)));
auto p2 = pexp(
padd(padd(psub(
psub(pg1, plgamma(padd(fres, pset1<PacketType>(1)))),
plgamma(psub(padd(ptrials, pset1<PacketType>(1)), fres))
psub(pg1, plgamma_approx(padd(fres, pset1<PacketType>(1)))),
plgamma_approx(psub(padd(ptrials, pset1<PacketType>(1)), fres))
), pmul(fres, plog_small_p)), pmul(psub(ptrials, fres), plog_small_q))
);

Expand Down
4 changes: 2 additions & 2 deletions EigenRand/Dists/GammaPoisson.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ namespace Eigen
const PacketType ppi = pset1<PacketType>(constant::pi),
psqrt_tmean = psqrt(pmul(pset1<PacketType>(2), mean)),
plog_mean = plog(mean),
pg1 = psub(pmul(mean, plog_mean), plgamma(padd(mean, pset1<PacketType>(1))));
pg1 = psub(pmul(mean, plog_mean), plgamma_approx(padd(mean, pset1<PacketType>(1))));
while (1)
{
PacketType fres, yx, psin, pcos;
Expand All @@ -90,7 +90,7 @@ namespace Eigen
fres = ptruncate(padd(pmul(psqrt_tmean, yx), mean));

auto p1 = pmul(padd(pmul(yx, yx), pset1<PacketType>(1)), pset1<PacketType>(0.9));
auto p2 = pexp(psub(psub(pmul(fres, plog_mean), plgamma(padd(fres, pset1<PacketType>(1)))), pg1));
auto p2 = pexp(psub(psub(pmul(fres, plog_mean), plgamma_approx(padd(fres, pset1<PacketType>(1)))), pg1));

auto c1 = pcmple(pset1<PacketType>(0), fres);
auto c2 = pcmple(ur.template packetOp<PacketType>(rng), pmul(p1, p2));
Expand Down
3 changes: 1 addition & 2 deletions EigenRand/Dists/NormalExp.h
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,7 @@ namespace Eigen
psub(pexp(pmul(plog(u1), pset1<Packet>(-2 / n))), pset1<Packet>(1))
));
auto theta = pmul(pset1<Packet>(2 * constant::pi), u2);
Packet sintheta, costheta;

//Packet sintheta, costheta;
//psincos(theta, sintheta, costheta);
return pmul(radius, psin(theta));
}
Expand Down
Loading

0 comments on commit 272de5e

Please sign in to comment.