Abstract vector type.
- Available Extensions
- AddVectorExtension
- BinaryOperationVectorExtension
- CastVectorExtension
- ColumnMatrixExtension
- CompareVectorExtension
- ConvolutionVectorExtension
- DiagonalMatrixExtension
- DivVectorExtension
- DotVectorExtension
- IndexVectorExtension
- LerpVectorExtension
- MagnitudeVectorExtension
- MulVectorExtension
- NegVectorExtension
- OverlayVectorExtension
- RangeVectorExtension
- ReversedVectorExtension
- RowMatrixExtension
- SubVectorExtension
- SumVectorExtension
- TransformedVectorExtension
- UnaryOperationVectorExtension
- UnmodifiableVectorExtension
- VectorListExtension
Constructors
-
Vector(DataType<
T> dataType, int count, {VectorFormat? format}) -
Constructs a default vector of the desired
dataType
, the provided elementcount
, and possibly a customformat
.factory -
Vector.concat(DataType<
T> dataType, Iterable<Vector< vectors, {VectorFormat? format})T> > -
Returns the concatenation of
vectors
.factory -
Vector.constant(DataType<
T> dataType, int count, {T? value, VectorFormat? format}) -
Constructs a vector with a constant
value
.factory -
Vector.fromIterable(DataType<
T> dataType, Iterable<T> source, {VectorFormat? format}) -
Constructs a vector from an iterable. To enable efficient access
the data is always copied.
factory
-
Vector.fromList(DataType<
T> dataType, List<T> source, {VectorFormat? format}) -
Constructs a vector from a source list.
factory
-
Vector.generate(DataType<
T> dataType, int count, VectorGeneratorCallback<T> callback, {VectorFormat? format}) -
Generates a vector from calling a
callback
on every value.factory
Properties
- count → int
-
The dimensionality of this vector.
no setter
-
dataType
→ DataType<
T> -
Returns the data type of this vector.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
-
iterable
→ List<
T> -
Returns a list iterable over the vector.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
shape
→ List<
int> -
Returns the shape of this vector.
no setter
-
storage
→ Set<
Storage> -
Returns the underlying storage containers of this object.
no setterinherited
Methods
-
copyInto(
Vector< T> target) → Vector<T> - Returns the target vector with all elements of this vector copied into it.
-
forEach(
void callback(int index, T value)) → void - Iterates over each value in the vector. Skips over default values, which can be done very efficiently on sparse vectors.
-
format(
{Printer< T> ? valuePrinter, Printer<String> ? paddingPrinter, Printer<String> ? ellipsesPrinter, bool limit = true, int leadingItems = 3, int trailingItems = 3, String separator = ' ', String ellipses = '\u2026'}) → String - Returns a human readable representation of the vector.
-
getUnchecked(
int index) → T -
Returns the scalar at the provided
index
. The behavior is undefined ifindex
is outside of bounds. -
isWithinBounds(
int index) → bool -
Tests if
index
is within the bounds of this vector. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setUnchecked(
int index, T value) → void -
Sets the scalar at the provided
index
tovalue
. The behavior is undefined ifindex
is outside of bounds. -
toString(
) → String -
Returns the string representation of this polynomial.
override
-
toVector(
{VectorFormat? format}) → Vector< T> - Creates a new Vector containing the same elements as this one.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator [](
int index) → T -
Returns the scalar at the provided
index
. -
operator []=(
int index, T value) → void -
Sets the scalar at the provided
index
tovalue
.