Condividi tramite


TensorPrimitives.ConvertTruncating<TFrom,TTo> Metodo

Definizione

Copia source in destination, convertendo ogni valore TFrom in un valore TTo.

public:
generic <typename TFrom, typename TTo>
 where TFrom : System::Numerics::INumberBase<TFrom> where TTo : System::Numerics::INumberBase<TTo> static void ConvertTruncating(ReadOnlySpan<TFrom> source, Span<TTo> destination);
public static void ConvertTruncating<TFrom,TTo> (ReadOnlySpan<TFrom> source, Span<TTo> destination) where TFrom : System.Numerics.INumberBase<TFrom> where TTo : System.Numerics.INumberBase<TTo>;
static member ConvertTruncating : ReadOnlySpan<'From (requires 'From :> System.Numerics.INumberBase<'From>)> * Span<'o (requires 'o :> System.Numerics.INumberBase<'o>)> -> unit (requires 'From :> System.Numerics.INumberBase<'From> and 'o :> System.Numerics.INumberBase<'o>)
Public Shared Sub ConvertTruncating(Of TFrom As INumberBase(Of TFrom), TTo As INumberBase(Of TFrom)) (source As ReadOnlySpan(Of TFrom), destination As Span(Of TTo))

Parametri di tipo

TFrom
TTo

Parametri

source
ReadOnlySpan<TFrom>

Intervallo di origine da cui copiare i valori.

destination
Span<TTo>

Intervallo di destinazione in cui devono essere scritti i valori convertiti.

Eccezioni

La destinazione è troppo breve.

Commenti

Questo metodo calcola in modo efficace destination[i] = TTo.CreateTruncating(source[i]).

Si applica a