• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Suggestion about data structure to be used for piecewise defined functions.

 
Bartender
Posts: 1357
39
IBM DB2 Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Good morning to all,

I need any advice about a data structure suitable for defining, in Java, a piecewise function, i.e a function like this:

F(t) = 1 if t in [t0,t1] or t[t2,t3] or.... [tn-1,tn]
0 otherwise.

where t0...tn are given without a specific rule (may be randomly choosed) and are integers.

Thank you in advance for your help.

 
Marshal
Posts: 79178
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please explain more about what you need. Did you intend to write t[t2, t3] with the t at the beginning? Are those ordered pairs or something? Is there any ordering or sorting of the pair in the data structure?
 
Claude Moore
Bartender
Posts: 1357
39
IBM DB2 Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for your answer.
Well, I think that a good example may be given by wave function. Let's assume that t is time, so that you have a natural sorting defined
on t values. In a such scenario, f(t) may assume two distinct values, 1 or 0, in different time intervals like [t1,t2] and [t3,t4]..
Let's assume that f(t) assumes 1 as value when a certain system is doing calculations, and 0 when that system is idle. I want to answer to questions like these:
- from a certain time t, for how may minutes system has been up ?
- form a certain time t, has been the system up for at least T minutes ?

and so on..

Thanks for your support.


 
Let's go to the waterfront with this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic