Vector<T>.Try Cast<U> Method
Attempts to convert the elements of the vector to the specified type.
Definition
Namespace: Extreme.Mathematics
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23
C#
true if the conversion was successful; otherwise false.
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23
public bool TryCast<U>(
out Vector<U> result
)
Parameters
- result Vector<U>
- A vector containing the converted values.
Type Parameters
- U
- The type to convert the elements to.
Return Value
Booleantrue if the conversion was successful; otherwise false.
Remarks
If the type U is the same as the element type T of the vector, the same instance is returned. Otherwise, a copy is returned.