Vector Type

Vector implementation. This is thin wrapper over 1D array

Constructors

Constructor Description

Vector(elts)

Full Usage: Vector(elts)

Parameters:
    elts : float[] - Elements of array

Constructs vector from array of arguments

elts : float[]

Elements of array

Example

This creates vector with three elements -1,0,1. New array is allocated for this vector:

Vector v = new Vector(-1,0,1)
Next example creates vector that wraps specified array. Please note that no array copying is made thus changing of source array with change vector elements.
            double[] arr = new double[] { -1,0,1 };
            Vector v = new Vector(arr);

Instance members

Instance member Description

this.Abs

Full Usage: this.Abs

Returns: Vector Vector v1 such that for each i = 0...dim(v) v1[i] = |v[i]|

Returns a vector whose elements are the absolute values of the given vector elements

Returns: Vector

Vector v1 such that for each i = 0...dim(v) v1[i] = |v[i]|

this.Clone

Full Usage: this.Clone

Returns: Vector Copy of vector passes as parameter

Clones specified vector

Returns: Vector

Copy of vector passes as parameter

this.Equals

Full Usage: this.Equals

Parameters:
    obj : obj

Returns: bool
Modifiers: abstract

obj : obj
Returns: bool

this.EuclideanNorm

Full Usage: this.EuclideanNorm

Returns: float

Gets vector's Euclidean norm

Returns: float

this.GetHashCode

Full Usage: this.GetHashCode

Returns: int
Modifiers: abstract

Returns: int

this.[arg1]

Full Usage: this.[arg1]

Returns: int Value of vector element at specified index

Gets or sets vector element at specified index

Returns: int

Value of vector element at specified index

NullReferenceException Thrown when vector is not initialized
IndexOutOfRangeException Throws when idx is out of range

this.LInfinityNorm

Full Usage: this.LInfinityNorm

Returns: float

Gets L-infinity norm of the vector

Returns: float

this.Length

Full Usage: this.Length

Returns: int

Gets number of components in a vector

Returns: int
NullReferenceException Thrown when vector constructed by default constructor and not assigned yet

this.MulAdd

Full Usage: this.MulAdd

Parameters:
    v1 : Vector - Vector to add
    factor : float - Multiplication factor

Adds vector v1 multiplied by factor to this object.

v1 : Vector

Vector to add

factor : float

Multiplication factor

this.Sum

Full Usage: this.Sum

Returns: float

Gets vector's Euclidean norm

Returns: float

this.ToArray

Full Usage: this.ToArray

Returns: float[]

Copies vector to double[] array

Returns: float[]

this.ToString

Full Usage: this.ToString

Returns: string String consists from vector components separated by comma.
Modifiers: abstract

Convers vector to string representation.

Returns: string

String consists from vector components separated by comma.

this.v

Full Usage: this.v

Static members

Static member Description

a &&& b

Full Usage: a &&& b

Parameters:
Returns: Matrix Matrix with number of rows equals to first vector length and numbers of column equals to second vector length

Multiplies vector a[i] by vector b[j] and returns matrix with components a[i]*b[j]

a : Vector

First vector

b : Vector

Second vector

Returns: Matrix

Matrix with number of rows equals to first vector length and numbers of column equals to second vector length

m * v

Full Usage: m * v

Parameters:
Returns: Vector Product of Vector and matrix

Multiplies vector Vector by matrix

m : Matrix

Matrix

v : Vector

Vector

Returns: Vector

Product of Vector and matrix

v * m

Full Usage: v * m

Parameters:
Returns: Vector Result of multiplication

Implements multiplication of matrix by vector

v : Vector

Vector

m : Matrix

Matrix

Returns: Vector

Result of multiplication

v * a

Full Usage: v * a

Parameters:
    v : Vector - Vector
    a : float - Scalar

Returns: Vector Vector with all components multiplied by scalar

Multiplies a vector by a scalar (per component)

v : Vector

Vector

a : float

Scalar

Returns: Vector

Vector with all components multiplied by scalar

a * v

Full Usage: a * v

Parameters:
    a : float - Scalar
    v : Vector - Vector

Returns: Vector Vector with all components multiplied by scalar

Multiplies a vector by a scalar (per component)

a : float

Scalar

v : Vector

Vector

Returns: Vector

Vector with all components multiplied by scalar

a * b

Full Usage: a * b

Parameters:
Returns: float Result of scalar multiplication

