Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion R/ernm-fit.R
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ ernmFit <- function(sampler,
parinit=theta0,
rinit=1,
rmax=100,
parscale=rep(1,length(theta0)), minimize=FALSE,
parscale=rep(1,length(theta0)),
minimize=FALSE,
sample=sample,
theta0=theta0,
stats=stats))
Expand Down
4 changes: 4 additions & 0 deletions inst/include/Model.h
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,8 @@ class Model : public ShallowCopyable{
void discreteVertexUpdateR(int vertex, std::string varName, int newValue){
if(vertex > net->size())
::Rf_error("vertex index is bigger than the size of the network");
if(vertex < 0)
::Rf_error("vertex index is negative in C++ end - did you enter 0 in R end?");
std::vector<std::string> vars = net->discreteVarNames();
int variable = -1;
for(int i=0;i<vars.size();i++){
Expand All @@ -547,6 +549,8 @@ class Model : public ShallowCopyable{
void continVertexUpdateR(int vertex, std::string varName, int newValue){
if(vertex > net->size())
::Rf_error("vertex index is bigger than the size of the network");
if(vertex < 0)
::Rf_error("vertex index is negative in C++ end - did you enter 0 in R end?");
std::vector<std::string> vars = net->continVarNames();
int variable = -1;
for(int i=0;i<vars.size();i++){
Expand Down
Loading