Tensor<T> Explicit  Conversion Operators

Definition

Namespace: Numerics.NET.Tensors
Assembly: Numerics.NET.Tensors (in Numerics.NET.Tensors.dll) Version: 9.0.0

Overload List

Explicit(T to Tensor<T>) Implicitly converts a scalar value to a 0-dimensional scalar tensor.
Explicit(T[] to Tensor<T>) Implicitly converts an array to a 1-dimensional scalar tensor.
Explicit(T[,,] to Tensor<T>) Implicitly converts an array to a 3-dimensional scalar tensor.
Explicit(T[,] to Tensor<T>) Implicitly converts an array to a 2-dimensional scalar tensor.
Explicit(Tensor<T> to T) Converts a scalar (0-dimensional) tensor to the corresponding scalar value.

Explicit Conversion (T to Tensor<T>)

Implicitly converts a scalar value to a 0-dimensional scalar tensor.
C#
public static explicit operator Tensor<T> (
	T value
)

Parameters

value  T
The value to convert.

Return Value

Tensor<T>

Explicit Conversion (T[] to Tensor<T>)

Implicitly converts an array to a 1-dimensional scalar tensor.
C#
public static explicit operator Tensor<T> (
	T[] value
)

Parameters

value  T[]
The value to convert.

Return Value

Tensor<T>

Explicit Conversion (T[,] to Tensor<T>)

Implicitly converts an array to a 3-dimensional scalar tensor.
C#
public static explicit operator Tensor<T> (
	T[,,] value
)

Parameters

value  T[3]
The value to convert.

Return Value

Tensor<T>

Explicit Conversion (T[,] to Tensor<T>)

Implicitly converts an array to a 2-dimensional scalar tensor.
C#
public static explicit operator Tensor<T> (
	T[,] value
)

Parameters

value  T[2]
The value to convert.

Return Value

Tensor<T>

Explicit Conversion (Tensor<T> to T)

Converts a scalar (0-dimensional) tensor to the corresponding scalar value.
C#
public static explicit operator T (
	Tensor<T> value
)

Parameters

value  Tensor<T>
The tensor to convert.

Return Value

T

Exceptions

InvalidCastException

value does not have exactly one element.

See Also