NVector Structure

Represents a dense vector of integers, of arbitrary size.

Definition

Namespace: Austra.Library
Assembly: Austra.Library (in Austra.Library.dll) Version: 2.5.0+d1268756e036101f601080f153b3997e72fc912d
C#
public readonly struct NVector : IFormattable, 
	IEnumerable<int>, IEnumerable, IEquatable<NVector>, IEqualityOperators<NVector, NVector, bool>, 
	IAdditionOperators<NVector, NVector, NVector>, IAdditionOperators<NVector, int, NVector>, 
	ISubtractionOperators<NVector, NVector, NVector>, ISubtractionOperators<NVector, int, NVector>, 
	IUnaryNegationOperators<NVector, NVector>, IMultiplyOperators<NVector, NVector, int>, 
	IMultiplyOperators<NVector, int, NVector>, ISafeIndexed, IVector, 
	IIndexable
Inheritance
Object    ValueType    NVector
Implements
IIndexable, ISafeIndexed, IVector, IEnumerableInt32, IEnumerable, IEquatableNVector, IFormattable, IAdditionOperatorsNVector, NVector, NVector, IAdditionOperatorsNVector, Int32, NVector, IEqualityOperatorsNVector, NVector, Boolean, IMultiplyOperatorsNVector, NVector, Int32, IMultiplyOperatorsNVector, Int32, NVector, ISubtractionOperatorsNVector, NVector, NVector, ISubtractionOperatorsNVector, Int32, NVector, IUnaryNegationOperatorsNVector, NVector

Remarks

NVector provides a thin wrapper around a one-dimensional array. Most method operations are non destructive, and return a new vector, at the cost of extra memory allocation.

Also, most methods are hardware accelerated, either by using managed references, SIMD operations or both. Memory pinning has been reduced to the minimum, for easing the garbage collector's work.

Constructors

NVector(Int32)Creates a vector of a given size.
NVector(Int32)Initializes a vector from an array.
NVector(NVector)Creates a vector by concatenating many vectors.
NVector(Int32, NVector)Creates a vector by concatenating a new value with a suffix vector.
NVector(Int32, Double)Initializes a vector from a scalar.
NVector(Int32, FuncInt32, NVector, Int32)Creates a vector using a formula to fill its items.
NVector(Int32, FuncInt32, Int32)Creates a vector using a formula to fill its items.
NVector(Int32, Int32)Initializes a vector from a scalar.
NVector(Int32, Random)Creates a vector filled with a uniform distribution generator.
NVector(NVector, NVector)Creates a vector by concatenating two vectors.
NVector(NVector, Int32)Creates a vector by concatenating a prefix vector with a new value.
NVector(Int32, Int32, Random)Creates a vector filled with a uniform distribution generator.
NVector(Int32, Int32, Int32, Random)Creates a vector filled with a uniform distribution generator.

Properties

FirstGets the first value in the vector.
IsInitializedHas the vector been properly initialized?
ItemIndexGets or sets the component at a given index.
ItemInt32Gets or sets the component at a given index.
ItemRangeExtracts a slice from the vector.
LastGets the last value in the vector.
LengthGets the dimensions of the vector.

Methods

AbsGets the absolute values of the vector's items.
AllChecks whether the predicate is satisfied by all items.
AnyChecks whether the predicate is satisfied by at least one item.
CloneCreates an identical vector.
ContainsChecks if the vector contains the given value.
DistinctReturns a new vector with the distinct values in the original one.
Equals(NVector)Checks if the provided argument is a vector with the same values.
Equals(Object)Checks if the provided argument is a vector with the same values.
(Overrides ValueTypeEquals(Object))
FilterCreates a new vector by filtering items with the given predicate.
FilterMapCreates a new vector by filtering and mapping at the same time.
Find(FuncInt32, Boolean)Returns all indexes satisfying a condition.
Find(Int32)Returns all indexes containing ocurrences of a value.
GetEnumeratorRetrieves an enumerator to iterate over components.
GetHashCodeReturns the hashcode for this vector.
(Overrides ValueTypeGetHashCode)
GetTypeGets the Type of the current instance.
(Inherited from Object)
IndexOf(Int32)Returns the zero-based index of the first occurrence of a value.
IndexOf(Int32, Int32)Returns the zero-based index of the first occurrence of a value.
InplaceAddInplace addition of two vectors.
InplaceNegateInplace negation of the vector.
InplaceSubInplace substraction of two vectors.
LongProductCalculates the product of the vector's items as a long integer.
Map Creates a new vector by transforming each item with the given function.
MapReal Creates a new real vector by transforming each item with the given function.
MaximumGets the item with the maximum value.
MinimumGets the item with the minimum value.
OnesCreates a vector with a given size, and fills it with ones.
PointwiseDividePointwise division.
PointwiseMultiplyPointwise multiplication.
ProductCalculates the product of the vector's items.
ReduceCreates an aggregate value by applying the reducer to each item.
ReverseCreates a reversed copy of the vector.
SafeThis Safe access to the vector's components. If the index is out of range, a zero is returned.
SortReturns a new vector with sorted values.
SortDescendingReturns a new vector with sorted values.
StatsGets statistics on the vector values.
SumCalculates the sum of the vector's items.
ToStringGets a textual representation of this vector.
(Overrides ValueTypeToString)
ToString(String, IFormatProvider)Gets a textual representation of this vector.
ToVectorConvert this vector to a vector of reals.
ZipCombines the common prefix of two vectors.

Operators

Addition(Int32, NVector)Adds a scalar to a vector.
Addition(NVector, NVector)Adds two vectors.
Addition(NVector, Int32)Adds a scalar to a vector.
Division(NVector, Int32)Divides a vector by a scalar value.
Equality(NVector, NVector)Compares two vectors for equality.
(NVector to Int32)Explicit conversion from vector to array.
(Int32 to NVector)Implicit conversion from an array to a vector.
Inequality(NVector, NVector)Compares two vectors for inequality.
Multiply(Int32, NVector)Multiplies a vector by a scalar value.
Multiply(NVector, NVector)Dot product of two vectors.
Multiply(NVector, Int32)Multiplies a vector by a scalar value.
Subtraction(Int32, NVector)Subtracts a vector from a scalar.
Subtraction(NVector, NVector)Subtracts two vectors.
Subtraction(NVector, Int32)Subtracts a scalar from a vector.
UnaryNegation(NVector)Negates a vector.

See Also