0

I need to write a method which classifies large range of numbers. I`ve write the enum whith identifies.

enum op {
  memLoad = 130,
  memStore,
  //etc
}

For some identifies I have a range ,for example 0-120 - are registers numbers I can`t add 121 such (register) identifiers one by one to the enum. How do you advice to deal such identifiers (which are defined as a range)? Thanks,

Yakov
  • 9,221
  • 29
  • 109
  • 199
  • 1
    Is there a reason these need to be enumerated explicitly? Could you instead just write a function which returns the necessary information about a number? – Luke Jan 09 '13 at 13:31

2 Answers2

0

I don't think enum is not the right instrument for the problem you are trying to solve.

I would suggest using interval tree to have as expressive and fast code.

Community
  • 1
  • 1
bobah
  • 17,620
  • 1
  • 35
  • 63
0

A more sophisticated way to achieve classification may be made ​​using neural networks, as WEKA Classification.

Mihai8
  • 3,023
  • 1
  • 19
  • 29