Click or drag to resize

NVector Structure

Represents a dense vector of integers, of arbitrary size.
Inheritance Hierarchy
SystemObject
  SystemValueType
    Austra.LibraryNVector

Namespace: Austra.Library
Assembly: Austra.Library (in Austra.Library.dll) Version: 2.5.0+44e7797405725ef3cf24b3ff0eba94ce6c649601
Syntax
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

The NVector type exposes the following members.

Constructors
 NameDescription
Public methodNVector(Int32)Creates a vector of a given size.
Public methodNVector(Int32)Initializes a vector from an array.
Public methodNVector(NVector)Creates a vector by concatenating many vectors.
Public methodNVector(Int32, NVector)Creates a vector by concatenating a new value with a suffix vector.
Public methodNVector(Int32, Double)Initializes a vector from a scalar.
Public methodNVector(Int32, FuncInt32, NVector, Int32)Creates a vector using a formula to fill its items.
Public methodNVector(Int32, FuncInt32, Int32)Creates a vector using a formula to fill its items.
Public methodNVector(Int32, Int32)Initializes a vector from a scalar.
Public methodNVector(Int32, Random)Creates a vector filled with a uniform distribution generator.
Public methodNVector(NVector, NVector)Creates a vector by concatenating two vectors.
Public methodNVector(NVector, Int32)Creates a vector by concatenating a prefix vector with a new value.
Public methodNVector(Int32, Int32, Random)Creates a vector filled with a uniform distribution generator.
Public methodNVector(Int32, Int32, Int32, Random)Creates a vector filled with a uniform distribution generator.
Top
Properties
 NameDescription
Public propertyFirstGets the first value in the vector.
Public propertyIsInitializedHas the vector been properly initialized?
Public propertyItemIndexGets or sets the component at a given index.
Public propertyItemInt32Gets or sets the component at a given index.
Public propertyItemRangeExtracts a slice from the vector.
Public propertyLastGets the last value in the vector.
Public propertyLengthGets the dimensions of the vector.
Top
Methods
 NameDescription
Public methodAbsGets the absolute values of the vector's items.
Public methodAllChecks whether the predicate is satisfied by all items.
Public methodAnyChecks whether the predicate is satisfied by at least one item.
Public methodCloneCreates an identical vector.
Public methodContainsChecks if the vector contains the given value.
Public methodDistinctReturns a new vector with the distinct values in the original one.
Public methodEquals(NVector)Checks if the provided argument is a vector with the same values.
Public methodEquals(Object)Checks if the provided argument is a vector with the same values.
(Overrides ValueTypeEquals(Object))
Public methodFilterCreates a new vector by filtering items with the given predicate.
Public methodFilterMapCreates a new vector by filtering and mapping at the same time.
Public methodFind(FuncInt32, Boolean)Returns all indexes satisfying a condition.
Public methodFind(Int32)Returns all indexes containing ocurrences of a value.
Public methodGetEnumeratorRetrieves an enumerator to iterate over components.
Public methodGetHashCodeReturns the hashcode for this vector.
(Overrides ValueTypeGetHashCode)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodIndexOf(Int32)Returns the zero-based index of the first occurrence of a value.
Public methodIndexOf(Int32, Int32)Returns the zero-based index of the first occurrence of a value.
Public methodInplaceAddInplace addition of two vectors.
Public methodInplaceNegateInplace negation of the vector.
Public methodInplaceSubInplace substraction of two vectors.
Public methodLongProductCalculates the product of the vector's items as a long integer.
Public methodMap Creates a new vector by transforming each item with the given function.
Public methodMapReal Creates a new real vector by transforming each item with the given function.
Public methodMaximumGets the item with the maximum value.
Public methodMinimumGets the item with the minimum value.
Public methodStatic memberOnesCreates a vector with a given size, and fills it with ones.
Public methodPointwiseDividePointwise division.
Public methodPointwiseMultiplyPointwise multiplication.
Public methodProductCalculates the product of the vector's items.
Public methodReduceCreates an aggregate value by applying the reducer to each item.
Public methodReverseCreates a reversed copy of the vector.
Public methodSafeThis Safe access to the vector's components. If the index is out of range, a zero is returned.
Public methodSortReturns a new vector with sorted values.
Public methodSortDescendingReturns a new vector with sorted values.
Public methodStatsGets statistics on the vector values.
Public methodSumCalculates the sum of the vector's items.
Public methodToStringGets a textual representation of this vector.
(Overrides ValueTypeToString)
Public methodToString(String, IFormatProvider)Gets a textual representation of this vector.
Public methodToVectorConvert this vector to a vector of reals.
Public methodZipCombines the common prefix of two vectors.
Top
Operators
 NameDescription
Public operatorStatic memberAddition(Int32, NVector)Adds a scalar to a vector.
Public operatorStatic memberAddition(NVector, NVector)Adds two vectors.
Public operatorStatic memberAddition(NVector, Int32)Adds a scalar to a vector.
Public operatorStatic memberDivision(NVector, Int32)Divides a vector by a scalar value.
Public operatorStatic memberEquality(NVector, NVector)Compares two vectors for equality.
Public operatorStatic member(NVector to Int32)Explicit conversion from vector to array.
Public operatorStatic member(Int32 to NVector)Implicit conversion from an array to a vector.
Public operatorStatic memberInequality(NVector, NVector)Compares two vectors for inequality.
Public operatorStatic memberMultiply(Int32, NVector)Multiplies a vector by a scalar value.
Public operatorStatic memberMultiply(NVector, NVector)Dot product of two vectors.
Public operatorStatic memberMultiply(NVector, Int32)Multiplies a vector by a scalar value.
Public operatorStatic memberSubtraction(Int32, NVector)Subtracts a vector from a scalar.
Public operatorStatic memberSubtraction(NVector, NVector)Subtracts two vectors.
Public operatorStatic memberSubtraction(NVector, Int32)Subtracts a scalar from a vector.
Public operatorStatic memberUnaryNegation(NVector)Negates a vector.
Top
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.

See Also