![](../icons/Help.png) | Slice Class |
Class Slice represents a collection of indices that can be used to view
a subset of data from another data structure. A slice is defined by a starting
index, a total number of elements, and a step increment called the stride.
Inheritance Hierarchy Namespace: CenterSpace.NMath.CoreAssembly: NMath (in NMath.dll) Version: 7.4
Syntax[SerializableAttribute]
public class Slice : ICloneable
<SerializableAttribute>
Public Class Slice
Implements ICloneable
[SerializableAttribute]
public ref class Slice : ICloneable
[<SerializableAttribute>]
type Slice =
class
interface ICloneable
end
The Slice type exposes the following members.
Constructors | Name | Description |
---|
![Protected method Protected method](../icons/protMethod.gif) | Slice |
Default constructor.
|
![Public method Public method](../icons/pubMethod.gif) | Slice(Int32, Int32) |
Constructs a Slice instance with the specified starting index, total number of
elements, and default stride of 1.
|
![Public method Public method](../icons/pubMethod.gif) | Slice(Int32, Int32, Int32) |
Constructs a Slice instance with the specified starting index, total number of
elements, and stride.
|
Top
Properties | Name | Description |
---|
![Public property Public property](../icons/pubProperty.gif) ![Static member Static member](../icons/Static.gif) | All |
Gets a new Slice indexing all.
|
![Public property Public property](../icons/pubProperty.gif) | End |
Gets the end data element.
|
![Public property Public property](../icons/pubProperty.gif) | NumElements |
Gets the total number of data elements.
|
![Public property Public property](../icons/pubProperty.gif) | Start |
Gets the starting data element.
|
![Public property Public property](../icons/pubProperty.gif) | Stride |
Gets the step increment between successive data elements.
|
Top
Methods | Name | Description |
---|
![Public method Public method](../icons/pubMethod.gif) | Begin |
Calculates the starting element of this slice.
|
![Public method Public method](../icons/pubMethod.gif) | Clone |
Creates a deep copy of this slice.
|
![Public method Public method](../icons/pubMethod.gif) | Length |
Calculates the length of this slice.
|
![Public method Public method](../icons/pubMethod.gif) | Set(Int32, Position, Int32) |
Sets the specified starting index, a Position value indicating the end of the data, and
a specified stride.
|
![Public method Public method](../icons/pubMethod.gif) | Set(Int32, Int32, Int32) |
Sets the the specified starting index, total number of elements, and stride
for this slice.
|
![Public method Public method](../icons/pubMethod.gif) | Set(Position, Position, Int32) |
Sets the specified start and end positions and a stride.
|
![Public method Public method](../icons/pubMethod.gif) | Set(Position, Int32, Int32) |
Sets the specified position from which to start, the end index and a stride.
|
Top
Fields | Name | Description |
---|
![Protected field Protected field](../icons/protField.gif) ![Static member Static member](../icons/Static.gif) | DEFAULT_STRIDE |
The default stride is 1.
|
![Protected field Protected field](../icons/protField.gif) | end_ |
The end of the data.
|
![Protected field Protected field](../icons/protField.gif) | numElements_ |
The total number of data elements.
|
![Protected field Protected field](../icons/protField.gif) | start_ |
The start of the data.
|
![Protected field Protected field](../icons/protField.gif) | stride_ |
The step increment between successive elements in the data.
|
Top
Example
For example, a slice could be the third column of a matrix or the first ten elements
of a vector.
See Also