A Monotonic spatial function

  • Thread starter intervoxel
  • Start date
192
1
I need an integer function that receives three integer parameters x,y,z and returns a unique value. An additional constraint is that the nearest neighbors points return a value that doesn't exceed a small value. The maximum value for the inputs is N.

Thank you for any help.
 
32,773
4,479
How does monotonic figure in here? In different words you want a function f that maps ##\mathbb R^3## to ##\mathbb R##, but using integer values for the inputs.
For a real-value function g of a real variable, g is monotonically increasing provided that ##a < b \Rightarrow g(a) \le g(b)##.

For a function whose input is an ordered triple, (x, y, z) how do you determine that ##(x_1, y_1, z_1) < (x_2, y_2, z_2)## in order to show montonicity?
 
33,397
9,122
What "doesn't exceed a small value" mean?

##(x,y,z) \to (N+1)^2 x + (N+1) y + z## or something similar can work. If the return value doesn't have to be an integer you have more freedom.
 
192
1
What "doesn't exceed a small value" mean?

##(x,y,z) \to (N+1)^2 x + (N+1) y + z## or something similar can work. If the return value doesn't have to be an integer you have more freedom.
Thank you for the answers so far. The above function is indeed monotonic but does not return a unique value for each triplet. I tried
if(y <= z)
r = 3*N*N*x + y+N*z+1;
else
r = 3*N*N*x + 3*N*y-z;
but it generates some duplicates.
 
33,397
9,122
The above function is indeed monotonic but does not return a unique value for each triplet
It does if x,y,z are integers from 0 to N inclusively (or 1 to N, doesn't matter here).

It is a simple numbering, row by row, column by column, layer by layer in 3D space.
 
192
1
Thank you for the answers so far. The above function is indeed monotonic but does not return a unique value for each triplet. I tried
if(y <= z)
r = 3*N*N*x + y+N*z+1;
else
r = 3*N*N*x + 3*N*y-z;
but it generates some duplicates.
You're right. It works. I had tried with
It does if x,y,z are integers from 0 to N inclusively (or 1 to N, doesn't matter here).

It is a simple numbering, row by row, column by column, layer by layer in 3D space.
You're right. It works! I had tried with N instead of N+1 and that failed. Thank you.
 

Want to reply to this thread?

"Monotonic spatial function" You must log in or register to reply here.

Related Threads for: Monotonic spatial function

  • Posted
Replies
5
Views
1K
  • Posted
Replies
1
Views
1K
Replies
2
Views
3K
Replies
6
Views
4K
Replies
11
Views
313
Replies
10
Views
16K
Replies
3
Views
1K
  • Posted
Replies
7
Views
1K

Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving

Hot Threads

Top