Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

n-dimensioned array in Java

 
Nicholas Jordan
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How, in general, does one write a Vector of Vectors in Java - along with the more general Vector of Vectors of Vectors ....

Sounds recursive, that may be the correct approach. Note - I realize this can easily hog resources and should be corralled to some extent.

In general and simplified terminology, I am working on combinatorics which will work all permutations of Set <-> Set hoping to implement a robust algorithm which will exhibit resiliency under unforseen loading in the hands of uninformed operators.
 
Henry Wong
author
Marshal
Pie
Posts: 20892
75
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How, in general, does one write a Vector of Vectors in Java - along with the more general Vector of Vectors of Vectors ....


It's actually pretty straightforward...



Now... If you want to declare a vector that can hold any dimension, then you must not use generics, and use the instanceof operator to process each dimension.



Henry
 
Bill Shirley
Ranch Hand
Posts: 457
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may want to check out hpjava.org.
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[Henry]: Now... If you want to declare a vector that can hold any dimension, then you must not use generics, and use the instanceof operator to process each dimension.

More generally, you may want to check out the composite pattern.
 
Nicholas Jordan
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay, here is what I have so far. This is a precipitous edge work and I keep coming back to the fact that at any point, the dynamic size of the dispatch can be reduced to a dataSet and an algorithm. I am beginning to think I should focus my thoughts on making one efficient or I know it will work searching algorithm and one dataset type and just simplifiy to a grow and shrink metaphor that relies on the irreducible that at any dispatch point, there will be unknown sized dataset, one Collection to search for elements in the dataset and one algorithm to use to search for elements in the sample.

if(algorithm.find(term,dataset);

Here is what I have at the moment, I am in a spin and solicit views.



The code compiles.
 
Nicholas Jordan
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The HPJava syntax for multiarrays is actually where I wanted to go with this, but in that I do not stand to gain by transitioning to another linguistic over the weekend, I can use the above syntax and am here at the moment on the basis that I have decided to use HashSet of HashSet to collect some data -- I need the scattering that hashing brings with it. Hashtable would probably do but what I am thinking as I try to avoid some self-referentials is:



If this gets me a hash set of hash sets of strings, then I could concievably pass:

I better quit thinking right there, I need to be able to call suppliedSet.next() and have strings without needing to call shuffle() on the set. The chaotic retireval is wanted to achieve handling by repetitive views without being forced to look at the entire dataset.

I.O.W. - sampling, as described in statistics.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic