<div dir="ltr">Nice!<br><br> init_int d1<br> init_ivector d2vec(1,d1)<br> init_int d3<br> init_int d4<br> !! int ld1=d1;<br> !! int ld3=d3;<br> !! int ld4=d4;<br> init_4darray blah(1,ld1,1,d2vec,1,ld3,1,ld4)<br> //!!cout << blah << endl;<br>
!!cout << blah(1,1,1,1) << " " << blah(1,1,1,2) << endl;<br> !!cout << blah(1,1,2,1) << " " << blah(1,1,2,2) << endl;<br> !!cout << blah(2,1,1,1) << " " << blah(2,1,1,2) << endl;<br>
!!cout << blah(2,1,2,1) << " " << blah(2,1,2,2) << endl;<br> !!cout << blah(2,2,1,1) << " " << blah(2,2,1,2) << endl;<br> !!cout << blah(2,2,2,1) << " " << blah(2,2,2,2) << endl;<br>
//should fail<br> !!cout << blah(1,2,1,1) << endl;<br><br>dat file<br>2<br>1 2<br>2<br>2<br>1 2<br>3 4<br>5 6<br>7 8<br>9 10<br>11 12<br><br>output<br>1 2<br>3 4<br>5 6<br>7 8<br>9 10<br>11 12<br><br>exited abnormally<br>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Apr 14, 2013 at 11:47 AM, dave fournier <span dir="ltr"><<a href="mailto:davef@otter-rsch.com" target="_blank">davef@otter-rsch.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<div>On 13-04-13 05:32 PM, Alex Campbell
wrote:<br>
<br>
I guess it wants a constructor. In the meantime this might do it.<br>
<br>
<br>
DATA_SECTION<div class="im"><br>
init_int d1<br>
init_ivector d2vec(1,d1)<br>
init_int d3<br>
init_int d4<br></div>
!! int ld1=d3;<br>
!! int ld3=d3;<br>
!! int ld4=d4;<br>
init_4darray blah(1,ld1,1,d2vec,1,ld3,1,ld4)<br>
<br>
<br>
<br>
</div><div><div class="h5">
<blockquote type="cite">
<div dir="ltr">Was passing on an issue from a friend, and lazily
didn't try it myself. Of course now I try it it compiles fine,
and he now tells me the second dimension is ragged. Trying
myself, I'm finding
<div>
init_int d1</div>
<div>init_ivector d2vec(1,d1)</div>
<div>init_int d3</div>
<div>init_3darray blah(1,d1,1,d2vec,1,d3)</div>
<div><br>
</div>
<div>compiles fine, but</div>
<div><br>
</div>
<div>
init_int d1</div>
<div>init_ivector d2vec(1,d1)</div>
<div>init_int d3</div>
<div>init_int d4</div>
<div>init_4darray blah(1,d1,1,d2vec,1,d3,1,d4)</div>
<div><br>
</div>
<div>does not. The first candidate for
data_4array:allocate contains int args only, the other
candidate has ad_integer args for the first two, and then
const index_type& args thereafter. Not sure what an
index_type is, but it looks like ragged arrays are not
implemented for arrays of dimension higher than 3. It would be
very handy but we can workaround without too much ugliness.</div>
<div><br>
</div>
<div>Number of people desiring this functionality++;
(Number of people capable of and intending to implement it in
the near future+=0.)</div>
<div><br>
</div>
<div>Alex</div>
<div>
<br>
</div>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Sun, Apr 14, 2013 at 2:56 AM, dave
fournier <span dir="ltr"><<a href="mailto:davef@otter-rsch.com" target="_blank">davef@otter-rsch.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">A little
example of what you want would help.<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@admb-project.org" target="_blank">Users@admb-project.org</a><br>
<a href="http://lists.admb-project.org/mailman/listinfo/users" target="_blank">http://lists.admb-project.org/mailman/listinfo/users</a><br>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
</div></div></div>
</blockquote></div><br></div>