Vector<T>.constant constructor
Vector<T>.constant (
- DataType<
T> dataType, - int count, {
- T? value,
- VectorFormat? format,
Constructs a vector with a constant value
.
If format
is specified the resulting vector is mutable, otherwise this
is a read-only view.
Implementation
factory Vector.constant(DataType<T> dataType, int count,
{T? value, VectorFormat? format}) {
final result =
ConstantVector<T>(dataType, count, value ?? dataType.defaultValue);
return format == null ? result : result.toVector(format: format);
}