Table of Contents

Struct Vector

Namespace
NominalSystems
Assembly
NominalSystems.Core.dll

Represents a vector or array of numbers (or a matrix with 1 row or 1 column).


public struct Vector : IEnumerable<double>, IEnumerable
Implements

Constructors

Vector()

Creates a zero-initialized vector.

public Vector()

Vector(in Vector)

Creates a deep-copy from another vector.

public Vector(in Vector other)

Parameters

other Vector

Vector(double[])

Creates and initializes all vector values.

public Vector(double[] values)

Parameters

values double[]

Vector(int)

Creates a vector with the specified size.

public Vector(int size)

Parameters

size int

Vector(uint)

Creates a vector with the specified size.

public Vector(uint size)

Parameters

size uint

Properties

this[int]

public readonly double this[int i] { get; set; }

Parameters

i int

Property Value

double

this[uint]

public readonly double this[uint i] { get; set; }

Parameters

i uint

Property Value

double

Size

The total number of elements.

public readonly uint Size { get; }

Property Value

uint

Methods

Equals(object)

public override readonly bool Equals(object obj)

Parameters

obj object

Returns

bool

Equals(object, in double)

public readonly bool Equals(object obj, in double precision)

Parameters

obj object

The object to compare.

precision double

The precision error.

Returns

bool

GetEnumerator()

public readonly IEnumerator<double> GetEnumerator()

Returns

IEnumerator<double>

GetHashCode()

public override readonly int GetHashCode()

Returns

int

ToString()

public override readonly string ToString()

Returns

string

ToString(string)

public readonly string ToString(string fmt)

Parameters

fmt string

A numeric format string.

Returns

string

Operators

operator +(in Vector, in Vector)

Returns the addition of a vector with another vector.

public static Vector operator +(in Vector a, in Vector b)

Parameters

a Vector
b Vector

Returns

Vector

operator +(in Vector, in double)

Returns the addition of a vector with a number.

public static Vector operator +(in Vector a, in double b)

Parameters

a Vector
b double

Returns

Vector

operator +(in double, in Vector)

Returns the addition of a number with a vector.

public static Vector operator +(in double a, in Vector b)

Parameters

a double
b Vector

Returns

Vector

operator /(in Vector, in Vector)

Returns the division of a vector with another vector.

public static Vector operator /(in Vector a, in Vector b)

Parameters

a Vector
b Vector

Returns

Vector

operator /(in Vector, in double)

Returns the division of a vector with a number.

public static Vector operator /(in Vector a, in double b)

Parameters

a Vector
b double

Returns

Vector

operator /(in double, in Vector)

Returns the division of a number with a vector.

public static Vector operator /(in double a, in Vector b)

Parameters

a double
b Vector

Returns

Vector

operator ==(in Vector, in Vector)

Returns true if all values in a vector are equal to another vector.

public static bool operator ==(in Vector a, in Vector b)

Parameters

a Vector
b Vector

Returns

bool

operator ==(in Vector, in double)

Returns true if all values in a vector are equal to a number.

public static bool operator ==(in Vector a, in double b)

Parameters

a Vector
b double

Returns

bool

operator ==(in double, in Vector)

Returns true if a number is equal to all values in a vector.

public static bool operator ==(in double a, in Vector b)

Parameters

a double
b Vector

Returns

bool

explicit operator Vector(in Vector2)

Returns the explicit conversion of a Vector2 to a Vector.

public static explicit operator Vector(in Vector2 a)

Parameters

a Vector2

Returns

Vector

explicit operator Vector(in Vector3)

Returns the explicit conversion of a Vector3 to a Vector.

public static explicit operator Vector(in Vector3 a)

Parameters

a Vector3

Returns

Vector

explicit operator Vector(in Vector4)

Returns the explicit conversion of a Vector4 to a Vector.

public static explicit operator Vector(in Vector4 a)

Parameters

a Vector4

Returns

Vector

operator >(in Vector, in double)

Returns true if all values in a vector are greater than a number.

public static bool operator >(in Vector a, in double b)

Parameters

a Vector
b double

Returns

bool

operator >(in double, in Vector)

Returns true if a number is greater than all values in a vector.

public static bool operator >(in double a, in Vector b)

Parameters

a double
b Vector

Returns

bool

operator >=(in Vector, in double)

Returns true if all values in a vector are greater than or equal to a number.

public static bool operator >=(in Vector a, in double b)

Parameters

a Vector
b double

Returns

bool

operator >=(in double, in Vector)

Returns true if a number is greater than or equal to all values in a vector.

public static bool operator >=(in double a, in Vector b)

Parameters

a double
b Vector

Returns

bool

operator !=(in Vector, in Vector)

Returns true if all values in a vector are not equal to another vector.

public static bool operator !=(in Vector a, in Vector b)

Parameters

a Vector
b Vector

Returns

bool

operator !=(in Vector, in double)

Returns true if all values in a vector are not equal to a number.

public static bool operator !=(in Vector a, in double b)

Parameters

a Vector
b double

Returns

bool

operator !=(in double, in Vector)

Returns true if a number is not equal to all values in a vector.

public static bool operator !=(in double a, in Vector b)

Parameters

a double
b Vector

Returns

bool

operator <(in Vector, in double)

Returns true if all values in a vector are less than a number.

public static bool operator <(in Vector a, in double b)

Parameters

a Vector
b double

Returns

bool

operator <(in double, in Vector)

Returns true if a number is less than all values in a vector.

public static bool operator <(in double a, in Vector b)

Parameters

a double
b Vector

Returns

bool

operator <=(in Vector, in double)

Returns true if all values in a vector are less than or equal to a number.

public static bool operator <=(in Vector a, in double b)

Parameters

a Vector
b double

Returns

bool

operator <=(in double, in Vector)

Returns true if a number is less than or equal to all values in a vector.

public static bool operator <=(in double a, in Vector b)

Parameters

a double
b Vector

Returns

bool

operator *(in Vector, in Vector)

Returns the multiplication of a vector with another vector.

public static Vector operator *(in Vector a, in Vector b)

Parameters

a Vector
b Vector

Returns

Vector

operator *(in Vector, in double)

Returns the multiplication of a vector with a number.

public static Vector operator *(in Vector a, in double b)

Parameters

a Vector
b double

Returns

Vector

operator *(in double, in Vector)

Returns the multiplication of a number with a vector.

public static Vector operator *(in double a, in Vector b)

Parameters

a double
b Vector

Returns

Vector

operator -(in Vector, in Vector)

Returns the subtraction of a vector with another vector.

public static Vector operator -(in Vector a, in Vector b)

Parameters

a Vector
b Vector

Returns

Vector

operator -(in Vector, in double)

Returns the subtraction of a vector with a number.

public static Vector operator -(in Vector a, in double b)

Parameters

a Vector
b double

Returns

Vector

operator -(in double, in Vector)

Returns the subtraction of a number with a vector.

public static Vector operator -(in double a, in Vector b)

Parameters

a double
b Vector

Returns

Vector

operator -(in Vector)

Returns the negation of all values in a vector.

public static Vector operator -(in Vector a)

Parameters

a Vector

Returns

Vector