DVector Structure

Represents a dense vector of double values, of arbitrary size.

Definition

Namespace: Austra.Library
Assembly: Austra.Library (in Austra.Library.dll) Version: 2.5.0+44e7797405725ef3cf24b3ff0eba94ce6c649601
C#
public readonly struct DVector : IFormattable, 
	IEnumerable<double>, IEnumerable, IEquatable<DVector>, 
	IEqualityOperators<DVector, DVector, bool>, IAdditionOperators<DVector, DVector, DVector>, 
	IAdditionOperators<DVector, double, DVector>, ISubtractionOperators<DVector, DVector, DVector>, 
	ISubtractionOperators<DVector, double, DVector>, IMultiplyOperators<DVector, DVector, double>, 
	IMultiplyOperators<DVector, double, DVector>, IDivisionOperators<DVector, double, DVector>, 
	IUnaryNegationOperators<DVector, DVector>, IPointwiseOperators<DVector>, 
	ISafeIndexed, IVector, IIndexable
Inheritance
Object    ValueType    DVector
Implements
IIndexable, IPointwiseOperatorsDVector, ISafeIndexed, IVector, IEnumerableDouble, IEnumerable, IEquatableDVector, IFormattable, IAdditionOperatorsDVector, DVector, DVector, IAdditionOperatorsDVector, Double, DVector, IDivisionOperatorsDVector, Double, DVector, IEqualityOperatorsDVector, DVector, Boolean, IMultiplyOperatorsDVector, DVector, Double, IMultiplyOperatorsDVector, Double, DVector, ISubtractionOperatorsDVector, DVector, DVector, ISubtractionOperatorsDVector, Double, DVector, IUnaryNegationOperatorsDVector, DVector

Remarks

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

Methods like MultiplyAdd(DVector, DVector) save memory by reusing intermediate storage, and also time by using SIMD fused multiply-add instructions.

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

DVector(Double)Initializes a vector from an array.
DVector(DVector)Creates a vector by concatenating many vectors.
DVector(Int32)Creates a vector of a given size.
DVector(Double, DVector)Creates a vector by concatenating a new value with a suffix vector.
DVector(DVector, DVector)Creates a vector by concatenating two vectors.
DVector(DVector, Double)Creates a vector by concatenating a prefix vector with a new value.
DVector(Int32, NormalRandom)Creates a vector filled with a normal distribution generator.
DVector(Int32, Double)Initializes a vector from a scalar.
DVector(Int32, FuncInt32, DVector, Double)Creates a vector using a formula to fill its items.
DVector(Int32, FuncInt32, Double)Creates a vector using a formula to fill its items.
DVector(Int32, Random)Creates a vector filled with a uniform distribution generator.
DVector(Int32, Random, Double, Double)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.
ACFComputes autocorrelation for all lags.
AllChecks whether the predicate is satisfied by all items.
AMaxGets the cell with the maximum absolute value.
AMinGets the cell with the minimum absolute value.
AnyChecks whether the predicate is satisfied by at least one item.
ARModelCreates an AR model from a vector and a degree.
AutoCorrelationComputes the autocorrelation for a fixed lag.
AutoRegressionFinds the coefficients for an autoregressive model.
CloneCreates an identical vector.
CombineLow-level method to linearly combine vectors with weights.
Combine2Low-level method to linearly combine two vectors with weights.
ContainsChecks if the vector contains the given value.
CorrelogramComputes autocorrelation for a range of lags.
DistanceComputes the maximum difference between cells.
DistinctReturns a new vector with the distinct values in the original one.
Equals(DVector)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))
Equals(DVector, DVector, Double)Compares two vectors for equality within a tolerance.
FftComputes the real discrete Fourier transform.
FilterCreates a new vector by filtering items with the given predicate.
FilterMapCreates a new vector by filtering and mapping at the same time.
Find(Double)Returns all indexes containing ocurrences of a value.
Find(FuncDouble, Boolean)Returns all indexes satisfying a condition.
FullLinearModelCreates a linear model a set of predictors.
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(Double)Returns the zero-based index of the first occurrence of a value.
IndexOf(Double, 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.
LinearModelMultilinear regression based in Ordinary Least Squares.
MAModelCreates an MA model from a vector and a degree.
Map Creates a new vector by transforming each item with the given function.
MaximumGets the item with the maximum value.
MeanComputes the mean of the vector's items.
MinimumGets the item with the minimum value.
MovingAverageFinds the coefficients for a moving average model.
MultiplyAdd(Double, DVector)Optimized vector multiplication and addition.
MultiplyAdd(DVector, DVector)Optimized vector multiplication and addition.
MultiplySubtract(Double, DVector)Optimized vector scaling and subtraction.
MultiplySubtract(DVector, DVector)Optimized vector multiplication and subtraction.
NormGets the Euclidean norm of this vector.
PACFComputes the partial autocorrelation for all lags.
PACFRawComputes the partial autocorrelation for all lags.
PlotCreates a plot for this vector.
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.
SqrtPointwise squared root.
SquaredGets the squared norm of this vector.
StatsGets statistics on the vector values.
SubtractMultiplyOptimized subtraction of scaled vector.
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.
ZipCombines the common prefix of two vectors.

Operators

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

Extension Methods

CreateDiagonalCreates a diagonal matrix given its diagonal.
(Defined by Vec)

See Also