Vector.Create Banded Method
Definition
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.3
Overload List
Create | Constructs a new BlockVector<T> with the specified length and non-zero range. |
Create | Constructs a new BlockVector<T> with the specified length and non-zero elements. |
CreateBanded<T>(Int32, Int32, Int32)
public static Vector<T> CreateBanded<T>(
int length,
int startIndex,
int endIndex
)
Parameters
- length Int32
- The length of the new BlockVector<T>.
- startIndex Int32
- The index of the first non-zero component of this vector.
- endIndex Int32
- The index of the last non-zero component of this vector
Type Parameters
- T
Return Value
Vector<T>Remarks
All components of the new vector are initially set to zero. Only the components with index greater than or equal to startIndex and less than or equal to endIndex can be modified.
Exceptions
Argument | length is less than zero. -or- startIndex is less than zero or greater than length. -or- startIndex is less than zero or greater than length. |
CreateBanded<T>(Int32, Int32, Int32, T[], Boolean, ArrayMutability)
public static Vector<T> CreateBanded<T>(
int length,
int startIndex,
int endIndex,
T[] values,
bool reuseValuesArray,
ArrayMutability mutability = ArrayMutability.Immutable
)
Parameters
- length Int32
- The number of elements in the new vector.
- startIndex Int32
- The index of the first non-zero component of this vector.
- endIndex Int32
- The index of the last non-zero component of this vector.
- values T[]
- An array that contains the elements of the new Vector<T>.
- reuseValuesArray Boolean
- Specifies whether the array values should be used for the new vector's internal storage.
- mutability ArrayMutability (Optional)
- Specifies how the vector's values may be changed. The default is mutable values.
Type Parameters
- T
Return Value
Vector<T>Remarks
The non-zero elements of the vector are initialized to the values contained in values. The first non-zero element, at index startIndex, is set to the first element of values.
Only the elements with index greater than or equal to startIndex and less than or equal to endIndex can be modified.
Exceptions
Argument | values is null. |
Argument | length is less than zero. -or- startIndex is less than zero or greater than length. -or- endIndex is less than zero or greater than length. |