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

 Page 1 of 1 [ 3 post ]

Relevant Pages