IVector.As<U> Method

Returns the object as a strongly typed vector of the specified type.

Definition

Namespace: Extreme.Mathematics
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23
C#
Vector<U> As<U>()

Type Parameters

U
The desired element type of the result.

Return Value

Vector<U>
The object converted to a vector with elements of type U.

Remarks

If the object is a vector whose element type is also U, the vector is returned without modification. Otherwise, an attempt is made to convert the elements to the specified type.

Exceptions

InvalidCastExceptionThe element type of the object cannot be converted to type U.

See Also