Skip to content

Commit

Permalink
v3.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
msuchard committed Apr 14, 2023
1 parent d88c531 commit c7710e1
Show file tree
Hide file tree
Showing 11 changed files with 47 additions and 17 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,5 @@ deprecated
.covrignore
src/Makevars$
src/Makevars.win$
to_fix*
^CRAN-SUBMISSION$
3 changes: 3 additions & 0 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Version: 3.3.1
Date: 2023-04-09 20:06:33 UTC
SHA: d88c531efa06933c1007cb785343f1382c95ee0d
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: Cyclops
Type: Package
Title: Cyclic Coordinate Descent for Logistic, Poisson and Survival Analysis
Version: 3.3.0
Version: 3.3.1
Authors@R: c(
person("Marc A.", "Suchard", email = "msuchard@ucla.edu", role = c("aut","cre")),
person("Martijn J.", "Schuemie", role = "aut"),
Expand Down Expand Up @@ -51,4 +51,4 @@ Suggests:
ggplot2,
microbenchmark,
cmprsk
RoxygenNote: 7.1.1
RoxygenNote: 7.2.3
9 changes: 9 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
Cyclops v3.3.1
==============

Changes:

1. fix uninitialized value in detected in computeAsymptoticPrecisionMatrix(); value was priorType
2. fix memory leak caused by call to ::Rf_error()
3. fix line-endings on Makevar on windows

Cyclops v3.3.0
==============

Expand Down
17 changes: 13 additions & 4 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
## Initial submission of patch update to package
## Resubmission after VALGRIND feedback from Brian Ripley

* fixed all WARNINGS, including generic-inconsistency, uninitialized values
* fixed NOTE about C++11
* fixed VALGRIND uninitialized value (UB) issue; variable 'priorType' was uninitialized,
specifically in:

==2293460== Conditional jump or move depends on uninitialised value(s)
==2293460== at 0x22CE4848: bsccs::CyclicCoordinateDescent::computeAsymptoticPrecisionMatrix() (packages/tests-vg/Cyclops/src/cyclops/CyclicCoordinateDescent.cpp:1335)

* fixed VALGRIND memory leak issue; was caused by calls to '::Rf_error()' instead of
'Rcpp::stop()' when handling some error edge-cases

## Test environments
* local OS X install, R 4.1
* r-devel-valgrind docker container
* ubuntu 20.04 (via gh-actions: devel and release)
* win-builder (devel and release)

## R CMD check results
* There were no ERRORs or WARNINGs
* There is 1 occasional NOTE:
* There is 1 occasional NOTE (besides days since last submission):
checking installed package size ... NOTE
installed size is 22.5Mb
sub-directories of 1Mb or more:
Expand All @@ -23,4 +30,6 @@ availability of C++17 'if (constexpr ...)' should decrease library size substant

## Downstream dependencies
* 'EvidenceSynthesis' - checked and works.
* 'EmpiricalCalibration' - checked and works.
* 'IterativeHardThresholding' - checked and works.
* 'BrokenAdaptiveRidge' - checked and works.
6 changes: 3 additions & 3 deletions man/convertToCyclopsData.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/RcppCyclopsInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -622,8 +622,8 @@ void RcppCcdInterface::appendRList(Rcpp::List& list, const Rcpp::List& append) {
}

void RcppCcdInterface::handleError(const std::string& str) {
// Rcpp::stop(str); // TODO Want this to work
::Rf_error(str.c_str());
Rcpp::stop(str);
// ::Rf_error(str.c_str());
}

bsccs::ConvergenceType RcppCcdInterface::parseConvergenceType(const std::string& convergenceName) {
Expand Down Expand Up @@ -946,7 +946,7 @@ void RcppCcdInterface::initializeModelImpl(
// }
// singlePrior->setVariance(0, arguments.hyperprior);

JointPriorPtr prior;
JointPriorPtr prior = nullptr;
// if (arguments.flatPrior.size() == 0) {
// prior = bsccs::make_shared<FullyExchangeableJointPrior>(singlePrior);
// } else {
Expand Down
2 changes: 1 addition & 1 deletion src/RcppModelData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ List cyclopsReadFileData(const std::string& fileName, const std::string& modelTy

//const std::vector<double>& y = ptr->getYVectorRef();
double total = 0.0; //std::accumulate(y.begin(), y.end(), 0.0);
// delete reader; // TODO Test
delete reader; // TODO Use smart_ptr

double time = timer();
List list = List::create(
Expand Down
4 changes: 4 additions & 0 deletions src/cyclops/CyclicCoordinateDescent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ CyclicCoordinateDescent::CyclicCoordinateDescent(
noiseLevel = NOISY;
initialBound = 2.0;

priorType = priors::NONE;

init(hXI.getHasOffsetCovariate());
}

Expand Down Expand Up @@ -89,6 +91,8 @@ CyclicCoordinateDescent::CyclicCoordinateDescent(const CyclicCoordinateDescent&
noiseLevel = copy.noiseLevel;
initialBound = copy.initialBound;

priorType = copy.priorType;

init(hXI.getHasOffsetCovariate());

if (copy.hWeights.size() > 0) {
Expand Down
4 changes: 2 additions & 2 deletions src/cyclops/engine/ModelSpecifics.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1124,7 +1124,7 @@ void ModelSpecifics<BaseModel,RealType>::computeGradientAndHessianImpl(int index
// gradient = result.real();
// hessian = result.imag();

using RealTypePair = std::pair<RealType, RealType>;
// using RealTypePair = std::pair<RealType, RealType>;

IteratorType it(hX, index);
const int end = it.size() - 1;
Expand Down Expand Up @@ -1266,7 +1266,7 @@ void ModelSpecifics<BaseModel,RealType>::computeThirdDerivativeImpl(int index, d
#endif

RealType third = static_cast<RealType>(0);
RealType hessian = static_cast<RealType>(0);
// RealType hessian = static_cast<RealType>(0);

if (BaseModel::cumulativeGradientAndHessian) { // Compile-time switch

Expand Down
7 changes: 5 additions & 2 deletions tools/configure.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,8 @@ if (getRversion() < "4.1") {
}
}

cat(txt, file = makevars_out, sep = "\n")
cat(txt_win, file = makevars_win_out, sep = "\n")
if (.Platform$OS.type == "unix") {
cat(txt, file = makevars_out, sep = "\n")
} else {
cat(txt_win, file = makevars_win_out, sep = "\n")
}

0 comments on commit c7710e1

Please sign in to comment.