fastes conversion 
Author Message
 fastes conversion

Hello,

I have to convert a string to an array of word. Means, each two
byte in the string represents an signed integer. I do use a loop
counting up an offset. In each loop the offset is incremented by 2.
Then I use the two bytes at the marked position and put them
together to a word with the low and high-byte function. This loop
is rearly slow, when converting 10000 values or more.
Has anybody am idea how to do this faster.

Thanks,

Michael



Sun, 15 Jul 2001 03:00:00 GMT  
 fastes conversion

Quote:
>I have to convert a string to an array of word. Means, each two
>byte in the string represents an signed integer. I do use a loop
>counting up an offset. In each loop the offset is incremented by 2.
>Then I use the two bytes at the marked position and put them
>together to a word with the low and high-byte function. This loop
>is rearly slow, when converting 10000 values or more.
>Has anybody am idea how to do this faster.

You should find this to be a lot faster:

Take your string and wire it into the input of a type cast function (on the
Advanced-Data Manipulation palette).  Create an array constant and place a
numeric constant inside of it.  Set the representation on the numeric to be
I16.  What comes out of the other end of that type cast is an array of I16's
and it should happen almost immediately.

Enjoy.

Jason



Sun, 15 Jul 2001 03:00:00 GMT  
 fastes conversion
Quote:

> >I have to convert a string to an array of word. Means, each two
> >byte in the string represents an signed integer. I do use a loop
> >counting up an offset. In each loop the offset is incremented by 2.
> >Then I use the two bytes at the marked position and put them
> >together to a word with the low and high-byte function. This loop
> >is rearly slow, when converting 10000 values or more.
> >Has anybody am idea how to do this faster.

> You should find this to be a lot faster:

> Take your string and wire it into the input of a type cast function (on the
> Advanced-Data Manipulation palette).  Create an array constant and place a
> numeric constant inside of it.  Set the representation on the numeric to be
> I16.  What comes out of the other end of that type cast is an array of I16's
> and it should happen almost immediately.

> Enjoy.

> Jason

OK,

I have done so yesterday and it speeded
up 50 %. Thants very nice.
Thanks so far for that hint.

An other problem is to put the date of two
arrays in one array of cluser. Is here a
faster way than doing it by loop ?

Thaaks,

Michael



Tue, 17 Jul 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. C to Pascal Conversion (Was: Pascal to C Conversion)

2. C to Fortran conversion (was: fortran to c conversion)

3. need floating point conversion method

4. APL Code Conversion

5. Q: String To Number Conversion

6. APL Conversion

7. Conversion of a Spreadsheat Program to APL

8. APL68000 characters conversion to PC

9. apl*plus to IBM/apl2 conversion problem

10. Numeric/character conversion primitives

11. ASCII to numeric conversion in J

12. ASCII to numeric conversion in J

 

 
Powered by phpBB® Forum Software