Click here to Skip to main content
16,015,920 members
Home / Discussions / C#
   

C#

 
AnswerRe: RegOpenKey and similar .... marshal/P-Invoke?? Pin
Ami Bar22-Oct-04 13:56
Ami Bar22-Oct-04 13:56 
GeneralRe: RegOpenKey and similar .... marshal/P-Invoke?? Pin
Paolo Ponzano23-Oct-04 1:35
Paolo Ponzano23-Oct-04 1:35 
GeneralRe: RegOpenKey and similar .... marshal/P-Invoke?? Pin
Ami Bar23-Oct-04 5:01
Ami Bar23-Oct-04 5:01 
Generalfind the contents of a cell in a datagrid row Pin
steve_rm22-Oct-04 6:09
steve_rm22-Oct-04 6:09 
GeneralRe: find the contents of a cell in a datagrid row Pin
Heath Stewart22-Oct-04 12:59
protectorHeath Stewart22-Oct-04 12:59 
GeneralEfficient implementation of multidimensional arrays Pin
Andrew Kuklin22-Oct-04 5:03
sussAndrew Kuklin22-Oct-04 5:03 
GeneralRe: Efficient implementation of multidimensional arrays Pin
J4amieC22-Oct-04 5:24
J4amieC22-Oct-04 5:24 
GeneralRe: Efficient implementation of multidimensional arrays Pin
Utwig26-Oct-04 0:29
Utwig26-Oct-04 0:29 
Hello, J4amieC.
Probably, I've formulated what I wanted to say in a very inadequate way, by "I expect the following functionality from the implementation:" I meant "I would like to use the result solution for following purposes:". I do not want anyone to write code for me, I would like to hear some thoughts of people that are more experienced in this topic as I am.
Concerning your solution: at first, thank you for your help. Secondly, I'm afraid that I don't quite understand what you're proposing. I know what a binary tree is, what kind of data do you suggest to store in the nodes of the tree? Besides, I think it will be better to store minimum data for access to array (in your example with binary tree, I will need some kind of "links" to the children of parent node). I would like to give some estimation of typical "spaces" that are currently used. For example, a typical 10-dimensional array with following dimensions: {4, 7, 8, 6, 8, 2, 6, 7, 2, 7}. This will result (let's take 8 byte pro double-value) in
(4*7*8*6*8*2*6*7*2*7)*8 bytes=101154816 bytes=96,46875 Mb. And that is already quite big. I can have up to 10-20 of those "spaces". I just cannot throw away another 96 Mb for control structures. And of course Arraylist-based solution will not save the situation because of memory- and time overhead connected with boxing/unboxing.
Here is also the code with which I tested the performance. I've commented it as much as possible, but if anything is not clear, please, do not hesitate to ask:
//Create a test 10-dimensional array
int[] allDimensions = new int[10]{4, 7, 8, 6, 8, 2, 6, 7, 2, 7};
System.Array testArray = Array.CreateInstance(System.Type.GetType("System.Double"), allDimensions);

//currentDimensions is an array representing "counters" of dimensions
//I'll explain this on example. If as tempTable we have a three-dimensional array
//with allDimensions=[4, 8, 2].
//Then currentDimensions will run through the following combinations:
//[0; 0; 0], [1; 0; 0], [2; 0; 0], [3; 0; 0], [0; 1; 0], [1; 1; 0], [2; 1; 0] etc.
int[] currentDimensions = new int[allDimensions.Length];
//done variable checks whether all "places" of the space were visited
//(i.e. with the same example of three-dimensional array bool will be true when
//currentDimensions=[3, 7, 1]
bool done=false;

while(!done)
{
//Increment the current place in the space
double curValue = (double)testArray.GetValue(currentDimensions);
testArray.SetValue(++curValue, currentDimensions);

//Try to get the next combination of currentDimensions
done=true;
for(int j=0; j
QuestionWhich is faster?? Pin
exhaulted22-Oct-04 4:46
exhaulted22-Oct-04 4:46 
AnswerRe: Which is faster?? Pin
J4amieC22-Oct-04 5:16
J4amieC22-Oct-04 5:16 
GeneralRe: Which is faster?? Pin
exhaulted22-Oct-04 5:25
exhaulted22-Oct-04 5:25 
GeneralRe: Which is faster?? Pin
Colin Angus Mackay22-Oct-04 13:59
Colin Angus Mackay22-Oct-04 13:59 
GeneralRe: Which is faster?? Pin
exhaulted24-Oct-04 21:49
exhaulted24-Oct-04 21:49 
AnswerRe: Which is faster?? Pin
yoaz22-Oct-04 7:34
yoaz22-Oct-04 7:34 
AnswerRe: Which is faster?? Pin
Jankinsoo22-Oct-04 19:01
Jankinsoo22-Oct-04 19:01 
GeneralMFC/C++ app can't acquire C# mutex Pin
sjhart22-Oct-04 0:44
sjhart22-Oct-04 0:44 
GeneralRe: MFC/C++ app can't acquire C# mutex Pin
Uwe Keim23-Oct-04 4:49
sitebuilderUwe Keim23-Oct-04 4:49 
Generalhook 2 forms Pin
StateOfTrance21-Oct-04 22:54
StateOfTrance21-Oct-04 22:54 
GeneralRe: hook 2 forms Pin
Alex Korchemniy22-Oct-04 18:49
Alex Korchemniy22-Oct-04 18:49 
GeneralEvents in DataGrid Pin
Anonymous21-Oct-04 21:12
Anonymous21-Oct-04 21:12 
GeneralRe: Events in DataGrid Pin
KSEI22-Oct-04 0:50
KSEI22-Oct-04 0:50 
GeneralRe: Events in DataGrid Pin
Anonymous22-Oct-04 3:38
Anonymous22-Oct-04 3:38 
GeneralCompiler / parser that gives types and methods Pin
Stefan Henze21-Oct-04 21:08
sussStefan Henze21-Oct-04 21:08 
GeneralRe: Compiler / parser that gives types and methods Pin
leppie21-Oct-04 22:38
leppie21-Oct-04 22:38 
GeneralRe: Compiler / parser that gives types and methods Pin
Stefan Henze22-Oct-04 15:09
sussStefan Henze22-Oct-04 15:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.