Table of Contents

Struct VectorValue

Namespace
xFunc.Maths.Expressions.Matrices
Assembly
xFunc.Maths.dll

Represent the Vector value.

public readonly struct VectorValue : IEquatable<VectorValue>, IEnumerable<NumberValue>, IEnumerable
Implements
Inherited Members

Properties

this[int]

Gets the double at the specified index.

public NumberValue this[int index] { get; }

Parameters

index int

The index.

Property Value

NumberValue

The double.

Size

Gets the size of the current vector.

public int Size { get; }

Property Value

int

Methods

Abs(VectorValue)

Calculates the absolute value (norm) of vector.

public static object Abs(VectorValue vector)

Parameters

vector VectorValue

The vector.

Returns

object

Return the absolute value of vector.

Add(VectorValue, VectorValue)

Adds the right vector to the left vector.

public static VectorValue Add(VectorValue left, VectorValue right)

Parameters

left VectorValue

The left vector.

right VectorValue

The right vector.

Returns

VectorValue

The sum of matrices.

Exceptions

ArgumentException

The size of matrices is invalid.

Average()

Computes the average of a sequence of numeric values.

public NumberValue Average()

Returns

NumberValue

The average value.

Create(NumberValue)

Creates a new instance of VectorValue.

public static VectorValue Create(NumberValue value)

Parameters

value NumberValue

The item of a new vector.

Returns

VectorValue

The vector.

Create(params NumberValue[])

Creates a new instance of VectorValue.

public static VectorValue Create(params NumberValue[] array)

Parameters

array NumberValue[]

The array.

Returns

VectorValue

The vector.

Cross(VectorValue, VectorValue)

Computes the cross product of two vectors.

public static VectorValue Cross(VectorValue left, VectorValue right)

Parameters

left VectorValue

The multiplier vector.

right VectorValue

The multiplicand vector.

Returns

VectorValue

The cross product.

Equals(object?)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

Equals(VectorValue)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(VectorValue other)

Parameters

other VectorValue

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

GetEnumerator()

Returns an enumerator that iterates through the collection.

public IEnumerator<NumberValue> GetEnumerator()

Returns

IEnumerator<NumberValue>

An enumerator that can be used to iterate through the collection.

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

Mul(VectorValue, VectorValue)

Calculates ths dot product of two vectors.

public static NumberValue Mul(VectorValue left, VectorValue right)

Parameters

left VectorValue

The left vector.

right VectorValue

The right vector.

Returns

NumberValue

The dot product of vectors.

Exceptions

ArgumentException

The size of vectors is invalid.

Mul(VectorValue, NumberValue)

Multiplies vector by number.

public static VectorValue Mul(VectorValue vector, NumberValue number)

Parameters

vector VectorValue

The vector.

number NumberValue

The number.

Returns

VectorValue

The product of matrices.

Sub(VectorValue, VectorValue)

Subtracts the right vector from the left vector.

public static VectorValue Sub(VectorValue left, VectorValue right)

Parameters

left VectorValue

The left vector.

right VectorValue

The right vector.

Returns

VectorValue

The difference of matrices.

Exceptions

ArgumentException

The size of matrices is invalid.

Sum()

Computes the sum of a sequence of numeric values.

public NumberValue Sum()

Returns

NumberValue

The sum of the values in the vector.

ToArray()

Converts the current vector to an array.

public NumberValue[] ToArray()

Returns

NumberValue[]

The array.

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.

Transpose(VectorValue)

Transposes the specified vector.

public static MatrixValue Transpose(VectorValue vector)

Parameters

vector VectorValue

The vector.

Returns

MatrixValue

The transposed matrix.

Operators

operator +(VectorValue, VectorValue)

Adds two objects of VectorValue.

public static VectorValue operator +(VectorValue left, VectorValue right)

Parameters

left VectorValue

The first object to add.

right VectorValue

The second object to add.

Returns

VectorValue

An object that is the sum of left and right.

operator ==(VectorValue, VectorValue)

Determines whether two specified instances of VectorValue are equal.

public static bool operator ==(VectorValue left, VectorValue right)

Parameters

left VectorValue

The first object to compare.

right VectorValue

The second object to compare.

Returns

bool

true if left is equal to right; otherwise, false.

operator !=(VectorValue, VectorValue)

Determines whether two specified instances of VectorValue are not equal.

public static bool operator !=(VectorValue left, VectorValue right)

Parameters

left VectorValue

The first object to compare.

right VectorValue

The second object to compare.

Returns

bool

true if left is not equal to right; otherwise, false.

operator *(VectorValue, VectorValue)

Multiplies two objects of VectorValue.

public static NumberValue operator *(VectorValue left, VectorValue right)

Parameters

left VectorValue

The first object to multiply.

right VectorValue

The second object to multiply.

Returns

NumberValue

An object that is the product of left and right.

operator *(VectorValue, NumberValue)

Multiplies VectorValue and NumberValue.

public static VectorValue operator *(VectorValue left, NumberValue right)

Parameters

left VectorValue

The first object to multiply.

right NumberValue

The second object to multiply.

Returns

VectorValue

An object that is the product of left and right.

operator -(VectorValue, VectorValue)

Subtracts two objects of VectorValue.

public static VectorValue operator -(VectorValue left, VectorValue right)

Parameters

left VectorValue

The first object to sub.

right VectorValue

The second object to sub.

Returns

VectorValue

An object that is the difference of left and right.