Skip to content

Commit

Permalink
drop transform_reduce for now
Browse files Browse the repository at this point in the history
  • Loading branch information
CreRecombinase committed Jun 11, 2020
1 parent 7fb418c commit cdfdecb
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
36 changes: 18 additions & 18 deletions FGEM.Rproj
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
Version: 1.0
RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default
EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8
RnwWeave: Sweave
LaTeX: pdfLaTeX
BuildType: Package
PackageUseDevtools: Yes
PackageInstallArgs: --no-multiarch --with-keep.source
PackageRoxygenize: rd,collate,namespace
Version: 1.0

RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default

EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8

RnwWeave: Sweave
LaTeX: pdfLaTeX

BuildType: Package
PackageUseDevtools: Yes
PackageInstallArgs: --no-multiarch --with-keep.source
PackageRoxygenize: rd,collate,namespace
2 changes: 1 addition & 1 deletion inst/include/fgem.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ inline T log_FGEM_log_lik_l2(const Eigen::Array<T,Eigen::Dynamic,1> &Beta, cons
T init = - 0.5 * (Beta.array().tail(p-1).square()*prec).sum();
Eigen::Array<T,Eigen::Dynamic,1> xb = (X*(Beta.tail(p-1).matrix())).array()+Beta[0];
#if have_transform_reduce
return neg*std::transform_reduce(xb.data(),xb.data()+xb.size(),log_BF.data(),init,std::plus<>(),
return neg*std::inner_product(xb.data(),xb.data()+xb.size(),log_BF.data(),init,std::plus<>(),
[](T a, double b) -> T{
return logsum(-a,b)+stan::math::log_inv_logit(a);
});
Expand Down

0 comments on commit cdfdecb

Please sign in to comment.