此为 Mathematica 8 文档,内容基于更早版本的 Wolfram 语言
查看最新文档(版本11.1)

CUDAClamp

CUDAClamp[lst]
clamps the values of lst between automatically determined values.

clamps the values of lst between low and high.
  • The CUDALink application must be loaded using Needs.
  • works only on general types such as , , ....
  • does not work on fixed vector structure types like , , ....
  • does not work on symbolic input.
  • If low and high are not specified, then low is and high is if the input is floating point. If the input is integers, then low is and high is .
First, load the CUDALink application:
This clamps the values of an integer list:
The above is equivalent to Map:
The clamp values can be made explicit:
The input can be floating point:
The input can be an image, which is interpreted as a list of integers:
The high clamp parameter can be omitted:
The input can be CUDAMemory. This loads a list using CUDAMemoryLoad:
This clamps the values between and :
The memory returned can be retrieved using CUDAMemoryGet:
First, load the CUDALink application:
In[1]:=
Click for copyable input
This clamps the values of an integer list:
In[2]:=
Click for copyable input
Out[2]=
The above is equivalent to Map:
In[3]:=
Click for copyable input
Out[3]=
 
The clamp values can be made explicit:
In[1]:=
Click for copyable input
Out[1]=
 
The input can be floating point:
In[1]:=
Click for copyable input
Out[1]=
 
The input can be an image, which is interpreted as a list of integers:
In[1]:=
Click for copyable input
Out[1]=
The high clamp parameter can be omitted:
In[2]:=
Click for copyable input
Out[2]=
 
The input can be CUDAMemory. This loads a list using CUDAMemoryLoad:
In[1]:=
Click for copyable input
Out[1]=
This clamps the values between and :
In[2]:=
Click for copyable input
Out[2]=
The memory returned can be retrieved using CUDAMemoryGet:
In[3]:=
Click for copyable input
Out[3]=
can be used to process geographic elevation data. This loads the data from the Wolfram servers:
This clamps the values of the elevation data:
This allows the user to interactively change the clamp values:
The same can be applied for datasets: