Click or drag to resize

DVector Structure

Represents a dense vector of double values, of arbitrary size.
Inheritance Hierarchy
SystemObject
  SystemValueType
    Austra.LibraryDVector

Namespace: Austra.Library
Assembly: Austra.Library (in Austra.Library.dll) Version: 2.7.0+6baf2f2fa1d256420275372aea03344dd79bdd55
Syntax
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

The DVector type exposes the following members.

Constructors
 NameDescription
Public methodDVector(Double)Initializes a vector from an array.
Public methodDVector(DVector)Creates a vector by concatenating many vectors.
Public methodDVector(Int32)Creates a vector of a given size.
Public methodDVector(Csv, Int32) Creates a vector by reading a column from a CSV file. The column is identified by its name.
Public methodDVector(Csv, String) Creates a vector by reading a column from a CSV file. The column is identified by its name.
Public methodDVector(Double, DVector)Creates a vector by concatenating a new value with a suffix vector.
Public methodDVector(DVector, DVector)Creates a vector by concatenating two vectors.
Public methodDVector(DVector, Double)Creates a vector by concatenating a prefix vector with a new value.
Public methodDVector(Int32, NormalRandom)Creates a vector filled with a normal distribution generator.
Public methodDVector(Int32, Double)Initializes a vector from a scalar.
Public methodDVector(Int32, FuncInt32, DVector, Double)Creates a vector using a formula to fill its items.
Public methodDVector(Int32, FuncInt32, Double)Creates a vector using a formula to fill its items.
Public methodDVector(Int32, Random)Creates a vector filled with a uniform distribution generator.
Public methodDVector(Int32, Random, Double, Double)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 methodACFComputes autocorrelation for all lags.
Public methodAllChecks whether the predicate is satisfied by all items.
Public methodAMaxGets the cell with the maximum absolute value.
Public methodAMinGets the cell with the minimum absolute value.
Public methodAnyChecks whether the predicate is satisfied by at least one item.
Public methodARModelCreates an AR model from a vector and a degree.
Public methodAutoCorrelationComputes the autocorrelation for a fixed lag.
Public methodAutoRegressionFinds the coefficients for an autoregressive model.
Public methodCloneCreates an identical vector.
Public methodStatic memberCombineLow-level method to linearly combine vectors with weights.
Public methodStatic memberCombine2Low-level method to linearly combine two vectors with weights.
Public methodContainsChecks if the vector contains the given value.
Public methodCorrelogramComputes autocorrelation for a range of lags.
Public methodDistanceComputes the maximum difference between cells.
Public methodDistinctReturns a new vector with the distinct values in the original one.
Public methodEquals(DVector)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 methodStatic memberEquals(DVector, DVector, Double)Compares two vectors for equality within a tolerance.
Public methodFftComputes the real discrete Fourier transform.
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(Double)Returns all indexes containing ocurrences of a value.
Public methodFind(FuncDouble, Boolean)Returns all indexes satisfying a condition.
Public methodFullLinearModelCreates a linear model a set of predictors.
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(Double)Returns the zero-based index of the first occurrence of a value.
Public methodIndexOf(Double, 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 methodLinearModelMultilinear regression based in Ordinary Least Squares.
Public methodMAModelCreates an MA model from a vector and a degree.
Public methodMap Creates a new vector by transforming each item with the given function.
Public methodMaximumGets the item with the maximum value.
Public methodMeanComputes the mean of the vector's items.
Public methodMinimumGets the item with the minimum value.
Public methodMovingAverageFinds the coefficients for a moving average model.
Public methodMultiplyAdd(Double, DVector)Optimized vector multiplication and addition.
Public methodMultiplyAdd(DVector, DVector)Optimized vector multiplication and addition.
Public methodMultiplySubtract(Double, DVector)Optimized vector scaling and subtraction.
Public methodMultiplySubtract(DVector, DVector)Optimized vector multiplication and subtraction.
Public methodNormGets the Euclidean norm of this vector.
Public methodPACFComputes the partial autocorrelation for all lags.
Public methodPACFRawComputes the partial autocorrelation for all lags.
Public methodPlotCreates a plot for this vector.
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 methodSqrtPointwise squared root.
Public methodSquaredGets the squared norm of this vector.
Public methodStatsGets statistics on the vector values.
Public methodSubtractMultiplyOptimized subtraction of scaled vector.
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 methodZipCombines the common prefix of two vectors.
Top
Operators
 NameDescription
Public operatorStatic memberAddition(Double, DVector)Adds a scalar to a vector.
Public operatorStatic memberAddition(DVector, DVector)Adds two vectors.
Public operatorStatic memberAddition(DVector, Double)Adds a scalar to a vector.
Public operatorStatic memberDivision(DVector, Double)Divides a vector by a scalar value.
Public operatorStatic memberEquality(DVector, DVector)Compares two vectors for equality.
Public operatorStatic memberExclusiveOr(DVector, DVector)The external product of two vectors.
Public operatorStatic member(DVector to Double)Explicit conversion from vector to array.
Public operatorStatic member(Double to DVector)Implicit conversion from an array to a vector.
Public operatorStatic memberInequality(DVector, DVector)Compares two vectors for inequality.
Public operatorStatic memberMultiply(Double, DVector)Multiplies a vector by a scalar value.
Public operatorStatic memberMultiply(DVector, DVector)Dot product of two vectors.
Public operatorStatic memberMultiply(DVector, Double)Multiplies a vector by a scalar value.
Public operatorStatic memberSubtraction(Double, DVector)Subtracts a vector from a scalar.
Public operatorStatic memberSubtraction(DVector, DVector)Subtracts two vectors.
Public operatorStatic memberSubtraction(DVector, Double)Subtracts a scalar from a vector.
Public operatorStatic memberUnaryNegation(DVector)Negates a vector.
Top
Extension Methods
 NameDescription
Public Extension MethodCreateDiagonalCreates a diagonal matrix given its diagonal.
(Defined by Vec)
Top
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.

See Also