Hi Marc,
Welcome, and thanks for posting here.
>From a quick glance, it looks like
for(int loopCol = 0; loopCol < numbCues; loopCol++){
for(int loop = 0; loop < numbCues; loop++) {
weightsNet(1+loopCol, numbCues + 1 + loop)= pattern(loopCol,loop);
^^^^^^^^^^^^^^^^^^^
}
}
is to blame. loop runs from 0 .. numbCues-1, you add numbCues plus one and
are possibly getting more than numbCues+3:
NumericMatrix weightsNet(numbCues+3,numbCues+3);
Hope this helps, Dirk
--
Dirk Eddelbuettel | [email protected] | http://dirk.eddelbuettel.com
_______________________________________________
Rcpp-devel mailing list
[email protected]
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel