Here it is the archive.<br><div class="gmail_quote"><br>I'm trying to give you all the details...<br><br>I have an header where I declare:<br><br>#ifndef PORTFOLIOPERFORMANCEINPUT_H<br>#define PORTFOLIOPERFORMANCEINPUT_H<br>
<br>#include <vector><br>
#include <string><br>#include <time.h><br>#include <RInside.h><br><br>using namespace Rcpp;<br>using namespace std;<br><br>class PortfolioPerformanceInput<br>{<br>public:<br> PortfolioPerformanceInput();<br>
virtual ~PortfolioPerformanceInput();<br><br> vector<string> libraries;<div class="im"><br> vector<double> nav;<br> //vector< vector<double> > cashFlows;<br></div> NumericMatrix cashFlows;<div class="im">
<br>
string creationDate;<br> string activationDate;<br> string finalDate;<br> string benchmark;<br> vector<string> dates;<br> vector<string> datesBmk;<br> //vector< vector<double> > indexesBmk;<br>
</div>
NumericMatrix indexesBmk;<br> //vector< vector<double> > weightsBmk;<br> NumericMatrix weightsBmk;<br> double start;<br> string type;<br><br> protected:<br> private:<br>
<br>};<br><br>when I use it I do:<br><br> NumericMatrix m(5,3);<br><br> for (unsigned i = 0; i < 5; i++)<br> {<br> for (unsigned k = 0; k < 3; k++)<br> {<br> m(i,k) = 100 + k;<br> }<br>
}<br><br>then:<br><br> ...<br> PortfolioPerformanceInput *ppi;<br> ppi = new PortfolioPerformanceInput;<br> ppi->cashFlows = m;<br><br>when I execute this code I have the famous fault.<br><br>The app is really small... 6 files and it is just for me not for my company :-)<br>
<br>Best regards,<br>Alex.<div><div></div><div class="h5"><br><br><br><div class="gmail_quote">On Fri, Sep 24, 2010 at 3:56 PM, Romain Francois <span dir="ltr"><<a href="mailto:romain@r-enthusiasts.com" target="_blank">romain@r-enthusiasts.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Le 24/09/10 15:23, Alessandro Torrisi a écrit :<div><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
I tried with Rcpp::NumericMatrix but I have segmentation fault :-(<br>
This is probably because I'm learning C++ just now...and I don't know<br>
how to deal with pointers and so on...<br>
</blockquote>
<br></div>
If you want help, you are going to need to provide some more details.<div><br>
<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
I don't know how to declare NumericMatrix in my objects... if I do it I<br>
have segfault...<br>
</blockquote>
<br></div>
What did you do ?<div><br>
<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
How can I send you the source archive ? Is it possible to attach them in<br>
ML ?<br>
</blockquote>
<br></div>
You can attach files. However, please trim your code to something small that maintains the problem. I'm not interested in debugging entire applicatons ... not for free anyway ;-)<br>
<br>
Romain<br>
<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div>
Thanks !<br>
<br>
On Fri, Sep 24, 2010 at 2:55 PM, Romain Francois<br></div><div>
<<a href="mailto:romain@r-enthusiasts.com" target="_blank">romain@r-enthusiasts.com</a> <mailto:<a href="mailto:romain@r-enthusiasts.com" target="_blank">romain@r-enthusiasts.com</a>>> wrote:<br>
<br>
Le 24/09/10 14:51, Alessandro Torrisi a écrit :<br>
<br>
Installed versions:<br>
<br>
Rcpp "Rcpp" "/usr/lib/R/site-library" "0.8.6"<br>
RInside "RInside" "/usr/lib/R/site-libRomain Francois<br>
<<a href="mailto:romain@r-enthusiasts.com" target="_blank">romain@r-enthusiasts.com</a><br></div>
<mailto:<a href="mailto:romain@r-enthusiasts.com" target="_blank">romain@r-enthusiasts.com</a>>>rary" "0.2.3"<div><br>
<br>
About the example, what do you exactly need ? I'm a newbie :-D<br>
<br>
<br>
Something self contained I can compile on my machine and that shows<br>
the error you see.<br>
<br>
<br>
I ran the tests and everything seems to go fine with their<br>
compilation<br>
and execution.<br>
I can't see any errors, only "good" output from R and C++.<br>
<br>
<br>
That's good news. It means we really need to see your example.<br>
<br>
<br>
About the vector< vector<double> > I'm trying to set a matrix<br>
instead of<br>
a list of vectors because the source of our portfolioBenchmark<br>
function<br>
needs that kind of data type.<br>
<br>
<br>
Do you have to store it as a vector< vector<double> > ?<br>
Can't you use, e.g. a Rcpp::NumericMatrix ?<br>
<br>
Romain<br>
<br>
Thanks again,<br>
Alex<br>
<br>
On Fri, Sep 24, 2010 at 1:55 PM, Dirk Eddelbuettel<br>
<<a href="mailto:edd@debian.org" target="_blank">edd@debian.org</a> <mailto:<a href="mailto:edd@debian.org" target="_blank">edd@debian.org</a>><br></div><div><div></div><div>
<mailto:<a href="mailto:edd@debian.org" target="_blank">edd@debian.org</a> <mailto:<a href="mailto:edd@debian.org" target="_blank">edd@debian.org</a>>>> wrote:<br>
<br>
<br>
On 24 September 2010 at 13:41, Romain Francois wrote:<br>
| > My environment is Linux Ubuntu 32 bit with R version 2.11.1<br>
(2010-05-31).<br>
| > Do you need more info ?<br>
|<br>
| What versions of Rcpp and RInside are you using ?<br>
|<br>
| It would be useful if you can provide a small reproducible<br>
example so<br>
| that we can debug it on our end.<br>
<br>
Also, do all RInside examples work for you? Do something like<br>
<br>
edd@max:~/svn/rcppbook/papers/rjournal-2010$ mkdir /tmp/check<br>
edd@max:~/svn/rcppbook/papers/rjournal-2010$ cd /tmp/check/<br>
edd@max:/tmp/check$ cp -vax<br>
/usr/local/lib/R/site-library/RInside/examples/standard/* .<br>
edd@max:/tmp/check$ make<br>
<br>
and run the examples via<br>
<br>
edd@max:/tmp/check$ make runAll<br>
<br>
Some of these do run portfolio optim. tests from Rmetrics so<br>
it'll<br>
give you<br>
an idea. They should all work on released pairs of Rcpp +<br>
RInside --<br>
it is<br>
part of our testing.<br>
<br>
Dirk<br>
<br>
<br>
--<br>
Dirk Eddelbuettel | <a href="mailto:edd@debian.org" target="_blank">edd@debian.org</a> <mailto:<a href="mailto:edd@debian.org" target="_blank">edd@debian.org</a>><br></div></div>
<mailto:<a href="mailto:edd@debian.org" target="_blank">edd@debian.org</a> <mailto:<a href="mailto:edd@debian.org" target="_blank">edd@debian.org</a>>> |<div><br>
<br>
<a href="http://dirk.eddelbuettel.com" target="_blank">http://dirk.eddelbuettel.com</a><br>
<br>
<br>
<br>
<br>
--<br>
Alessandro Torrisi<br>
Information Technology Consultant<br>
Email: <a href="mailto:alessandro.torrisi@gmail.com" target="_blank">alessandro.torrisi@gmail.com</a><br>
<mailto:<a href="mailto:alessandro.torrisi@gmail.com" target="_blank">alessandro.torrisi@gmail.com</a>><br>
<mailto:<a href="mailto:alessandro.torrisi@gmail.com" target="_blank">alessandro.torrisi@gmail.com</a><br>
<mailto:<a href="mailto:alessandro.torrisi@gmail.com" target="_blank">alessandro.torrisi@gmail.com</a>>><br>
<br>
Skype: alessandro.torrisi<br>
Tel: +39/333/2442546<br>
<br>
"Questo documento è formato esclusivamente per il destinatario.<br>
Tutte le<br>
informazioni ivi contenute, compresi eventuali allegati, sono<br>
soggette a<br>
riservatezza a termini del vigente D.Lgs. 196/2003 in materia di<br>
"privacy" e quindi ne è proibita l'utilizzazione. Se avete<br>
ricevuto per<br>
errore questo messaggio, Vi preghiamo cortesemente di contattare<br>
immediatamente il mittente e cancellare la e-mail. Grazie."<br>
<br>
<br>
<br>
_______________________________________________<br>
Rcpp-devel mailing list<br>
<a href="mailto:Rcpp-devel@lists.r-forge.r-project.org" target="_blank">Rcpp-devel@lists.r-forge.r-project.org</a><br></div>
<mailto:<a href="mailto:Rcpp-devel@lists.r-forge.r-project.org" target="_blank">Rcpp-devel@lists.r-forge.r-project.org</a>><div><div></div><div><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel</a><br>
<br>
<br>
<br>
--<br>
Romain Francois<br>
Professional R Enthusiast<br>
+33(0) 6 28 91 30 30<br>
<a href="http://romainfrancois.blog.free.fr" target="_blank">http://romainfrancois.blog.free.fr</a><br>
|- <a href="http://bit.ly/cCmbgg" target="_blank">http://bit.ly/cCmbgg</a> : Rcpp 0.8.6<br>
|- <a href="http://bit.ly/bzoWrs" target="_blank">http://bit.ly/bzoWrs</a> : Rcpp svn revision 2000<br>
`- <a href="http://bit.ly/b8VNE2" target="_blank">http://bit.ly/b8VNE2</a> : Rcpp at LondonR, oct 5th<br>
<br>
<br>
<br>
<br>
<br>
--<br>
Alessandro Torrisi<br>
Information Technology Consultant<br>
Email: <a href="mailto:alessandro.torrisi@gmail.com" target="_blank">alessandro.torrisi@gmail.com</a> <mailto:<a href="mailto:alessandro.torrisi@gmail.com" target="_blank">alessandro.torrisi@gmail.com</a>><br>
Skype: alessandro.torrisi<br>
Tel: +39/333/2442546<br>
<br>
"Questo documento è formato esclusivamente per il destinatario. Tutte le<br>
informazioni ivi contenute, compresi eventuali allegati, sono soggette a<br>
riservatezza a termini del vigente D.Lgs. 196/2003 in materia di<br>
"privacy" e quindi ne è proibita l'utilizzazione. Se avete ricevuto per<br>
errore questo messaggio, Vi preghiamo cortesemente di contattare<br>
immediatamente il mittente e cancellare la e-mail. Grazie."<br>
<br>
<br>
<br>
_______________________________________________<br>
Rcpp-devel mailing list<br>
<a href="mailto:Rcpp-devel@lists.r-forge.r-project.org" target="_blank">Rcpp-devel@lists.r-forge.r-project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel</a><br>
</div></div></blockquote><div><div></div><div>
<br>
<br>
-- <br>
Romain Francois<br>
Professional R Enthusiast<br>
+33(0) 6 28 91 30 30<br>
<a href="http://romainfrancois.blog.free.fr" target="_blank">http://romainfrancois.blog.free.fr</a><br>
|- <a href="http://bit.ly/cCmbgg" target="_blank">http://bit.ly/cCmbgg</a> : Rcpp 0.8.6<br>
|- <a href="http://bit.ly/bzoWrs" target="_blank">http://bit.ly/bzoWrs</a> : Rcpp svn revision 2000<br>
`- <a href="http://bit.ly/b8VNE2" target="_blank">http://bit.ly/b8VNE2</a> : Rcpp at LondonR, oct 5th<br>
<br>
<br>
</div></div></blockquote></div><br><br clear="all"><br></div></div>-- <br><div class="im">Alessandro Torrisi<br>Information Technology Consultant<br>Email: <a href="mailto:alessandro.torrisi@gmail.com" target="_blank">alessandro.torrisi@gmail.com</a><br>
</div><div><div></div><div class="h5">Skype: alessandro.torrisi<br>
Tel: +39/333/2442546<br><br>"Questo documento è formato esclusivamente per il destinatario. Tutte le informazioni ivi contenute, compresi eventuali allegati, sono soggette a riservatezza a termini del vigente D.Lgs. 196/2003 in materia di "privacy" e quindi ne è proibita l'utilizzazione. Se avete ricevuto per errore questo messaggio, Vi preghiamo cortesemente di contattare immediatamente il mittente e cancellare la e-mail. Grazie."<br>
</div></div></div><br><br clear="all"><br>-- <br>Alessandro Torrisi<br>Information Technology Consultant<br>Email: <a href="mailto:alessandro.torrisi@gmail.com">alessandro.torrisi@gmail.com</a><br>Skype: alessandro.torrisi<br>
Tel: +39/333/2442546<br><br>"Questo documento è formato esclusivamente per il destinatario. Tutte le informazioni ivi contenute, compresi eventuali allegati, sono soggette a riservatezza a termini del vigente D.Lgs. 196/2003 in materia di "privacy" e quindi ne è proibita l'utilizzazione. Se avete ricevuto per errore questo messaggio, Vi preghiamo cortesemente di contattare immediatamente il mittente e cancellare la e-mail. Grazie."<br>