multidimensional

Why use an Array of more than two dimensions?

I am having trouble wrapping my head around the concept of an array with more than two dimensions, why you would need one, and how you would use it. For example, how would you go about representing the following data in a multidimesional array? Sex: Male | Female Hair Color: Blond | Brunette | Black Eye Color: Blue | Brown | Green | H...

How do you Iterate a multidimesional array without knowing the number of dimensions and elements of the array being passed to you?

A SDK is returning me an array with multiple dimensions such as: int[,,] theArray = new int[2,8,12]; I need to visit each element in the array and return the value and the position of the value. I need to do this without knowing the number of dimensions and elements of the array being passed in. ...

initializing a const multidimensional array in c++

I'm currently working through some exercises in a c++ book, which uses text based games as its teaching tool. The exercise I am stuck on involves getting the pc to select a word from a const array of words (strings), mixing the letters up and asking the player to guess the word. This was easy, but as a follow on the book asks to add the ...

algorithm to traverse 3D coordinates without revisiting

Say we have a set of 3D (integer) coordinates from (0,0,0) to (100,100,100) We want to visit each possible coordinate (100^3 possible coordinates to visit) without visiting each coordinate more than once. The sum of the differences between each coordinate in adjacent steps cannot be more than 2 (I don't know if this is possible. If not,...

Pass a multidimensional array as a parameter in Delphi

I'd like to pass a multi-dimensional array to a constructor like so: constructor TMyClass.Create(MyParameter: array of array of Integer); begin LocalField := MyParameter; end; Where LocalField is an array of array of Integer. However the above code won't compile ('Identifier expected but ARRAY found'). Could somebody explain to me ...

Sorting a multidimensional array in PHP?

I have this kind of an array array(5) { [0]=> array(5) { [0]=> string(7) "jannala" [1]=> string(10) "2009-11-16" [2]=> string(29) " <p>Jotain mukavaa.</p> " [3]=> int(12) [4]=> int(1270929600) } [1]=> array(5) { [0]=> string(7) "jannala" [1]=> string(10) "2009-...

Multi-Dimensional Graphing Libraries for Java

I have been working on projects that deal with 2-Dimensional graphing, UML diagramming and relational graphing (node-link diagrams). I am interested in moving to projects that deal more with 3-Dimensional graphing of scatter plots and 3-Dimensional navigation. Could someone suggest a few books, or libraries that would help me get started...

Multidimensional data feedback

This is hardly a programming question, so if you're a purest feel free to read no further. Are there any good examples on how to display multidimensional data on a computer screen? I don't know how many dimensions there will be, though anything more than 10 I suspect will be rare. I can think of the obvious solution, but I don't know if...

Parsing flat-file database information into a multidimensional array

I want to make a class for parsing flat-file database information into one large analogous multidimensional array. I had the idea of formatting the database in a sort of python-esque format as follows: "tree #1": "key" "value" "sub-tree #1": "key" "value" "key #2" "value" "key #3" "value" I am trying to make it ...

Multidimensional Associative Arrays in VB.NET?

Hi, is there in VB.NET something like this in php?: $var["a1"]['name']="Mike"; $var["a1"]['nick']="MMM"; I tried hashtables, dictionary, lists and arrays in .net, all I could get is a simple key=>value array Is there a simple solution if not, is there a class or something for this? Thanks. ...

php - recreate array?

I've "inherited" some data, which I'm trying to clean up. The array is from a database which, apparently, had no keys. The array itself, is pretty long, so I'm simplifying things for this post... [0] => Array ( [id] => 2 [uid] => 130 [eid] => 8 [ename] => Standard [...

Pointer address in a C multidimensional array.

Hi, I'm messing around with multidimensional arrays and pointers. I've been looking at a program that prints out the contents of, and addresses of, a simple array. Here's my array declaration: int zippo[4][2] = { {2,4}, {6,8}, {1,3}, {5,7} }; My current understanding is that zippo is a pointer, an...

php - recreate array from flat to multidimensional?

I am trying to take a flat array and recreate it so that it's multidimensional. I've been looking into array_combine and array_merge, but I'm not sure that either of those will give me what I'm hoping for... The array, in it's current form (and this is just a simplified example): Array ( [0] => stdClass Object ( ...

multidimensional indexing for image retrieval system

Hi please, any one help me to solve my problem: I am working now in trademark image retrieval system , now I was prepared my database space (i.e I compute more than one color features like color histogram , Mean Color, moment set ...), and I was used the distance measures to retrieve the images which are similar to the query image an...

initializing multi-dim string arrays

Stuck here trying to initialize an array (c#) using a loop. The number of rows will change depending. I need to get back two values that I am calculating earlier in the program startweek, and endweek. Lots of examples on building int arrays using loops but nothing I can find re dynamic strings and multi dim arrays. Thanks how do I set ...

R-tree implementation in matlab

Hi please, any one tell me how we can implement the R-tree structure in matlab to speed the image retrieval system , I would like to inform you that my database space a feature vector of Color Histogram (Multidimensional ) and also I I have a distance vector for similarity measure... thanks ...

ActionScript: How to push to multidimensional arrays and later retrieve just one 'row'

I am reading a set of latitude & Longitude Coordinates that define a polygone area. They are keyed to an area ID and I retrieve them from a SQL database. So for example, Area ID 153 might have 20 coordinates and area ID 77 might have 11 coordinates. I wish to save these in a 2-D array indexed by the area ID, and where each coordinate pa...

mysql data from calendar check if booked

I have a database with reservations for items. All reservations have an: ID , item ID, personWhoBookedId, time_from (unixtime) , time-to(unixtime). I like to display a day per day time schedual from hour to hour, and colour the timethat an item is booked and display the personWhoBookedID on that timeframe. like: room1: 5:00 - 6:00: ...

php - get the maximum value from an element in a multidimensional array?

I'm trying to select the maximum value for a particular key in a multidimensional array. I'm having trouble "getting to" the key in question... So, the array (which is much more lengthy than what I'm posting here) [0] => stdClass Object ( [id] => 70 [cust] => 4 [dnum] => 1 [upper] => Array ...

php how to group a multidimensional array by a particular value?

Hopefully, I can explain this correctly... I have a multidimensional array and am trying to group them according to the value of one the keys. So, I'm trying to group them by level, but I won't actually know the level beforehand. So, it's not like I can put it in a for loop and say while $i < 7, because I won't know that 7 is the max...