Re: F2CL ODEPACK problems.
Raymond Toy <[email protected]> Tue, 17 Aug 2004 23:37:47 -0400
| Newsgroups | gmane.lisp.clocc.general |
|---|---|
| Message-ID | <[email protected]> |
Marco Antoniotti wrote: > > How should I declare the CL array? > > X(8, 10) ==> (make-array (* 8 10) ....) > Yes, that's right. All multi-dimensional arrays are 1D arrays with the same number of elements. > ? > > Also, FREF seems quite strange to me. I tried the following > > (defvar arr (make-array (* 8 10) ....)) ;; filled in from 0 to 79. > > (f2cl-lib:fref arr (-9 11) ((1 8) (1 10))) ==> 70 > > What is the meaning of this? Macroexpand is your friend. But basically you are trying to access element arr(-9, 11) which is strictly illegal since the first index is supposed to be 1 to 8 and the second index is 1 to 10. (I think there's a variable you can set that will check array bounds.) But what happens is the real index is computed as (-9 + 1) + 8*(11 - 1) = 70, so you got element 70 from arr. Ray ------------------------------------------------------- SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285