共用方式為


index::index Constructor

Initializes a new instance of the index class.

index() restrict(amp,cpu);

index(
   const index<_Rank>& _Other
) restrict(amp,cpu);

explicit index(
   int _I
) restrict(amp,cpu);

index(
   int _I0,
   int _I1
) restrict(amp,cpu);

index(
   int _I0,
   int _I1,
   int _I2
) restrict(amp,cpu);

explicit index(
   const int _Array[_Rank]
) restrict(amp,cpu);

Parameters

  • _Array
    A one-dimensional array with the rank values.

  • _I
    The index location in a one-dimensional index.

  • _I0
    The length of the most significant dimension.

  • _I1
    The length of the next-to-most-significant dimension.

  • _I2
    The length of the least significant dimension.

  • _Other
    An index object on which the new index object is based.

Overloads

Name

Definition

index() restrict(cpu, amp);

Initializes a new instance of the index class, setting the value at each dimension to zero. For example, index<3> ix; initializes the variable to the location (0,0,0).

index( const index<_Rank>& _Other ) restrict(cpu, amp);

Initializes a new instance of the index class by copying the specified index object.

explicit index( int _I ) restrict(cpu, amp);

index( int _I0, int _I1 ) restrict(cpu, amp);

index( int _I0, int _I1, int _I2 ) restrict(cpu, amp);

Initializes a new instance of the index class, using the specified coordinate value or values. These constructors are valid only when the rank of the index is 1, 2, or 3. Using an incompatible rank when invoking one of these constructors causes a compilation error.

explicit index( const int _Array[_Rank] ) restrict(cpu, amp);

Initializes a new instance of the index class, using the coordinate values that are in the specified array. If the length of the array isn't equal to the rank of the index, the behavior is undefined. If the array value is NULL or is not a valid pointer, the behavior is undefined.

Requirements

Header: amp.h

Namespace: Concurrency

See Also

Reference

index Class