Re: How to tie



Abble wrote:
On Dec 31, 9:53 am, Lew <l...@xxxxxxxxxxxxx> wrote:
Abble wrote:
Thanks, Lew, but I'd like if possible to not have to wrap my array.
Why not?


Because I have about 60,000 lines of old code from C, C++, and FORTRAN
with array references like:

D[i] = A[ i ] + B[i] + C[ i ]; // use A B c

I think to objectize these the lines would look like:


D.setval( i, A.getval( i ) + B.getval( i ) + C.getval( i ) ); // use
A B c

So the goal is to do whatever it takes so we can keep the natural
array notations and legibility of the expressions( which can get very
long), AND speed would be nice, as the native code C, C++ and FORTRAN
codes are already not as fast as one might like.

Odd use of "natural," that ...

If the goal is to interpose your own code on array accesses
in Java, I think you're out of luck: Array accesses use built-in
opcodes of the Java Virtual Machine, and there's no provision for
you to insert your own code into the JVM. (Hard to see how the
security and integrity models could permit such a thing, anyhow.)

Perhaps it's time to take a step back: What kind of code do
you want to interpose, and for what purpose? Perhaps the cat
can be skinned some other way.

--
Eric Sosman
esosman@xxxxxxxxxxxxxxxxxxxx
.



Relevant Pages

  • Re: Who uses clapack?
    ... > functions like SUM and MAXVAL and the ability to use array sections ... > drastically change the meaning of a Fortran code. ... >>Have you ever seen those bills for a Fortran compiler for an ... engineering applications in the C and C++ languages. ...
    (comp.lang.fortran)
  • Re: Who uses clapack?
    ... > functions like SUM and MAXVAL and the ability to use array sections ... > drastically change the meaning of a Fortran code. ... >>Have you ever seen those bills for a Fortran compiler for an ... engineering applications in the C and C++ languages. ...
    (sci.math.num-analysis)
  • Re: Benchmarking APL
    ... with that of FORTRAN. ... APL a 400% gain in programming efficiency could be obtained with only ... Another good-for-APL array problem, vector convolution, gave these ... Tomcatv, one of the SPEC benchmarks, is more typical of large array ...
    (comp.lang.apl)
  • Re: Mixing C++/Fortran using Two-Dimensional Array
    ... not a subset as in Fortran. ... if you really need it you can get the effect by an array of TYPE ... the lowest-level base element pointer, which is all you actually need ... macros in C, although it can be difficult to find macro names that are ...
    (comp.lang.fortran)
  • Re: how to "translate" dynamic array in FORTRAN 90 to Java code?
    ... I am translating a Fortran program to Java code. ... is an array with size unspecified. ... I use Object array in Java to translate FORTRAN array. ...
    (comp.lang.java.programmer)