Vec Class

Implements common matrix and vector operations.

Definition

Namespace: Austra.Library.Helpers
Assembly: Austra.Library (in Austra.Library.dll) Version: 2.5.0+d1268756e036101f601080f153b3997e72fc912d
C#
public static class Vec
Inheritance
Object    Vec

Remarks

We have three matrix types: Matrix, LMatrix, and RMatrix, with common operations. On the other hand, matrices also belong to a vector space, so they share some code with DVector.

Properties

TERMINAL_COLUMNSNumber of characters in a line.

Methods

AbsTGets the absolute values of the array items.
AddT(SpanT, SpanT)Pointwise inplace sum of two equally sized spans.
AddT(SpanT, T, SpanT)Pointwise addition of a scalar to a span.
AddT(SpanT, SpanT, SpanT)Pointwise sum of two equally sized spans.
AllTChecks whether the predicate is satisfied by all items.
AMaxGets the item in a span with the maximum absolute value.
AMinGets the item in a span with the minimum absolute value.
AnyTChecks whether the predicate is satisfied by at least one item.
CreateDiagonalCreates a diagonal matrix given its diagonal.
CreateIdentityCreates an identity matrix given a size.
CreateRandom(SpanDouble, NormalRandom)Initializes a span with normal random values.
CreateRandom(SpanDouble, Random)Initializes a span with random values.
CreateRandom(SpanDouble, Random, Double, Double)Initializes a span with random values.
DeconstructDeconstruct a complex number into its real and imaginary parts.
DetGets the product of the cells in the main diagonal.
DiagonalGets the main diagonal of a 1D-array.
DistanceComputes the maximum difference between two arrays.
DistinctTReturns a new array with the distinct values in the span.
Div(SpanInt32, Int32)Pointwise division of a span by an integer.
DivT(SpanT, SpanT)Pointwise division of two equally sized spans.
Dot(SpanDouble, SpanDouble)Calculates the dot product of two spans.
Dot(SpanInt32, SpanInt32)Calculates the dot product of two spans.
EqsTChecks two arrays for equality.
FilterTCreates a new array by filtering items with the given predicate.
FilterMapTCreates a new vector by filtering and mapping at the same time.
IndexOfTReturns the zero-based index of the first occurrence of a value.
MapT Creates a new array by transforming each item with the given function.
MaxTGets the item with the maximum value in the array.
MinTGets the item with the minimum value in the array.
MulT(SpanT, SpanT)Pointwise multiplication of two equally sized spans.
MulT(SpanT, T, SpanT)Pointwise multiplication of a span and a scalar.
MulAddStore Multiplies a span by a scalar and sums the result to a memory location.
MulNegStore Multiplies a span by a scalar and subtracts the result to a memory location.
NegT(SpanT)Inplace pointwise negation of a span.
NegT(SpanT, SpanT)Pointwise negation of a span.
ProductTCalculates the product of the items of an array.
ReduceTCreates an aggregate value by applying the reducer to each item.
ReverseTCreates a reversed copy of an array.
SortTCreates a new array with sorted values.
SortDescendingTCreates a new array with sorted values.
SubT(SpanT, SpanT)Pointwise inplace subtraction of two equally sized spans.
SubT(SpanT, T, SpanT)Pointwise subtraction of a scalar from a span.
SubT(SpanT, SpanT, SpanT)Pointwise subtraction of two equally sized spans.
SubT(T, SpanT, SpanT)Pointwise subtraction of a span from a scalar.
SumTCalculates the sum of the vector's items.
ToString(Double, Int32, Int32, FuncDouble, String, SByte)Gets a text representation of a matrix.
ToStringT(T, FuncT, String)Gets a text representation of an array.
TraceCalculates the trace of a 1D-array.
TransposeIn-place transposition of a square matrix.
ZipTCombines the common prefix of two spans.

See Also