Skip to content

Commit

Permalink
Fix iCov
Browse files Browse the repository at this point in the history
  • Loading branch information
mattfidler committed Nov 30, 2023
1 parent dbb5391 commit da69c43
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/rxData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2708,6 +2708,7 @@ struct rxSolve_t {
bool convertInt = false;
bool throttle = false;
int maxItemsPerId = 0;
bool hasICov = false;
};

SEXP rxSolve_(const RObject &obj, const List &rxControl, const Nullable<CharacterVector> &specParams,
Expand Down Expand Up @@ -2835,6 +2836,9 @@ static inline void rxSolve_ev1Update(const RObject &obj,
int nobs = asInt(etE["nobs"], "nobs");
if (nobs == 0){
// KEEP/DROP?
if (rxSolveDat->hasICov) {
Rf_warning(R_NilValue, "iCov ignored when there are no samples/observations in the input dataset");
}
List ev1a = etTrans(as<List>(ev1), obj, rxSolveDat->hasCmt,
false, false, true, R_NilValue,
rxControl[Rxc_keepF],
Expand Down Expand Up @@ -4675,6 +4679,8 @@ SEXP rxSolve_(const RObject &obj, const List &rxControl,
rxSolve_t rxSolveDat0;
rxSolve_t* rxSolveDat = &rxSolveDat0;
RObject object;
rxSolveDat->hasICov = Rf_isNull(rxControl[Rxc_iCov]);

rxSolveDat->updateObject = asBool(rxControl[Rxc_updateObject], "updateObject");
rxSolveDat->isRxSolve = rxIs(obj, "rxSolve");
rxSolveDat->isEnvironment = rxIs(obj, "environment");
Expand Down

0 comments on commit da69c43

Please sign in to comment.