CUDALink`
CUDALink`

CUDAClamp

CUDAClamp[lst]

clamps the values of lst between automatically determined values.

CUDAClamp[lst,low,high]

clamps the values of lst between low and high.

更多信息和选项更多信息
  • The CUDALink application must be loaded using Needs["CUDALink`"].
  • CUDAClamp works only on general types such as "Float", "Double", .
  • CUDAClamp does not work on fixed vector structure types like "Float[2]", "Integer32[2]", .
  • CUDAClamp does not work on symbolic input.
  • If low and high are not specified, then low is 0.0 and high is 1.0 if the input is floating point. If the input is integers, then low is 0 and high is 255.
  • 范例

    打开所有单元关闭所有单元

    基本范例  (5)

    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 -5 and 5:

    In[2]:=
    Click for copyable input
    Out[2]=

    The memory returned can be retrieved using CUDAMemoryGet:

    In[3]:=
    Click for copyable input
    Out[3]=

    Applications  (1)

    Interactive Examples  (2)

    参见

    CUDAImageConvolve  CUDAImageAdd  CUDAImageMultiply

    教程