Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8419169
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T02:32:22+00:00 2026-06-10T02:32:22+00:00

I need to process data that has a set of attributes where the number

  • 0

I need to process data that has a set of attributes where the number of attributes will be determined at run time. For example, a data set may contain animals, and attributes might include gender, species, age, etc. where each attribute can be represented by an integer (or an enum). I want to be able to iterate along any dimension so that I can, say, quickly calculate the total number of males, or number of dogs, etc.

I am thinking of a Java interface like this:

public interface DynamicMultidimensionalStore<T>
{
  Object getPoint(List<Integer> coordinates);
  void setPoint(List<Integer> coordinates, T item);
  Iterator<T> iterate(int dimension, List<Integer> remainingCoordinates);
  DynamicMultidimensionalStore<T> getSlice(int dimension, int offset);
}

First, there must be a name for this; Cube? I see it is similar to http://en.wikipedia.org/wiki/Spatial_index#Spatial_index but these seem more focused on spatial relationships rather than iterating over arbitrary axes.

The only structure I can think of is a class that stores the data in a linear array and performs pointer arithmetic to calculate the offsets.

Are there better solutions? I think my approach would becomes less efficient as the array becomes more sparse (or as dimensions increase).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T02:32:24+00:00Added an answer on June 10, 2026 at 2:32 am

    If I’ve understood your question correctly, a “sparse solution” that would work is as follows. Represent your data set as a list of dictionaries, one for each variable. Store an item by inserting a reference to it into each dictionary, keyed by the relevant property. So you’d end up with data like

    {
      feet = {1: {<slug>}, 2: {<bird>, <person>}, 4: {<dog>}},
      fur  = {yes: {<dog>}, no: {<slug>, <bird>, <person>}},
      ...
    }
    

    Here, <slug> should be read as a reference / pointer to a single instance of your object type. I don’t know much about Java so I can’t be specific there, but an implementation in C++, say, could use std::map keyed on possible values of the parameters. Then the values would be stored as some general collection: either std::list or maybe std::set. If you were being fancier, maybe std::multimap would be more suited – I’m not entirely sure.

    Counting objects with a given property should be extremely fast: you would be querying the length of some container that you look up in a hash table. The major downside is that you have n*k pointers (or references or or …) where n is the number of objects and k is the number of axes. This may or may not be OK for you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to automate a process that involves getting data from a series of
I need to process the incoming predefined ASN format data(coming from verity of clients
I need to Open a process (easy) and then somehow paste data from my
I need to process a large number of files in a directory. The files
I need to do a lot of processing on a table that has 26+
My application has a requirement that we need to encrypt index fields. Right now
The problem: I often need to select a set of variables from a data.frame
I'm writing a c# program that will launch many child processes. At some time
I have a set of InnoDB tables that I periodically need to maintain by
Suppose that one has set up a cassandra cluster. You've got a 10[TB] database

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.