Array references - page 4

 
I mean indicator buffer nine, but the meaning is the same.
Усреднение ценовых рядов без дополнительных буферов для промежуточных расчетов
Усреднение ценовых рядов без дополнительных буферов для промежуточных расчетов
  • 2010.10.25
  • Nikolay Kositsin
  • www.mql5.com
Статья о традиционных и не совсем традиционных алгоритмах усреднения, упакованных в максимально простые и достаточно однотипные классы. Они задумывались для универсального использования в практических разработках индикаторов. Надеюсь, что предложенные классы в определенных ситуациях могут оказаться достаточно актуальной альтернативой громоздким, в некотором смысле, вызовам пользовательских и технических индикаторов.
 

TheXpert:

I need a normal array without copying

The way is to screw with the array structure. I.e. slip a timeseries pointer instead of an array pointer, along with adequate parameters, so the structure thinks it's ok.

aha, got it!

and then pull a structure instead of an array reference across functions...

the structure is sort of detached from the array, but you can still get data from

ArrayStore::double x[];
 
sergeev:
Bingo! :)
 
Now all that's left is to take off :)
 
sergeev:
now all that's left is to take off :)
Can you feel the perspective? Theoretically, you could do the same with anything, including objects.
 
TheXpert:
Can you get a perspective? Theoretically, the same thing can be done to anything, including objects.

I wouldn't advise you to get a perspective. :))

I sat with your problem for a while, and something cleared up.

first two bytes are array type (int).

second two bytes - unclear.

the third two - number of bytes in the data element (int)

   // int x[][15];     // == 0x5200 0100 0400  // здесь в каментах - первые три пары байт структуры
   // uint x[][15];    // == 0x5300 0100 0400
   // short x[][15];   // == 0x5000 0100 0200
   // ushort x[][15];  // == 0x4F00 0100 0200
   // char x[][15];    // == 0x4D00 0100 0100

   // uchar x[][15];   // == 0x4E00 0100 0100

   // long x[][15];    // == 0x5500 0100 0800
   // ulong x[][15];   // == 0x5600 0100 0800

   // double x[][15];  // == 0x5800 0100 0800
   // datetime x[][15];// == 0x5400 0100 0800


Then there's four [ulong][ulong][ulong][ulong][ulong] in a row.

then the size of the reserved buffer.

and then a buffer pointer (haven't checked yet).

the rest is unclear, maybe a reserve but not for sure

 

Yeah. But that's if you exclude memcpy

before that, it's worth checking if internal array copying is faster than memcpy at all

 
MetaDriver:

I sat with your problem for a while, something cleared up.

Oh, my knicks to you, just starting to dig.
 
sergeev:

Yeah. But that's if you exclude memcpy

before that, it's worth checking if internal array copying is faster than memcpy at all

Yes, we should. If memcpy is comparable to copying an array of say 500,000, there's probably no point.
 

MetaDriver:

further confusion, possibly a reserve, but not a certainty

There should also be an AsSeries flag and possibly some others.