Skip to content

Commit

Permalink
Merge pull request #19 from bab2min/dev_double
Browse files Browse the repository at this point in the history
fixed compilation error with double type (#17)
  • Loading branch information
bab2min authored Mar 30, 2021
2 parents e05c851 + da7a7ba commit a2c8f9b
Show file tree
Hide file tree
Showing 16 changed files with 918 additions and 181 deletions.
6 changes: 3 additions & 3 deletions EigenRand/Core.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
* @file Core.h
* @author bab2min ([email protected])
* @brief
* @version 0.3.0
* @date 2020-10-07
* @version 0.3.3
* @date 2021-03-31
*
* @copyright Copyright (c) 2020
* @copyright Copyright (c) 2020-2021
*
*/

Expand Down
6 changes: 3 additions & 3 deletions EigenRand/Dists/Basic.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
* @file Basic.h
* @author bab2min ([email protected])
* @brief
* @version 0.3.0
* @date 2020-10-07
* @version 0.3.3
* @date 2021-03-31
*
* @copyright Copyright (c) 2020
* @copyright Copyright (c) 2020-2021
*
*/

Expand Down
12 changes: 6 additions & 6 deletions EigenRand/Dists/Discrete.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
* @file Discrete.h
* @author bab2min ([email protected])
* @brief
* @version 0.3.0
* @date 2020-10-07
* @version 0.3.3
* @date 2021-03-31
*
* @copyright Copyright (c) 2020
* @copyright Copyright (c) 2020-2021
*
*/

Expand Down 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
10 changes: 5 additions & 5 deletions EigenRand/Dists/GammaPoisson.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
* @file GammaPoisson.h
* @author bab2min ([email protected])
* @brief
* @version 0.3.0
* @date 2020-10-07
* @version 0.3.3
* @date 2021-03-31
*
* @copyright Copyright (c) 2020
* @copyright Copyright (c) 2020-2021
*
*/

Expand Down 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
9 changes: 4 additions & 5 deletions EigenRand/Dists/NormalExp.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
* @file NormalExp.h
* @author bab2min ([email protected])
* @brief
* @version 0.3.0
* @date 2020-10-07
* @version 0.3.3
* @date 2021-03-31
*
* @copyright Copyright (c) 2020
* @copyright Copyright (c) 2020-2021
*
*/

Expand Down 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
6 changes: 3 additions & 3 deletions EigenRand/EigenRand
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
* @file EigenRand
* @author bab2min ([email protected])
* @brief
* @version 0.3.0
* @date 2020-10-07
* @version 0.3.3
* @date 2021-03-31
*
* @copyright Copyright (c) 2020
* @copyright Copyright (c) 2020-2021
*
*/

Expand Down
8 changes: 4 additions & 4 deletions EigenRand/Macro.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
* @file Macro.h
* @author bab2min ([email protected])
* @brief
* @version 0.3.0
* @date 2020-10-07
* @version 0.3.3
* @date 2021-03-31
*
* @copyright Copyright (c) 2020
* @copyright Copyright (c) 2020-2021
*
*/

Expand All @@ -14,7 +14,7 @@

#define EIGENRAND_WORLD_VERSION 0
#define EIGENRAND_MAJOR_VERSION 3
#define EIGENRAND_MINOR_VERSION 2
#define EIGENRAND_MINOR_VERSION 3

#if EIGEN_VERSION_AT_LEAST(3,3,7)
#else
Expand Down
Loading

0 comments on commit a2c8f9b

Please sign in to comment.