Performs scalar multiplication of two vectors

a : Vector

First vector

b : Vector

Second vector

Returns: float

Result of scalar multiplication

v1 + v2

Full Usage: v1 + v2

Parameters:
Returns: Vector Sum of vectors

Sums two vectors. Vectors must have same length.

v1 : Vector

First vector

v2 : Vector

Second vector

Returns: Vector

Sum of vectors

v + c

Full Usage: v + c

Parameters:
    v : Vector - Vector
    c : float - Scalar to add

Returns: Vector Shifted vector

Add a scalar to a vector.

v : Vector

Vector

c : float

Scalar to add

Returns: Vector

Shifted vector

v1 - v2

Full Usage: v1 - v2

Parameters:
Returns: Vector Difference of two vectors

Substracts first vector from second. Vectors must have same length

v1 : Vector

First vector

v2 : Vector

Second vector

Returns: Vector

Difference of two vectors

v / a

Full Usage: v / a

Parameters:
    v : Vector - Vector
    a : float - Scalar

Returns: Vector Result of division

Divides vector by a scalar (per component)

v : Vector

Vector

a : float

Scalar

Returns: Vector

Result of division

a / b

Full Usage: a / b

Parameters:
    a : Vector - Numerator vector
    b : Vector - Denominator vector

Returns: Vector Result of scalar multiplication

Performs element-wise division of two vectors

a : Vector

Numerator vector

b : Vector

Denominator vector

Returns: Vector

Result of scalar multiplication

Vector.Copy(src, dst)

Full Usage: Vector.Copy(src, dst)

Parameters:
    src : Vector - Source vector
    dst : Vector - Vector to copy results

Copies content of one vector to another. Vectors must have same length.

src : Vector

Source vector

dst : Vector

Vector to copy results

Vector.GetEuclideanNorm(v1, v2)

Full Usage: Vector.GetEuclideanNorm(v1, v2)

Parameters:
Returns: float Euclidean norm of vector's difference

Returns Euclidean norm of difference between two vectors.

v1 : Vector

First vector

v2 : Vector

Second vector

Returns: float

Euclidean norm of vector's difference

Vector.GetLInfinityNorm(v1, v2)

Full Usage: Vector.GetLInfinityNorm(v1, v2)

Parameters:
Returns: float L-infinity norm of vector's difference

Returns L-infinity norm of difference between two vectors.

v1 : Vector

First vector

v2 : Vector

Second vector

Returns: float

L-infinity norm of vector's difference

Vector.Lerp(t, t0, v0, t1, v1)

Full Usage: Vector.Lerp(t, t0, v0, t1, v1)

Parameters:
    t : float - Point of intepolation
    t0 : float - First time point
    v0 : Vector - Vector at first time point
    t1 : float - Second time point
    v1 : Vector - Vector at second time point

Returns: Vector Intepolated vector value at point t

Performs linear intepolation between two vectors at specified point

t : float

Point of intepolation

t0 : float

First time point

v0 : Vector

Vector at first time point

t1 : float

Second time point

v1 : Vector

Vector at second time point

Returns: Vector

Intepolated vector value at point t

Vector.Max(v1, v2)

Full Usage: Vector.Max(v1, v2)

Parameters:
Returns: Vector vector v3 such that for each i = 0...dim(v1) v3[i] = max( v1[i], v2[i] )

Returns a vector each of whose elements is the maximal from the corresponding ones of argument vectors. Note that dimensions of the arguments must match.

v1 : Vector

First vector

v2 : Vector

Second vector

Returns: Vector

vector v3 such that for each i = 0...dim(v1) v3[i] = max( v1[i], v2[i] )

Vector.Zeros(n)

Full Usage: Vector.Zeros(n)

Parameters:
    n : int - Length of vector

Returns: Vector Constructed vector

Constructs vector of specified length filled with zeros

n : int

Length of vector

Returns: Vector

Constructed vector

op_Implicitv

Full Usage: op_Implicitv

Parameters:
Returns: float[]

v : Vector
Returns: float[]

op_Implicitv

Full Usage: op_Implicitv

Parameters:
Returns: float

v : Vector
Returns: float

op_Implicitv

Full Usage: op_Implicitv

Parameters:
    v : float[]

Returns: Vector

v : float[]
Returns: Vector

op_Implicitv

Full Usage: op_Implicitv

Parameters:
    v : float

Returns: Vector

v : float
Returns: Vector