| IGLib 1.6.0 The IGLib base library for development of numerical, technical and business applications.

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events
Public Member Functions | Static Public Member Functions | Properties | Static Private Attributes | List of all members
IG.Num.VectorBase Class Referenceabstract

Base class for real vectors. More...

Inheritance diagram for IG.Num.VectorBase:
[legend]
Collaboration diagram for IG.Num.VectorBase:
[legend]

## Public Member Functions
virtual double[] | ToArray ()
| Copies the current vector to an array. More...
abstract VectorBase | GetCopyBase ()
| Creates and returns a copy of the current vector. WARNING: This method should be overridden in the derived classes in such a way that the returned vector is of the same type as the current vector. More...
abstract VectorBase | GetNewBase (int length)
| Creates and returns a new vector of the specified dimension in such a way that the type of the returned vector is the same as of the current vector. WARNING: This method should be overridden in all derived classes such that the returned vector type is the same as the type of the current vector. More...
abstract VectorBase | GetNewBase ()
| Creates and returns a new vector with the same dimension and of the same type as the current vector. More...
abstract MatrixBase | GetNewMatrixBase (int rowCount, int columnCount)
| Creates and returns a new matrix with the specified dimensona, and of a type that is consistent with the type of the current vector. More...
abstract MatrixBase | GetNewMatrixBase ()
| Creates and returns a new matrix of a type that is consistent with the type of the current vector, and with both dimensions equal to the dimension of the current vector. More...
virtual IVector | GetCopy ()
| Returns a deep copy of the current object. More...
virtual IVector | GetNew (int length)
| Creates and returns a new vector with the specified dimension, and of the same type as the current vector. More...
virtual IVector | GetNew ()
| Creates and returns a new vector with the same dimension and of the same type as the current vector. More...
virtual IMatrix | GetNewMatrix (int rowCount, int columnCount)
| Creates and returns a new matrix with the specified dimensona, and of a type that is consistent with the type of the current vector. More...
virtual IMatrix | GetNewMatrix ()
| Creates and returns a new matrix of a type that is consistent with the type of the current vector, and with both dimensions equal to the dimension of the current vector. More...
virtual void | SetZero ()
| Sets all components of the current vector to 0. More...
virtual void | SetConstant (double elementValue)
| Sets all components of the current vector to the specified value. More...
virtual void | SetUnit (int which)
| Sets the current vector to the specific unit vector (one component equals 1, others are 0). More...
virtual void | SetRandom ()
| Sets the current vector such that it contains random elements on the interval (0,1]. More...
virtual void | SetRandom (IRandomGenerator rnd)
| Sets the current vector such that it contains random elements on the interval (0,1]. More...
virtual double | NormP (double p)
| p-norm, p-th root of sum of absolute values of components raised to the power of p. More...
IVector | Normalized ()
| Returns a vector that equals a normalized current vector. More...
void | Normalize ()
| Normalizes the current vector. More...
void | Negate ()
| Changes the sign of the current vector. More...
override int | GetHashCode ()
| Returns the hash code (hash function) of the current vector. More...
override bool | Equals (Object obj)
| Returns a value indicating whether the specified object is equal to the current vector. More...
int | GetHashFunctionInt ()
| Returns an integer valued hash function of the current vector object. More...
string | GetHashFunctionString ()
| Returns a string valued hash function of the current vector object. More...
override string | ToString ()
| Returns a string representation of this vector in a standard IGLib form. More...
virtual string | ToStringMath ()
| Returns a string representation of this vector in a standard IGLib form (Mathematica-like format but with C representation of numbers). More...
virtual string | ToString (string elementFormat)
| Returns a string representation of the current vector in a standard IGLib form, with the specified format for elements of the vector. More...
virtual string | ToStringMath (string elementFormat)
| Returns a string representation of the current vector in a standard IGLib form (Mathematica-like format but with C representation of numbers), with the specified format for elements of the vector. More...

## Static Public Member Functions
static double | NormPlain (IVector a)
| Returns Euclidean norm of the specified vector. More...
static double | NormStatic (IVector a)
| Returns Euclidean norm of the specified vector. More...
static double | Norm2Plain (IVector a)
| Returns Euclidean norm of the specified vector. More...
static double | Norm2Static (IVector a)
| Returns Euclidean norm of the specified vector. More...
static double | Norm1Plain (Vector a)
| Returns the 1-norm (Manhattan or Taxicab norm, sum of element absolute values) of the specified vector. More...
static double | Norm1Static (IVector a)
| Returns the 1-norm (Manhattan or Taxicab norm, sum of element absolute values) of the specified vector. More...
static double | NormPPlain (Vector a, double p)
| Returns the p-norm (p-th root of sum of absolute values of components raised to the power of p) of the specified vector. More...
static double | NormPStatic (IVector a, double p)
| Returns the p-norm (p-th root of sum of absolute values of components raised to the power of p) of the specified vector. More...
static double | NormInfPlain (Vector a)
| Returns the Infinity-norm (maximum absolute value of any element) of the specified vector. More...
static double | NormInfStatic (IVector a)
| Returns the Infinity-norm (maximum absolute value of any element) of the specified vector. More...
static double | DistancePlain (IVector a, IVector b)
| Returns Euqlidean distance between the specified two vectors. More...
static double | Distance (IVector a, IVector b)
| Returns Euqlidean distance between the specified two vectors. More...
static double | DistanceWeightedPlain (IVector a, IVector b, IVector characteristicLengths)
| Returns distance between the specified two vectors where vector elements are weighted by elements of another vector, which represent intervals of equal importance (thus the weighted sum is divided by their squares). More...
static double | DistanceWeighted (IVector a, IVector b, IVector characteristicLengths)
| Returns distance between the specified two vectors where vector elements are weighted by elements of another vector, which represent intervals of equal importance (thus the weighted sum is divided by their squares). More...
static double | NormWeightedPlain (IVector a, IVector characteristicLengths)
| Returns weighted Euclidean norm of the specified vector. More...
static double | NormWeighted (IVector a, IVector characteristicLengths)
| Returns weighted Euclidean norm of the specified vector. More...
static void | SetZero (IVector vec)
| Sets all components of the current vector to 0. More...
static void | SetConstant (IVector vec, double elementValue)
| Sets all components of the current vector to the specified value. More...
static void | SetUnit (IVector vec, int which)
| Sets the current vector to the specific unit vector (one component equals 1, others are 0). More...
static void | SetRandom (IVector vec)
| Sets the current vector such that it contains random elements on the interval (0,1]. More...
static void | SetRandom (IVector vec, IRandomGenerator rnd)
| Sets the current vector such that it contains random elements on the interval (0,1]. More...
static int | Compare (IVector v1, IVector v2)
| Compares two vectors and returns -1 if the first vector is smaller than the second one, 0 if vectors are equal, and 1 if the first vector is greater. Vector that is null is considered smaller than a vector that is not null. Two null vectors are considered equal. Vector with smaller dimension is considered smaller than a vector with greater dimension. Vectors with equal dimensions ar compared by elements. The first element that is different decides which vector is considered greater. More...
static void | Resize (ref IVector vec, IVector template, int dimension)
| Resizes, if necessary, the specified vector according to the required dimension. If the vector is initially null then a new vector is created. If in this case a template vector is specified then the newly created vector will be of the same type as that template vector, because it is created by the GetNew() method on that vector. If dimension of the initial vector does not match the required dim., then vector is resized. If the specified vector dimension is less or equal to 0 then vector is resized with the same dimension as that of the template vector. If in this case the template vector is null, an exception is thrown. WARNINGS: Components are NOT preserved and have in general undefined values after operation is performed. If vector and template are null then the type of nawly created vector is Vector. More...
static void | Resize (ref IVector vec, int dimension)
| Resizes, if necessary, the specified vector according to the required dimension. If the vector is initially null then a new vector is created. If dimension of the initial vector does not match the required dimension, then vector is resized. Components are NOT preserved and have in general undefined values after operation is performed. WARNING: If the vector is initially null then the type of the newly created vector is Vector. More...
static void | Resize (ref IVector vec, IVector template)
| Resizes, if necessary, the specified vector according to the dimension of the specified template vector. If the vector is initially null then a new vector is created. In this case the newly created vector will be of the same type as that template vector, because it is created by the GetNew() method on that vector. If dimension of the initial vector does not match the dimension of the template vector, then vector is resized. If the template vector is null, then an exception is thrown. WARNINGS: Components are NOT preserved and have in general undefined values after operation is performed. If vector and template are null then the type of newly created vector is Vector. More...
static void | CopyPlain (IVector a, IVector result)
| Copies components of a vector to another vector. This is a plain version that does not perform any dimension checks. WARNING: dimensions of the copied vector and result vector must match. More...
static void | Copy (IVector a, IVector result)
| Copies components of a vector to another vector. WARNING: dimensions of the copied vector and result vector must match. More...
static void | Copy (IVector a, ref IVector result)
| Copies components of a vectr to another vector. Resulting vector is allocated or reallocated if necessary. More...
static void | CopyPlain (VectorBase_MathNetNumerics a, IVector result)
| Copies components of a vector to another vector. This is a plain version that does not perform any dimension checks. WARNING: dimensions of the copied vector and result vector must match. More...
static void | Copy (VectorBase_MathNetNumerics a, IVector result)
| Copies components of a vector to another vector. WARNING: dimensions of the copied vector and result vector must match. More...
static void | Copy (VectorBase_MathNetNumerics a, ref IVector result)
| Copies components of a vectr to another vector. Resulting vector is allocated or reallocated if necessary. More...
static void | CopyPlain (IVector a, Vector_MathNetNumerics result)
| Copies components of a vector to another vector. This is a plain version that does not perform any dimension checks. WARNING: dimensions of the copied vector and result vector must match. More...
static void | Copy (IVector a, Vector_MathNetNumerics result)
| Copies components of a vector to another vector. WARNING: dimensions of the copied vector and result vector must match. More...
static void | Copy (IVector a, ref Vector_MathNetNumerics result)
| Copies components of a vectr to another vector. Resulting vector is allocated or reallocated if necessary. More...
static void | NegatePlain (IVector a, IVector result)
| Stores a negative vector of the specified vector to another vector. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of the copied vector and result vector must match. More...
static void | Negate (IVector a, IVector result)
| Stores a negative vector of the specified vector to another vector. WARNING: dimensions of the copied vector and result vector must match. More...
static void | Negate (IVector a, ref IVector result)
| Stores a negative vector of the specified vector to another vector. Resulting vector is allocated or reallocated if necessary. More...
static void | AddPlain (IVector a, IVector b, IVector result)
| Sums two vectors and stores the result in the specified result vector. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of vectors must match, otherwise an exception is thrown. More...
static void | Add (IVector a, IVector b, IVector result)
| Sums two vectors and stores the result in the specified result vector. WARNING: dimensions of vectors must match, otherwise an exception is thrown. More...
static void | Add (IVector a, IVector b, ref IVector result)
| Sums two vectors and stores the result in the specified result vector. WARNING: dimensions of operands must match, otherwise an exception is thrown. If dimensions of the result do not match then teh result is re-allocated. More...
static void | SubtractPlain (IVector a, IVector b, IVector result)
| Subtracts two vectors (a - b ) and stores the result in the specified result vector. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of vectors must match, otherwise an exception is thrown. More...
static void | Subtract (IVector a, IVector b, IVector result)
| Subtracts two vectors (a - b ) and stores the result in the specified result vector. WARNING: dimensions of vectors must match, otherwise an exception is thrown. More...
static void | Subtract (IVector a, IVector b, ref IVector result)
| Subtracts two vectors (a - b ) and stores the result in the specified result vector. WARNING: dimensions of operands must match, otherwise an exception is thrown. If dimensions of the result do not match then teh result is re-allocated. More...
static void | OrthogonalProjectionPlain (IVector original, IVector onWhich, double onWhichProductSelf, IVector result, double tolerance=0.0)
| Calculates orthogonal projection of the original vector on the specified vector, and stores the projection in the specified result, where the inner project of the vector to which projection is performed is specified. More...
static void | OrthogonalProjectionPlain (IVector original, IVector onWhich, IVector result, double tolerance=0.0)
| Calculates orthogonal projection of the original vector on the specified vector, and stores the projection in the specified result. More...
static void | OrthogonalProjection (IVector original, IVector onWhich, double onWhichProductSelf, ref IVector result, double tolerance=0.0)
| Calculates orthogonal projection of the original vector on the specified vector, and stores the projection in the specified result, where the inner project of the vector to which projection is performed is specified. More...
static void | OrthogonalProjection (IVector original, IVector onWhich, ref IVector result, double tolerance=0.0)
| Calculates orthogonal projection of the original vector on the specified vector, and stores the projection in the specified result. More...
static void | ArrayAddPlain (IVector a, double scal, IVector result)
| Addition of a scalar to all components of a vector. This is a plain version of the method that does not perform any consistency checks. Vector operand must be defined (non-null). More...
static void | ArrayAdd (IVector a, double scal, IVector result)
| Addition of a scalar to all components of a vector. Vector operand must be defined (non-null). More...
static void | ArrayAdd (IVector a, double scal, ref IVector result)
| Addition of a scalar to all components of a vector. Vector operand must be defined (non-null). More...
static void | ArraySubtractPlain (IVector a, double scal, IVector result)
| Subtraction of a scalar from all components of a vector. This is a plain version of the method that does not perform any consistency checks. Vector operand must be defined (non-null). More...
static void | ArraySubtract (IVector a, double scal, IVector result)
| Subtraction of a scalar from all components of a vector. Vector operand must be defined (non-null). More...
static void | ArraySubtract (IVector a, double scal, ref IVector result)
| Subtraction of a scalar to all components of a vector. Vector operand must be defined (non-null). More...
static void | MultiplyPlain (IVector a, double scal, IVector result)
| Multiplication of a vector by a scalar. This is a plain version of the method that does not perform any consistency checks. Vector operand must be defined (non-null). More...
static void | Multiply (IVector a, double scal, IVector result)
| Multiplication of a vector by a scalar. Vector operand must be defined (non-null). More...
static void | Multiply (IVector a, double scal, ref IVector result)
| Multiplication of a vector by a scalar. Vector operand must be defined (non-null). More...
static void | ScalePlain (IVector a, double scal, IVector result)
| Multiplication of a vector by a scalar. This is a plain version of the method that does not perform any consistency checks. Vector operand must be defined (non-null). More...
static void | Scale (IVector a, double scal, IVector result)
| Multiplication of a vector by a scalar. Vector operand must be defined (non-null). More...
static void | Scale (IVector a, double scal, ref IVector result)
| Multiplication of a vector by a scalar. Vector operand must be defined (non-null). More...
static void | DividePlain (IVector a, double scal, IVector result)
| Division of a vector by a scalar. This is a plain version of the method that does not perform any consistency checks. Vector operand must be defined (non-null). More...
static void | Divide (IVector a, double scal, IVector result)
| Division of a vector by a scalar. Vector operand must be defined (non-null). More...
static void | Divide (IVector a, double scal, ref IVector result)
| Division of a vector by a scalar. Vector operand must be defined (non-null). More...
static double | ScalarProductPlain (IVector a, IVector b)
| Scalar product of teo vectors. This is a plain version of the method that does not perform any consistency checks. More...
static double | ScalarProduct (IVector a, IVector b)
| Scalar product of teo vectors. More...
static void | DyadicProductPlain (IVector a, IVector b, IMatrix result)
| Calculates dyadic product of two vectors and stores the result in the specified result matrix. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions must match, otherwise an exception is thrown. More...
static void | DyadicProduct (IVector a, IVector b, IMatrix result)
| Calculates dyadic product of two vectors and stores the result in the specified result matrix. WARNING: dimensions must match, otherwise an exception is thrown. More...
static void | DyadicProduct (IVector a, IVector b, ref IMatrix result)
| Calculates dyadic product of two vectors and stores the result in the specified result matrix. WARNING: dimensions of operands must match, otherwise an exception is thrown. If dimensions of the result do not match then teh result is re-allocated. More...
static void | CrossProductPlain (IVector a, IVector b, IVector result)
| Calculates a vector product (cross product) of two vectors and stores the result in the specified result vector. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of all vectors must be 3, otherwise an exception is thrown. More...
static void | CrossProduct (IVector a, IVector b, IVector result)
| Calculates a vector product (cross product) of two vectors and stores the result in the specified result vector. WARNING: dimensions of all vectors must be 3, otherwise an exception is thrown. More...
static void | CrossProduct (IVector a, IVector b, ref IVector result)
| Calculates a vector product (cross product) of two vectors and stores the result in the specified result vector. WARNING: dimensions of operands must match, otherwise an exception is thrown. If dimensions of the result do not match then teh result is re-allocated. More...
static void | VectorProductPlain (IVector a, IVector b, IVector result)
| Calculates a vector product (cross product) of two vectors and stores the result in the specified result vector. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of all vectors must be 3, otherwise an exception is thrown. More...
static void | VectorProduct (IVector a, IVector b, IVector result)
| Calculates a vector product (cross product) of two vectors and stores the result in the specified result vector. WARNING: dimensions of all vectors must be 3, otherwise an exception is thrown. More...
static void | VectorProduct (IVector a, IVector b, ref IVector result)
| Calculates a vector product (cross product) of two vectors and stores the result in the specified result vector. WARNING: dimensions of operands must match, otherwise an exception is thrown. If dimensions of the result do not match then teh result is re-allocated. More...
static void | ArrayProductPlain (IVector a, IVector b, IVector result)
| Calculates array product (element-by-element product) of two vectors and stores the result in the specified result vector. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of all vectors must be 3, otherwise an exception is thrown. More...
static void | ArrayProduct (IVector a, IVector b, IVector result)
| Calculates array product (element-by-element product) of two vectors and stores the result in the specified result vector. WARNING: dimensions of all vectors must be 3, otherwise an exception is thrown. More...
static void | ArrayProduct (IVector a, IVector b, ref IVector result)
| Calculates array product (element-by-element product) of two vectors and stores the result in the specified result vector. WARNING: dimensions of operands must match, otherwise an exception is thrown. If dimensions of the result do not match then teh result is re-allocated. More...
static void | ArrayQuotientPlain (IVector a, IVector b, IVector result)
| Calculates array quotient (element-by-element division) of two vectors and stores the result in the specified result vector. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of all vectors must be 3, otherwise an exception is thrown. More...
static void | ArrayQuotient (IVector a, IVector b, IVector result)
| Calculates array quotient (element-by-element division) of two vectors and stores the result in the specified result vector. WARNING: dimensions of all vectors must be 3, otherwise an exception is thrown. More...
static void | ArrayQuotient (IVector a, IVector b, ref IVector result)
| Calculates array quotient (element-by-element division) of two vectors and stores the result in the specified result vector. WARNING: dimensions of operands must match, otherwise an exception is thrown. If dimensions of the result do not match then teh result is re-allocated. More...
static int | GetHashCode (IVector vec)
| Returns hash code of the specified vector. More...
static bool | Equals (IVector v1, IVector v2)
| Returns true if the specified vectors are equal, false if not. More...
static int | GetHashFunctionInt (IVector vec)
| Returns an integer valued hash function of the specified vector object. More...
static string | GetHashFunctionString (IVector vec)
| Returns a string valued hash function of the specified vector object. More...
static void | OrthoNormalizeGramSchmidt (IList< IVector > original, ref IList< IVector > resOrthogonal, ref IVector resNorms, ref IVector auxProjection, double tolDependent=1e-10, bool normalize=false, int numRequestedVectors=0, IRandomGenerator rand=null, int maxExcessGenerated=5)
| Performs the Gramm-Schmidt orthogonalization procedure in order to calculate a set of orthonormal vectors from the specified set of arbitrary independent vectors. More...
static int | OrthogonalizeGramSchmidt (IList< IVector > original, ref IList< IVector > resOrthogonal, ref IVector resNorms, ref IVector auxProjection, double tolDependent=1e-10, bool normalize=false, int numRequestedVectors=0, IRandomGenerator rand=null, int maxExcessGenerated=5)
| Performs the Gramm-Schmidt orthogonalization procedure in order to calculate a set of orthogonall vectors from the specified set of arbitrary independent vectors. More...
static void | OrthoNormalizeGramSchmidtNonRobust (IList< IVector > original, ref IList< IVector > resOrthogonal, ref IVector resNorms, ref IVector auxProjection, double tolSize=0, bool normalize=false, bool modifiedGrammSchmidt=true)
| Performs the Gramm-Schmidt orthogonalization procedure in order to calculate a set of orthonormal vectors from the specified set of arbitrary independent vectors. More...
static void | OrthogonalizeGramSchmidtNonRobust (IList< IVector > original, ref IList< IVector > resOrthogonal, ref IVector resNorms, ref IVector auxProjection, double tolSize=0, bool normalize=false, bool modifiedGrammSchmidt=true)
| Performs the Gramm-Schmidt orthogonalization procedure in order to calculate a set of orthogonall vectors from the specified set of arbitrary independent vectors. More...
static bool | TestGramSchmidtOrthogonalization (int dim, int numRepetitions=1, double tol=1e-8, int outputLevel=0, IRandomGenerator randomGenerator=null, bool normalize=false, bool modifiedGrammSchmidt=true, bool nonRobust=false)
| Performs a test of Gramm-Schmidt orthogonalization on a set of random vectors. More...
static VectorBase | operator+ (VectorBase v)
| Unary plus, returns the operand. More...
static VectorBase | operator- (VectorBase v)
| Unary negation, returns the negative operand. More...
static VectorBase | operator+ (VectorBase a, VectorBase b)
| Vector addition. More...
static VectorBase | operator- (VectorBase a, VectorBase b)
| Vector subtraction. More...
static double | operator* (VectorBase a, VectorBase b)
| Scalar product of two vectors. More...
static VectorBase | operator* (VectorBase a, double b)
| Product of a vector by a scalar. More...
static VectorBase | operator* (double a, VectorBase b)
| Product of a vector by a scalar. More...
static VectorBase | operator/ (VectorBase a, double b)
| Vector subtraction. More...
static string | ToString (IVector vec)
| Returns a string representation of the specified vector in a standard IGLib form. More...
static string | ToStringMath (IVector vec)
| Returns a string representation of the specified vector in a standard IGLib form (Mathematica-like format but with C representation of numbers). More...
static string | ToString (IVector vec, string elementFormat)
| Returns a string representation of the specified vector in a standard IGLib form, with the specified format for elements of the vector. More...
static string | ToStringMath (IVector vec, string elementFormat)
| Returns a string representation of the specified vector in a standard IGLib form (Mathematica-like format but with C representation of numbers), with the specified format for elements of the vector. More...
static void | SaveJson (IVector vec, string filePath)
| Saves (serializes) the specified vector to the specified JSON file. File is owerwritten if it exists. More...
static void | SaveJson (IVector vec, string filePath, bool append)
| Saves (serializes) the specified vector to the specified JSON file. If the file already exists, contents either overwrites the file or is appended at the end, dependent on the value of the append flag. More...
static void | LoadJson (string filePath, ref IVector vecRestored)
| Restores (deserializes) a vector from the specified file in JSON format. More...
static void | SaveCsv (IVector vec, string filePath)
| Saves the specified vector to a CSV file. It the specified file already exists then it is overwritten. Constant UtilStr.DefaultCsvSeparator is used as separator. More...
static void | SaveCsv (IVector vec, string filePath, string separator)
| Saves the specified vector to a CSV file. It the specified file already exists then it is overwritten. More...
static void | SaveCsv (IVector vec, string filePath, bool append)
| Saves the specified vector to a CSV file. Constant UtilStr.DefaultCsvSeparator is used as separator in CSV. More...
static void | SaveCsv (IVector vec, string filePath, string separator, bool append)
| Saves the specified vector to a CSV file. More...
static void | LoadCsv (string filePath, ref IVector vecRestored)
| Reads a vector from a CSV file. Constant Str.DefaultCsvSeparator is used as separator in CSV file. If there are no components then a null vector is returned by this method (no exceptions thrown). If there are more than one rows in the CSV file then vector is read from the first row. More...
static void | LoadCsv (string filePath, string separator, ref IVector vecRestored)
| Reads a vector written in CSV format from a file. If there are no components then a null vector is returned by this method (no exceptions thrown). If there are more than one rows in the CSV file then vector is read from the first row. More...
static void | LoadCsv (string filePath, int rowNum, ref IVector vecRestored)
| Reads a vector from the specified row of a CSV file. Constant UtilStr.DefaultCsvSeparator is used as CSV separator. If the specified row does not exisist in the file then exception is thrown. More...
static void | LoadCsv (string filePath, int rowNum, string separator, ref IVector vecRestored)
| Reads a vector from the specified row of a CSV file. If the specified row does not exisist in the file then exception is thrown. More...

## Properties
abstract int | Length`[get]`
| Gets dimension of the vector. More...
abstract double | this[int i]`[get, set]`
| Gets or sets the element indexed by `i` in the `Vector`. More...
virtual double | Norm`[get]`
| Gets Euclidean norm of the vector. More...
virtual double | Norm2`[get]`
| Gets Euclidean norm of the vector. More...
virtual double | NormEuclidean`[get]`
| Gets Euclidean norm of the vector. More...
virtual double | SquaredNorm`[get]`
| Squared Euclidean norm, sum of squared components. More...
virtual double | Norm1`[get]`
| 1-norm (Manhattan norm or Taxicab norm), sum of absolute values of components. More...
virtual double | NormInf`[get]`
| Infinity-norm, maximum absolute value of any component. More...
static VectorStore | VectorStore`[get]`
| Gets the matrix store for recycling auxiliary matrices. More...

## Static Private Attributes
static VectorStore | _matrixStore

## Detailed Description

Base class for real vectors.

$A Igor Jan08 Jul10 Nov10;

## Member Function Documentation

virtual double [] IG.Num.VectorBase.ToArray | ( |  | ) |
| inline virtual

Copies the current vector to an array.

abstract VectorBase IG.Num.VectorBase.GetCopyBase | ( |  | ) |
| pure virtual

Creates and returns a copy of the current vector. WARNING: This method should be overridden in the derived classes in such a way that the returned vector is of the same type as the current vector.

Implemented in IG.Num.Vector, IG.Num.Vector3d, and IG.Num.Vector2d.

Referenced by IG.Num.VectorBase.operator+(), and IG.Num.VectorBase.operator-().

abstract VectorBase IG.Num.VectorBase.GetNewBase | ( | int | length | ) |
| pure virtual

Creates and returns a new vector of the specified dimension in such a way that the type of the returned vector is the same as of the current vector. WARNING: This method should be overridden in all derived classes such that the returned vector type is the same as the type of the current vector.

Parameters

  length | Dimension of the returned vector.

Implemented in IG.Num.Vector, IG.Num.Vector3d, and IG.Num.Vector2d.

Referenced by IG.Num.VectorBase.operator*(), IG.Num.MatrixBase.operator*(), IG.Num.VectorBase.operator+(), IG.Num.VectorBase.operator-(), and IG.Num.VectorBase.operator/().

abstract VectorBase IG.Num.VectorBase.GetNewBase | ( |  | ) |
| pure virtual

Creates and returns a new vector with the same dimension and of the same type as the current vector.

Implemented in IG.Num.Vector, IG.Num.Vector3d, and IG.Num.Vector2d.

abstract MatrixBase IG.Num.VectorBase.GetNewMatrixBase | ( | int | rowCount,
|  | int | columnCount
| ) |  |
| pure virtual

Creates and returns a new matrix with the specified dimensona, and of a type that is consistent with the type of the current vector.

Parameters

  rowCount | Number of rows of the returned matrix.
  columnCount | Number of rows of the returned matrix.

Returns
  A matrix with specified dimensions, whose type is consistent with the type of the current vector.

Implemented in IG.Num.Vector, IG.Num.Vector3d, and IG.Num.Vector2d.

abstract MatrixBase IG.Num.VectorBase.GetNewMatrixBase | ( |  | ) |
| pure virtual

Creates and returns a new matrix of a type that is consistent with the type of the current vector, and with both dimensions equal to the dimension of the current vector.

Implemented in IG.Num.Vector, IG.Num.Vector2d, and IG.Num.Vector3d.

virtual IVector IG.Num.VectorBase.GetCopy | ( |  | ) |
| inline virtual

Returns a deep copy of the current object.

Implements IG.Num.IVector.

virtual IVector IG.Num.VectorBase.GetNew | ( | int | length | ) |
| inline virtual

Creates and returns a new vector with the specified dimension, and of the same type as the current vector.

Parameters

  length | Dimension of the newly created vector.

Returns
  A newly created vector of the specified dimension and of the same type as the current vector.

Implements IG.Num.IVector.

virtual IVector IG.Num.VectorBase.GetNew | ( |  | ) |
| inline virtual

Creates and returns a new vector with the same dimension and of the same type as the current vector.

Implements IG.Num.IVector.

virtual IMatrix IG.Num.VectorBase.GetNewMatrix | ( | int | rowCount,
|  | int | columnCount
| ) |  |
| inline virtual

Creates and returns a new matrix with the specified dimensona, and of a type that is consistent with the type of the current vector.

Parameters

  rowCount | Number of rows of the returned matrix.
  columnCount | Number of rows of the returned matrix.

Returns
  A matrix with specified dimensions, whose type is consistent with the type of the current vector.

Implements IG.Num.IVector.

virtual IMatrix IG.Num.VectorBase.GetNewMatrix | ( |  | ) |
| inline virtual

Creates and returns a new matrix of a type that is consistent with the type of the current vector, and with both dimensions equal to the dimension of the current vector.

Implements IG.Num.IVector.

virtual void IG.Num.VectorBase.SetZero | ( |  | ) |
| inline virtual

Sets all components of the current vector to 0.

Implements IG.Num.IVector.

virtual void IG.Num.VectorBase.SetConstant | ( | double | elementValue | ) |
| inline virtual

Sets all components of the current vector to the specified value.

Parameters

  elementValue | Value to which vector elements are set.

Implements IG.Num.IVector.

virtual void IG.Num.VectorBase.SetUnit | ( | int | which | ) |
| inline virtual

Sets the current vector to the specific unit vector (one component equals 1, others are 0).

Parameters

  which | Specifies which unit vector is set (i.e., which component equals 1).

Implements IG.Num.IVector.

virtual void IG.Num.VectorBase.SetRandom | ( |  | ) |
| inline virtual

Sets the current vector such that it contains random elements on the interval (0,1].

Implements IG.Num.IVector.

Referenced by IG.Num.VectorBase.OrthogonalizeGramSchmidt(), IG.Num.Vector.Random(), IG.Num.Vector3d.Random(), IG.Num.Vector2d.Random(), IG.Num.MatrixBase.TestCholeskyDecomposition(), IG.Num.MatrixBase.TestLdltDecomposition(), and IG.Num.MatrixBase.TestLuDecomposition().

virtual void IG.Num.VectorBase.SetRandom | ( | IRandomGenerator | rnd | ) |
| inline virtual

Sets the current vector such that it contains random elements on the interval (0,1].

Parameters

  rnd | Random generator used to generate vector elements.

Implements IG.Num.IVector.

virtual double IG.Num.VectorBase.NormP | ( | double | p | ) |
| inline virtual

p-norm, p-th root of sum of absolute values of components raised to the power of p.

Parameters

  p | Power of the norm, must be greater or equal to 1.

For p = 1, we obtain taxicab norm, for p = 2 we obtain Euclidean norm, and as p approaches infinity, the result approaches the infinity norm (but beware of large numbers and numerical stability).

Exceptions

  ArgumentException | If p is less than 1.0.

static double IG.Num.VectorBase.NormPlain | ( | IVector | a | ) |
| inline static

Returns Euclidean norm of the specified vector.

Vector can NOT be null (inthis case, exception is thrown).

static double IG.Num.VectorBase.NormStatic | ( | IVector | a | ) |
| inline static

Returns Euclidean norm of the specified vector.

Vector can be null (0 is returned in this case).

static double IG.Num.VectorBase.Norm2Plain | ( | IVector | a | ) |
| inline static

Returns Euclidean norm of the specified vector.

Vector can NOT be null (inthis case, exception is thrown).

Referenced by IG.Num.VectorBase.OrthogonalizeGramSchmidt(), and IG.Num.VectorBase.OrthogonalizeGramSchmidtNonRobust().

static double IG.Num.VectorBase.Norm2Static | ( | IVector | a | ) |
| inline static

Returns Euclidean norm of the specified vector.

Vector can be null (0 is returned in this case).

static double IG.Num.VectorBase.Norm1Plain | ( | Vector | a | ) |
| inline static

Returns the 1-norm (Manhattan or Taxicab norm, sum of element absolute values) of the specified vector.

Vector can NOT be null (inthis case, exception is thrown).

References IG.Num.Vector.Length.

static double IG.Num.VectorBase.Norm1Static | ( | IVector | a | ) |
| inline static

Returns the 1-norm (Manhattan or Taxicab norm, sum of element absolute values) of the specified vector.

Vector can be null (0 is returned in this case).

static double IG.Num.VectorBase.NormPPlain | ( | Vector | a,
|  | double | p
| ) |  |
| inline static

Returns the p-norm (p-th root of sum of absolute values of components raised to the power of p) of the specified vector.

Vector can NOT be null (inthis case, exception is thrown).

Parameters

  a | Vector whose norm is calculated.
  p | Power of the norm, must be greater or equal to 1.

For p = 1, we obtain taxicab norm, for p = 2 we obtain Euclidean norm, and as p approaches infinity, the result approaches the infinity norm (but beware of large numbers and numerical stability).

Exceptions

  ArgumentException | If p is less than 1.0.

References IG.Num.Vector.Length.

static double IG.Num.VectorBase.NormPStatic | ( | IVector | a,
|  | double | p
| ) |  |
| inline static

Returns the p-norm (p-th root of sum of absolute values of components raised to the power of p) of the specified vector.

Vector can be null (0 is returned in this case).

Parameters

  a | Vector whose norm is calculated.
  p | Power of the norm, must be greater or equal to 1.

For p = 1, we obtain taxicab norm, for p = 2 we obtain Euclidean norm, and as p approaches infinity, the result approaches the infinity norm (but beware of large numbers and numerical stability).

Exceptions

  ArgumentException | If p is less than 1.0.

static double IG.Num.VectorBase.NormInfPlain | ( | Vector | a | ) |
| inline static

Returns the Infinity-norm (maximum absolute value of any element) of the specified vector.

Vector can NOT be null (inthis case, exception is thrown).

References IG.Num.Vector.Length.

static double IG.Num.VectorBase.NormInfStatic | ( | IVector | a | ) |
| inline static

Returns the Infinity-norm (maximum absolute value of any element) of the specified vector.

Vector can be null (0 is returned in this case).

static double IG.Num.VectorBase.DistancePlain | ( | IVector | a,
|  | IVector | b
| ) |  |
| inline static

Returns Euqlidean distance between the specified two vectors.

WARNING: This is a plain version of the method that does not perform any consistency checks.

Parameters

  a | First vector.
  b | Second vector.

Referenced by IG.Num.DistanceComparer< PointContainerType, PointType >.DefaultDistanceFunction(), and IG.Num.DistanceComparer< PointContainerType, PointType >.OutputDistance().

static double IG.Num.VectorBase.Distance | ( | IVector | a,
|  | IVector | b
| ) |  |
| inline static

Returns Euqlidean distance between the specified two vectors.

WARNING: Dimensions must match, otherwise exception is thrown..

Parameters

  a | First vector.
  b | Second vector.

Referenced by IG.Num.SampledDataSet.ComparerInputDistance.ComparerInputDistance(), IG.Num.SampledDataSet.ComparerOutputDistance.ComparerOutputDistance(), and IG.Num.PointCloud< PointLinkType, PointContainerType, PointType >.ExampleClosestPointsDummy().

static double IG.Num.VectorBase.DistanceWeightedPlain | ( | IVector | a,
|  | IVector | b,
|  | IVector | characteristicLengths
| ) |  |
| inline static

Returns distance between the specified two vectors where vector elements are weighted by elements of another vector, which represent intervals of equal importance (thus the weighted sum is divided by their squares).

Dw=Sqrt(Sum(((a_i-b_i)/l_i)^2))

WARNING: This is a plain version of the method that does not perform any consistency checks. It assumes that all vector prarameters are allocated and of hte same dimension, and that all elements of characteristic lengths vector are non-zero.

Parameters

  a | First vector.
  b | Second vector.
  characteristicLengths | Vector whose elements represent interval lenhth of equal importance in different coordinate direction. Used for calculation of weighted sum (terms are divided by squares of vector elements).

Referenced by IG.Num.DistanceComparer< PointContainerType, PointType >.DefaultDistanceFunction(), and IG.Num.DistanceComparer< PointContainerType, PointType >.OutputDistance().

static double IG.Num.VectorBase.DistanceWeighted | ( | IVector | a,
|  | IVector | b,
|  | IVector | characteristicLengths
| ) |  |
| inline static

Returns distance between the specified two vectors where vector elements are weighted by elements of another vector, which represent intervals of equal importance (thus the weighted sum is divided by their squares).

Dw=Sqrt(Sum(((a_i-b_i)/l_i)^2))

WARNING: Dimensions of vector arguments must match, otherwise exceptin is thrown. Also if any element of characteristic lengths vector is zero, an exception is thrown, too.

Parameters

  a | First vector.
  b | Second vector.
  characteristicLengths | Vector whose elements represent interval lenhth of equal importance in different coordinate direction. Used for calculation of weighted sum (terms are divided by squares of vector elements).

static double IG.Num.VectorBase.NormWeightedPlain | ( | IVector | a,
|  | IVector | characteristicLengths
| ) |  |
| inline static

Returns weighted Euclidean norm of the specified vector.

Parameters

  a | Vector whose weighter Euclidean norm is returned.
  characteristicLengths | Vector whose elements represent interval lenhth of equal importance in different coordinate direction. Used for calculation of weighted sum (terms are divided by squares of vector elements).

Referenced by IG.Num.NeuralTrainingParameters.ComparerBase.OutputNorm().

static double IG.Num.VectorBase.NormWeighted | ( | IVector | a,
|  | IVector | characteristicLengths
| ) |  |
| inline static

Returns weighted Euclidean norm of the specified vector.

Parameters

  a | Vector whose weighter Euclidean norm is returned.
  characteristicLengths | Vector whose elements represent interval lengths of equal importance in different coordinate direction. Used for calculation of weighted sum (terms are divided by squares of vector elements).

Referenced by IG.Num.NeuralTrainingParameters.ErrorAverageCalc().

IVector IG.Num.VectorBase.Normalized | ( |  | ) |
| inline

Returns a vector that equals a normalized current vector.

Implements IG.Num.IVector.

void IG.Num.VectorBase.Normalize | ( |  | ) |
| inline

Normalizes the current vector.

Returns

void IG.Num.VectorBase.Negate | ( |  | ) |
| inline

Changes the sign of the current vector.

Returns

Referenced by IG.Num.VectorBase.operator-().

override int IG.Num.VectorBase.GetHashCode | ( |  | ) |
| inline

Returns the hash code (hash function) of the current vector.

This method calls the VectorBase.GetHashCode to calculate the hash code, which is standard for all implementations of the IVector interface.

Two vectors that have the same dimensions and equal elements will produce the same hash codes.

Probability that two different vectors will produce the same hash code is small but it exists.

Overrides the object.GetHashCode method.

References IG.Num.VectorBase.GetHashCode().

Referenced by IG.Num.Vector2d.GetHashCode(), IG.Num.Vector3d.GetHashCode(), IG.Num.Vector.GetHashCode(), and IG.Num.VectorBase.GetHashCode().

override bool IG.Num.VectorBase.Equals | ( | Object | obj | ) |
| inline

Returns a value indicating whether the specified object is equal to the current vector.

True is returned if the object is a non-null vector (i.e. it implements the IVector interface), and has the same dimension and equal elements as the current vector.

This method calls the VectorBase.Equals to obtain the returned value, which is standard for all implementations of the IVector interface.

Overrides the object.Equals method.

References IG.Num.VectorBase.Equals().

Referenced by IG.Num.Vector2d.Equals(), IG.Num.Vector3d.Equals(), IG.Num.Vector.Equals(), and IG.Num.VectorBase.Equals().

int IG.Num.VectorBase.GetHashFunctionInt | ( |  | ) |
| inline

Returns an integer valued hash function of the current vector object.

The returned value is calculated by the Util.GetHashFunctionInt method.

See also
  Util.GetHashFunctionInt

Implements IG.Num.IVector.

References IG.Lib.Util.GetHashFunctionInt().

string IG.Num.VectorBase.GetHashFunctionString | ( |  | ) |
| inline

Returns a string valued hash function of the current vector object.

The returned value is calculated by the Util.GetHashFunctionString method.

The returned string is always on the same length, and is based on the ToString method. Therefore it is convenient for use in file or directory names that have one part related to a specific vector.

See also
  Util.GetHashFunctionString

Implements IG.Num.IVector.

References IG.Lib.Util.GetHashFunctionString().

static void IG.Num.VectorBase.SetZero | ( | IVector | vec | ) |
| inline static

Sets all components of the current vector to 0.

Parameters

  vec | Vector whose components are set.

static void IG.Num.VectorBase.SetConstant | ( | IVector | vec,
|  | double | elementValue
| ) |  |
| inline static

Sets all components of the current vector to the specified value.

Parameters

  vec | Vector whose components are set.
  elementValue | Value to which vector elements are set.

static void IG.Num.VectorBase.SetUnit | ( | IVector | vec,
|  | int | which
| ) |  |
| inline static

Sets the current vector to the specific unit vector (one component equals 1, others are 0).

Parameters

  vec | Vector whose components are set.
  which | Specifies which unit vector is set (i.e., which component equals 1).

static void IG.Num.VectorBase.SetRandom | ( | IVector | vec | ) |
| inline static

Sets the current vector such that it contains random elements on the interval (0,1].

Parameters

  vec | Vector whose components are set.

References IG.Num.IRandomGenerator.NextDouble().

static void IG.Num.VectorBase.SetRandom | ( | IVector | vec,
|  | IRandomGenerator | rnd
| ) |  |
| inline static

Sets the current vector such that it contains random elements on the interval (0,1].

Parameters

  vec | Vector whose components are set.
  rnd | Random generator used to generate vector elements.

References IG.Num.IRandomGenerator.NextDouble().

static int IG.Num.VectorBase.Compare | ( | IVector | v1,
|  | IVector | v2
| ) |  |
| inline static

Compares two vectors and returns -1 if the first vector is smaller than the second one, 0 if vectors are equal, and 1 if the first vector is greater. Vector that is null is considered smaller than a vector that is not null. Two null vectors are considered equal. Vector with smaller dimension is considered smaller than a vector with greater dimension. Vectors with equal dimensions ar compared by elements. The first element that is different decides which vector is considered greater.

Parameters

  v1 | First vector to be compared.
  v2 | Second vector to be compared.

Returns
  -1 if the first vector is smaller than the second one, 0 if vectors are equal, and 1 if the second is greater.

This comparison does not have any mathematical meaning. It is just used for sotting of vectors in data structures.

Referenced by IG.Num.VectorApproximatorBase.CalculateOutput(), IG.Num.SampledDataSet.GetNumInputDuplicates(), and IG.Num.SampledDataSet.RemoveInputDuplicates().

static void IG.Num.VectorBase.Resize | ( | ref IVector | vec,
|  | IVector | template,
|  | int | dimension
| ) |  |
| inline static

Resizes, if necessary, the specified vector according to the required dimension. If the vector is initially null then a new vector is created. If in this case a template vector is specified then the newly created vector will be of the same type as that template vector, because it is created by the GetNew() method on that vector. If dimension of the initial vector does not match the required dim., then vector is resized. If the specified vector dimension is less or equal to 0 then vector is resized with the same dimension as that of the template vector. If in this case the template vector is null, an exception is thrown. WARNINGS: Components are NOT preserved and have in general undefined values after operation is performed. If vector and template are null then the type of nawly created vector is Vector.

Parameters

  vec | Vector that is resized.
  template | Vector that is taken as template (for type of a newly created vector or for dimension if it is not specified).
  dimenson | If greater than 0 then it specifies the dimension to which vector is resized.

Referenced by IG.Num.NeuralApproximatorBase.CalculateErrorsMax(), IG.Num.NeuralApproximatorBase.CalculateErrorsMeanAbs(), IG.Num.NeuralApproximatorBase.CalculateErrorsRms(), IG.Num.VectorApproximatorBase.CalculateOutput(), IG.Num.NeuralApproximatorBase.CalculateOutput(), IG.Num.InputOutputDataDefiniton.CopyDefaultInputTo(), IG.Num.BoundingBoxBase.GetAbsoluteCoordinates(), IG.Num.BoundingBoxBase.GetIntervalLengths(), IG.Num.BoundingBoxBase.GetMax(), IG.Num.BoundingBoxBase.GetMin(), IG.Num.BoundingBoxBase.GetRandomPoint(), IG.Num.BoundingBoxBase.GetRelativeCoordinates(), IG.Num.VectorBase.LoadCsv(), IG.Num.BoundingBoxBase.Map(), IG.Num.VectorBase.OrthogonalizeGramSchmidt(), IG.Num.VectorBase.OrthogonalizeGramSchmidtNonRobust(), IG.Num.VectorBase.OrthogonalProjection(), IG.Num.AnalysisResults.PrepareResultStorage(), IG.Lib.UtilConsole.Read(), and IG.Num.SimKosecFileManagerBase.ReadInputParameters().

static void IG.Num.VectorBase.Resize | ( | ref IVector | vec,
|  | int | dimension
| ) |  |
| inline static

Resizes, if necessary, the specified vector according to the required dimension. If the vector is initially null then a new vector is created. If dimension of the initial vector does not match the required dimension, then vector is resized. Components are NOT preserved and have in general undefined values after operation is performed. WARNING: If the vector is initially null then the type of the newly created vector is Vector.

Parameters

  vec | Vector that is resized.
  dimenson | Dimension to which vector is resized (if less or equal to 0 then exception is thrown).

static void IG.Num.VectorBase.Resize | ( | ref IVector | vec,
|  | IVector | template
| ) |  |
| inline static

Resizes, if necessary, the specified vector according to the dimension of the specified template vector. If the vector is initially null then a new vector is created. In this case the newly created vector will be of the same type as that template vector, because it is created by the GetNew() method on that vector. If dimension of the initial vector does not match the dimension of the template vector, then vector is resized. If the template vector is null, then an exception is thrown. WARNINGS: Components are NOT preserved and have in general undefined values after operation is performed. If vector and template are null then the type of newly created vector is Vector.

Parameters

  vec | Vector that is resized.
  template | Vector that is taken as template (for type of a newly created vector or for dimension).

static void IG.Num.VectorBase.CopyPlain | ( | IVector | a,
|  | IVector | result
| ) |  |
| inline static

Copies components of a vector to another vector. This is a plain version that does not perform any dimension checks. WARNING: dimensions of the copied vector and result vector must match.

Parameters

  a | Original vector.
  result | Vector where copy will be stored. Dimensions must match dimensions of original.

Referenced by IG.Num.ScalarFunctionRadialUntransformed.GradientPlain(), IG.Num.MatrixBase.LuSolveNoPermutationsPlain(), IG.Num.ScalarFunctionRadial.ReferenceGradientPlain(), IG.Num.AffineTransformationSquare.TransformBackCoordinatesPlain(), IG.Num.AffineTransformationSquare.TransformBackGradientPlain(), IG.Num.AffineTransformationSquare.TransformCoordinatesPlain(), and IG.Num.AffineTransformationSquare.TransformGradientPlain().

static void IG.Num.VectorBase.Copy | ( | IVector | a,
|  | IVector | result
| ) |  |
| inline static

Copies components of a vector to another vector. WARNING: dimensions of the copied vector and result vector must match.

Parameters

  a | Original vector.
  result | Vector where copy will be stored. Dimensions must match dimensions of original.

Referenced by IG.Neural.AnalysisFileServerNeural.AnalysisToApproximationInput(), IG.Num.VectorApproximatorBase.CalculateOutput(), IG.Num.MatrixBase.CholeskySolve(), IG.Num.NeuralTrainingParameters.CopyFrom(), IG.Num.NeuralTrainingParameters.CopyResultsFrom(), IG.Num.NeuralTrainingParameters.CopyTo(), IG.Num.SampledDataSet.ExtractFilteredData(), IG.Num.NeuralTrainingLimits.IterateThroughMultidimensionalTable(), IG.Num.MatrixBase.LdltSolve(), IG.Num.BoundingBoxBase.Map(), IG.Neural.DataMapperIdentity.MapInput(), IG.Neural.DataMapperIdentity.MapOutput(), IG.Num.VectorBase.OrthogonalizeGramSchmidt(), IG.Num.VectorBase.OrthogonalizeGramSchmidtNonRobust(), IG.Num.LinearSolverBase.Solve(), IG.Num.LinearSolverBase.SolveMathNetNumerics(), IG.Num.LUDecomposition.SolveMathNetNumerics(), IG.Num.QRDecomposition.SolveMathNetNumerics(), IG.Num.CholeskyDecomposition.SolveMathNetNumerics(), IG.Num.EigenValueDecomposition.SolveMathNetNumerics(), IG.Num.SingularValueDecomposition.SolveMathNetNumerics(), and IG.Num.ScalarFunctionUntransformedBase.Test().

static void IG.Num.VectorBase.Copy | ( | IVector | a,
|  | ref IVector | result
| ) |  |
| inline static

Copies components of a vectr to another vector. Resulting vector is allocated or reallocated if necessary.

Parameters

  a | Original vector.
  result | Vector where copy will be stored.

References IG.Num.IVector.GetNew().

static void IG.Num.VectorBase.CopyPlain | ( | VectorBase_MathNetNumerics | a,
|  | IVector | result
| ) |  |
| inline static

Copies components of a vector to another vector. This is a plain version that does not perform any dimension checks. WARNING: dimensions of the copied vector and result vector must match.

Parameters

  a | Original vector.
  result | Vector where copy will be stored. Dimensions must match dimensions of original.

static void IG.Num.VectorBase.Copy | ( | VectorBase_MathNetNumerics | a,
|  | IVector | result
| ) |  |
| inline static

Copies components of a vector to another vector. WARNING: dimensions of the copied vector and result vector must match.

Parameters

  a | Original vector.
  result | Vector where copy will be stored. Dimensions must match dimensions of original.

static void IG.Num.VectorBase.Copy | ( | VectorBase_MathNetNumerics | a,
|  | ref IVector | result
| ) |  |
| inline static

Copies components of a vectr to another vector. Resulting vector is allocated or reallocated if necessary.

Parameters

  a | Original vector.
  result | Vector where copy will be stored.

static void IG.Num.VectorBase.CopyPlain | ( | IVector | a,
|  | Vector_MathNetNumerics | result
| ) |  |
| inline static

Copies components of a vector to another vector. This is a plain version that does not perform any dimension checks. WARNING: dimensions of the copied vector and result vector must match.

Parameters

  a | Original vector.
  result | Vector where copy will be stored. Dimensions must match dimensions of original.

static void IG.Num.VectorBase.Copy | ( | IVector | a,
|  | Vector_MathNetNumerics | result
| ) |  |
| inline static

Copies components of a vector to another vector. WARNING: dimensions of the copied vector and result vector must match.

Parameters

  a | Original vector.
  result | Vector where copy will be stored. Dimensions must match dimensions of original.

static void IG.Num.VectorBase.Copy | ( | IVector | a,
|  | ref Vector_MathNetNumerics | result
| ) |  |
| inline static

Copies components of a vectr to another vector. Resulting vector is allocated or reallocated if necessary.

Parameters

  a | Original vector.
  result | Vector where copy will be stored.

static void IG.Num.VectorBase.NegatePlain | ( | IVector | a,
|  | IVector | result
| ) |  |
| inline static

Stores a negative vector of the specified vector to another vector. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of the copied vector and result vector must match.

Parameters

  a | Original vector.
  result | Vector where result is be stored. Dimensions must match dimensions of original.

static void IG.Num.VectorBase.Negate | ( | IVector | a,
|  | IVector | result
| ) |  |
| inline static

Stores a negative vector of the specified vector to another vector. WARNING: dimensions of the copied vector and result vector must match.

Parameters

  a | Original vector.
  result | Vector where result is be stored. Dimensions must match dimensions of original.

static void IG.Num.VectorBase.Negate | ( | IVector | a,
|  | ref IVector | result
| ) |  |
| inline static

Stores a negative vector of the specified vector to another vector. Resulting vector is allocated or reallocated if necessary.

Parameters

  a | Original vector.
  result | Vector where result is be stored.

References IG.Num.IVector.GetNew().

static void IG.Num.VectorBase.AddPlain | ( | IVector | a,
|  | IVector | b,
|  | IVector | result
| ) |  |
| inline static

Sums two vectors and stores the result in the specified result vector. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of vectors must match, otherwise an exception is thrown.

Parameters

  a | First operand.
  b | Second operand.
  result | Vector where result is stored. Dimension must match dimensions of operands.

Referenced by IG.Num.AffineTransformationSquare.TransformCoordinatesPlain().

static void IG.Num.VectorBase.Add | ( | IVector | a,
|  | IVector | b,
|  | IVector | result
| ) |  |
| inline static

Sums two vectors and stores the result in the specified result vector. WARNING: dimensions of vectors must match, otherwise an exception is thrown.

Parameters

  a | First operand.
  b | Second operand.
  result | Vector where result is stored. Dimension must match dimensions of operands.

Referenced by IG.Num.AnalysisResults.CreateExample(), IG.Num.ScalarFunctionLinear.GradientPlain(), IG.Num.ScalarFunctionQuadratic.GradientPlain(), IG.Num.ScalarFunctionUntransformedBase.Test(), and IG.Num.VectorBase.TestGramSchmidtOrthogonalization().

static void IG.Num.VectorBase.Add | ( | IVector | a,
|  | IVector | b,
|  | ref IVector | result
| ) |  |
| inline static

Sums two vectors and stores the result in the specified result vector. WARNING: dimensions of operands must match, otherwise an exception is thrown. If dimensions of the result do not match then teh result is re-allocated.

Parameters

  a | First operand.
  b | Second operand.
  result | Vector where copy will be stored.

References IG.Num.IVector.GetNew().

static void IG.Num.VectorBase.SubtractPlain | ( | IVector | a,
|  | IVector | b,
|  | IVector | result
| ) |  |
| inline static

Subtracts two vectors (a - b ) and stores the result in the specified result vector. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of vectors must match, otherwise an exception is thrown.

Parameters

  a | First operand.
  b | Second operand.
  result | Vector where result is stored. Dimension must match dimensions of operands.

Referenced by IG.Num.VectorBase.OrthogonalizeGramSchmidt(), IG.Num.VectorBase.OrthogonalizeGramSchmidtNonRobust(), and IG.Num.AffineTransformationSquare.TransformBackCoordinatesPlain().

static void IG.Num.VectorBase.Subtract | ( | IVector | a,
|  | IVector | b,
|  | IVector | result
| ) |  |
| inline static

Subtracts two vectors (a - b ) and stores the result in the specified result vector. WARNING: dimensions of vectors must match, otherwise an exception is thrown.

Parameters

  a | First operand.
  b | Second operand.
  result | Vector where result is stored. Dimension must match dimensions of operands.

Referenced by IG.Num.MatrixBase.CheckTestResult(), IG.Neural.NeuralTadej.ExampleCasting(), IG.Neural.NeuralTadej.ExampleQuadratic(), IG.Num.NeuralApproximatorBase.ExampleQuadratic(), IG.Num.NeuralApproximatorBase.ExampleSaveNetwork(), IG.Neural.NeuralTadej.ExampleStore(), IG.Num.ScalarFunctionUntransformedBase.Test(), IG.Num.MatrixBase.TestCholeskyDecomposition(), IG.Num.PointCloud< PointLinkType, PointContainerType, PointType >.TestClosestPoints(), IG.Num.PointCloud< PointLinkType, PointContainerType, PointType >.TestClosestPointsWithOutputs(), IG.Num.SpeedTestCpu.TestComputationalTimesCholesky_Base(), IG.Num.SpeedTestCpu.TestComputationalTimesCholesky_IGLib(), IG.Num.SpeedTestCpu.TestComputationalTimesLdlt_Base(), IG.Num.SpeedTestCpu.TestComputationalTimesLU_Base(), IG.Num.SpeedTestCpu.TestComputationalTimesLU_IGLib(), IG.Num.SpeedTestCpu.TestComputationalTimesQR_IGLib(), IG.Num.ScalarFunctionUntransformedBase.TestGradient(), IG.Num.MatrixBase.TestLdltDecomposition(), IG.Num.MatrixBase.TestLuDecomposition(), IG.Num.NeuralApproximatorBase.TestMapping(), and IG.Neural.NeuralTadej.TrainNetwork().

static void IG.Num.VectorBase.Subtract | ( | IVector | a,
|  | IVector | b,
|  | ref IVector | result
| ) |  |
| inline static

Subtracts two vectors (a - b ) and stores the result in the specified result vector. WARNING: dimensions of operands must match, otherwise an exception is thrown. If dimensions of the result do not match then teh result is re-allocated.

Parameters

  a | First operand.
  b | Second operand.
  result | Vector where copy will be stored.

References IG.Num.IVector.GetNew().

static void IG.Num.VectorBase.OrthogonalProjectionPlain | ( | IVector | original,
|  | IVector | onWhich,
|  | double | onWhichProductSelf,
|  | IVector | result,
|  | double | tolerance = `0.0`
| ) |  |
| inline static

Calculates orthogonal projection of the original vector on the specified vector, and stores the projection in the specified result, where the inner project of the vector to which projection is performed is specified.

The dot product is used as inner product of the vector space.

No checks are performed (e.g. dimension checks or whether references are non-null).

Parameters

  original | The vector that is orthogonally projected to another vector.
  onWhich | Vector on which the original vector is projected. It must be allocated with the same dimension as original .
  onWhichProductSelf | The specified inner product of onWhich by itself.

WARNING: this is square of the norm of vector corresponding to the specified dot product.

Parameters

  result | Vector where result is storeb. It must be allocated with the same dimension as input vectors.
  tolerance | Tolerance for the projust of projection vector by itself. Shoulld be greater or equal to 0.

Referenced by IG.Num.VectorBase.OrthogonalizeGramSchmidt(), and IG.Num.VectorBase.OrthogonalizeGramSchmidtNonRobust().

static void IG.Num.VectorBase.OrthogonalProjectionPlain | ( | IVector | original,
|  | IVector | onWhich,
|  | IVector | result,
|  | double | tolerance = `0.0`
| ) |  |
| inline static

Calculates orthogonal projection of the original vector on the specified vector, and stores the projection in the specified result.

The dot product is used as inner product of the vector space.

No checks are performed (e.g. dimension checks or whether references are non-null).

Parameters

  original | The vector that is orthogonally projected to another vector.
  onWhich | Vector on which the original vector is projected. It must be allocated with the same dimension as original .
  result | Vector where result is storeb. It must be allocated with the same dimension as input vectors.
  tolerance | Tolerance for the projust of projection vector by itself. Shoulld be greater or equal to 0.

static void IG.Num.VectorBase.OrthogonalProjection | ( | IVector | original,
|  | IVector | onWhich,
|  | double | onWhichProductSelf,
|  | ref IVector | result,
|  | double | tolerance = `0.0`
| ) |  |
| inline static

Calculates orthogonal projection of the original vector on the specified vector, and stores the projection in the specified result, where the inner project of the vector to which projection is performed is specified.

The dot product is used as inner product of the vector space.

No checks are performed (e.g. dimension checks or whether references are non-null).

Parameters

  original | The vector that is orthogonally projected to another vector.
  onWhich | Vector on which the original vector is projected. It must be allocated with the same dimension as original .
  onWhichProductSelf | The specified inner product of onWhich by itself.
  result | Vector where result is storeb. It must be allocated with the same dimension as input vectors.
  tolerance | Tolerance for the projust of projection vector by itself. Shoulld be greater or equal to 0.

References IG.Num.IVector.GetNew(), and IG.Num.VectorBase.Resize().

static void IG.Num.VectorBase.OrthogonalProjection | ( | IVector | original,
|  | IVector | onWhich,
|  | ref IVector | result,
|  | double | tolerance = `0.0`
| ) |  |
| inline static

Calculates orthogonal projection of the original vector on the specified vector, and stores the projection in the specified result.

The dot product is used as inner product of the vector space.

No checks are performed (e.g. dimension checks or whether references are non-null).

Parameters

  original | The vector that is orthogonally projected to another vector.
  onWhich | Vector on which the original vector is projected. It must be allocated with the same dimension as original .
  result | Vector where result is storeb. It must be allocated with the same dimension as input vectors.
  tolerance | Tolerance for the projust of projection vector by itself. Shoulld be greater or equal to 0.

References IG.Num.IVector.GetNew(), and IG.Num.VectorBase.Resize().

static void IG.Num.VectorBase.ArrayAddPlain | ( | IVector | a,
|  | double | scal,
|  | IVector | result
| ) |  |
| inline static

Addition of a scalar to all components of a vector. This is a plain version of the method that does not perform any consistency checks. Vector operand must be defined (non-null).

Parameters

  v1 | First operand (vector).
  d | Second operand (scalar).
  result | Result.

static void IG.Num.VectorBase.ArrayAdd | ( | IVector | a,
|  | double | scal,
|  | IVector | result
| ) |  |
| inline static

Addition of a scalar to all components of a vector. Vector operand must be defined (non-null).

Parameters

  v1 | First operand (vector).
  d | Second operand (scalar).
  result | Result.

static void IG.Num.VectorBase.ArrayAdd | ( | IVector | a,
|  | double | scal,
|  | ref IVector | result
| ) |  |
| inline static

Addition of a scalar to all components of a vector. Vector operand must be defined (non-null).

Parameters

  v1 | First operand (vector).
  d | Second operand (scalar).
  result | Result.

References IG.Num.IVector.GetNew().

static void IG.Num.VectorBase.ArraySubtractPlain | ( | IVector | a,
|  | double | scal,
|  | IVector | result
| ) |  |
| inline static

Subtraction of a scalar from all components of a vector. This is a plain version of the method that does not perform any consistency checks. Vector operand must be defined (non-null).

Parameters

  v1 | First operand (vector).
  d | Second operand (scalar).
  result | Result.

static void IG.Num.VectorBase.ArraySubtract | ( | IVector | a,
|  | double | scal,
|  | IVector | result
| ) |  |
| inline static

Subtraction of a scalar from all components of a vector. Vector operand must be defined (non-null).

Parameters

  v1 | First operand (vector).
  d | Second operand (scalar).
  result | Result.

static void IG.Num.VectorBase.ArraySubtract | ( | IVector | a,
|  | double | scal,
|  | ref IVector | result
| ) |  |
| inline static

Subtraction of a scalar to all components of a vector. Vector operand must be defined (non-null).

Parameters

  v1 | First operand (vector).
  d | Second operand (scalar).
  result | Result.

References IG.Num.IVector.GetNew().

static void IG.Num.VectorBase.MultiplyPlain | ( | IVector | a,
|  | double | scal,
|  | IVector | result
| ) |  |
| inline static

Multiplication of a vector by a scalar. This is a plain version of the method that does not perform any consistency checks. Vector operand must be defined (non-null).

Parameters

  v1 | First operand (vector).
  d | Second operand (scalar).
  result | Result.

Referenced by IG.Num.ScalarFunctionRadialUntransformed.GradientPlain(), IG.Num.VectorBase.OrthogonalizeGramSchmidt(), IG.Num.VectorBase.OrthogonalizeGramSchmidtNonRobust(), and IG.Num.ScalarFunctionRadial.ReferenceGradientPlain().

static void IG.Num.VectorBase.Multiply | ( | IVector | a,
|  | double | scal,
|  | IVector | result
| ) |  |
| inline static

Multiplication of a vector by a scalar. Vector operand must be defined (non-null).

Parameters

  v1 | First operand (vector).
  d | Second operand (scalar).
  result | Result.

Referenced by IG.Num.ScalarFunctionUntransformedBase.Test(), IG.Num.ScalarFunctionUntransformedBase.TestGradient(), IG.Num.ScalarFunctionUntransformedBase.TestHessian(), and IG.Num.ScalarFunctionUntransformedBase.TestSpeed().

static void IG.Num.VectorBase.Multiply | ( | IVector | a,
|  | double | scal,
|  | ref IVector | result
| ) |  |
| inline static

Multiplication of a vector by a scalar. Vector operand must be defined (non-null).

Parameters

  v1 | First operand (vector).
  d | Second operand (scalar).
  result | Result.

References IG.Num.IVector.GetNew().

static void IG.Num.VectorBase.ScalePlain | ( | IVector | a,
|  | double | scal,
|  | IVector | result
| ) |  |
| inline static

Multiplication of a vector by a scalar. This is a plain version of the method that does not perform any consistency checks. Vector operand must be defined (non-null).

Parameters

  v1 | First operand (vector).
  d | Second operand (scalar).
  result | Result.

static void IG.Num.VectorBase.Scale | ( | IVector | a,
|  | double | scal,
|  | IVector | result
| ) |  |
| inline static

Multiplication of a vector by a scalar. Vector operand must be defined (non-null).

Parameters

  v1 | First operand (vector).
  d | Second operand (scalar).
  result | Result.

static void IG.Num.VectorBase.Scale | ( | IVector | a,
|  | double | scal,
|  | ref IVector | result
| ) |  |
| inline static

Multiplication of a vector by a scalar. Vector operand must be defined (non-null).

Parameters

  v1 | First operand (vector).
  d | Second operand (scalar).
  result | Result.

References IG.Num.IVector.GetNew().

static void IG.Num.VectorBase.DividePlain | ( | IVector | a,
|  | double | scal,
|  | IVector | result
| ) |  |
| inline static

Division of a vector by a scalar. This is a plain version of the method that does not perform any consistency checks. Vector operand must be defined (non-null).

Parameters

  v1 | First operand (vector).
  d | Second operand (scalar).
  result | Result.

static void IG.Num.VectorBase.Divide | ( | IVector | a,
|  | double | scal,
|  | IVector | result
| ) |  |
| inline static

Division of a vector by a scalar. Vector operand must be defined (non-null).

Parameters

  v1 | First operand (vector).
  d | Second operand (scalar).
  result | Result.

Referenced by IG.Num.ScalarFunctionUntransformedBase.Test().

static void IG.Num.VectorBase.Divide | ( | IVector | a,
|  | double | scal,
|  | ref IVector | result
| ) |  |
| inline static

Division of a vector by a scalar. Vector operand must be defined (non-null).

Parameters

  v1 | First operand (vector).
  d | Second operand (scalar).
  result | Result.

References IG.Num.IVector.GetNew().

static double IG.Num.VectorBase.ScalarProductPlain | ( | IVector | a,
|  | IVector | b
| ) |  |
| inline static

Scalar product of teo vectors. This is a plain version of the method that does not perform any consistency checks.

Parameters

  a | First operand (vector).
  b | Second operand (vector).

Returns
  Scalar product of operands.

static double IG.Num.VectorBase.ScalarProduct | ( | IVector | a,
|  | IVector | b
| ) |  |
| inline static

Scalar product of teo vectors.

Parameters

  a | First operand (vector).
  b | Second operand (vector).

Returns
  Scalar product of operands.

Referenced by IG.Num.VectorBase.TestGramSchmidtOrthogonalization(), IG.Num.ScalarFunctionLinear.Value(), and IG.Num.ScalarFunctionQuadratic.Value().

static void IG.Num.VectorBase.DyadicProductPlain | ( | IVector | a,
|  | IVector | b,
|  | IMatrix | result
| ) |  |
| inline static

Calculates dyadic product of two vectors and stores the result in the specified result matrix. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions must match, otherwise an exception is thrown.

Parameters

  a | First operand.
  b | Second operand.
  result | Matrix where result is stored. Dimension must match dimensions of operands.

static void IG.Num.VectorBase.DyadicProduct | ( | IVector | a,
|  | IVector | b,
|  | IMatrix | result
| ) |  |
| inline static

Calculates dyadic product of two vectors and stores the result in the specified result matrix. WARNING: dimensions must match, otherwise an exception is thrown.

Parameters

  a | First operand.
  b | Second operand.
  result | Matrix where result is stored. Dimension must match dimensions of operands.

static void IG.Num.VectorBase.DyadicProduct | ( | IVector | a,
|  | IVector | b,
|  | ref IMatrix | result
| ) |  |
| inline static

Calculates dyadic product of two vectors and stores the result in the specified result matrix. WARNING: dimensions of operands must match, otherwise an exception is thrown. If dimensions of the result do not match then teh result is re-allocated.

Parameters

  a | First operand.
  b | Second operand.
  result | Matrix where copy will be stored.

References IG.Num.IVector.GetNewMatrix().

static void IG.Num.VectorBase.CrossProductPlain | ( | IVector | a,
|  | IVector | b,
|  | IVector | result
| ) |  |
| inline static

Calculates a vector product (cross product) of two vectors and stores the result in the specified result vector. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of all vectors must be 3, otherwise an exception is thrown.

Parameters

  a | First operand.
  b | Second operand.
  result | Vector where result is stored. Dimension must match dimensions of operands.

static void IG.Num.VectorBase.CrossProduct | ( | IVector | a,
|  | IVector | b,
|  | IVector | result
| ) |  |
| inline static

Calculates a vector product (cross product) of two vectors and stores the result in the specified result vector. WARNING: dimensions of all vectors must be 3, otherwise an exception is thrown.

Parameters

  a | First operand.
  b | Second operand.
  result | Vector where result is stored. Dimension must match dimensions of operands.

static void IG.Num.VectorBase.CrossProduct | ( | IVector | a,
|  | IVector | b,
|  | ref IVector | result
| ) |  |
| inline static

Calculates a vector product (cross product) of two vectors and stores the result in the specified result vector. WARNING: dimensions of operands must match, otherwise an exception is thrown. If dimensions of the result do not match then teh result is re-allocated.

Parameters

  a | First operand.
  b | Second operand.
  result | Vector where copy will be stored.

References IG.Num.IVector.GetNew().

static void IG.Num.VectorBase.VectorProductPlain | ( | IVector | a,
|  | IVector | b,
|  | IVector | result
| ) |  |
| inline static

Calculates a vector product (cross product) of two vectors and stores the result in the specified result vector. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of all vectors must be 3, otherwise an exception is thrown.

Parameters

  a | First operand.
  b | Second operand.
  result | Vector where result is stored. Dimension must match dimensions of operands.

static void IG.Num.VectorBase.VectorProduct | ( | IVector | a,
|  | IVector | b,
|  | IVector | result
| ) |  |
| inline static

Calculates a vector product (cross product) of two vectors and stores the result in the specified result vector. WARNING: dimensions of all vectors must be 3, otherwise an exception is thrown.

Parameters

  a | First operand.
  b | Second operand.
  result | Vector where result is stored. Dimension must match dimensions of operands.

static void IG.Num.VectorBase.VectorProduct | ( | IVector | a,
|  | IVector | b,
|  | ref IVector | result
| ) |  |
| inline static

Calculates a vector product (cross product) of two vectors and stores the result in the specified result vector. WARNING: dimensions of operands must match, otherwise an exception is thrown. If dimensions of the result do not match then teh result is re-allocated.

Parameters

  a | First operand.
  b | Second operand.
  result | Vector where copy will be stored.

static void IG.Num.VectorBase.ArrayProductPlain | ( | IVector | a,
|  | IVector | b,
|  | IVector | result
| ) |  |
| inline static

Calculates array product (element-by-element product) of two vectors and stores the result in the specified result vector. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of all vectors must be 3, otherwise an exception is thrown.

Parameters

  a | First operand.
  b | Second operand.
  result | Vector where result is stored. Dimension must match dimensions of operands.

Referenced by IG.Num.NeuralApproximatorBase.SetMaxToleranceRelstiveToRange(), and IG.Num.NeuralApproximatorBase.SetRmsToleranceRelstiveToRange().

static void IG.Num.VectorBase.ArrayProduct | ( | IVector | a,
|  | IVector | b,
|  | IVector | result
| ) |  |
| inline static

Calculates array product (element-by-element product) of two vectors and stores the result in the specified result vector. WARNING: dimensions of all vectors must be 3, otherwise an exception is thrown.

Parameters

  a | First operand.
  b | Second operand.
  result | Vector where result is stored. Dimension must match dimensions of operands.

static void IG.Num.VectorBase.ArrayProduct | ( | IVector | a,
|  | IVector | b,
|  | ref IVector | result
| ) |  |
| inline static

Calculates array product (element-by-element product) of two vectors and stores the result in the specified result vector. WARNING: dimensions of operands must match, otherwise an exception is thrown. If dimensions of the result do not match then teh result is re-allocated.

Parameters

  a | First operand.
  b | Second operand.
  result | Vector where copy will be stored.

References IG.Num.IVector.GetNew().

static void IG.Num.VectorBase.ArrayQuotientPlain | ( | IVector | a,
|  | IVector | b,
|  | IVector | result
| ) |  |
| inline static

Calculates array quotient (element-by-element division) of two vectors and stores the result in the specified result vector. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of all vectors must be 3, otherwise an exception is thrown.

Parameters

  a | First operand.
  b | Second operand.
  result | Vector where result is stored. Dimension must match dimensions of operands.

static void IG.Num.VectorBase.ArrayQuotient | ( | IVector | a,
|  | IVector | b,
|  | IVector | result
| ) |  |
| inline static

Calculates array quotient (element-by-element division) of two vectors and stores the result in the specified result vector. WARNING: dimensions of all vectors must be 3, otherwise an exception is thrown.

Parameters

  a | First operand.
  b | Second operand.
  result | Vector where result is stored. Dimension must match dimensions of operands.

static void IG.Num.VectorBase.ArrayQuotient | ( | IVector | a,
|  | IVector | b,
|  | ref IVector | result
| ) |  |
| inline static

Calculates array quotient (element-by-element division) of two vectors and stores the result in the specified result vector. WARNING: dimensions of operands must match, otherwise an exception is thrown. If dimensions of the result do not match then teh result is re-allocated.

Parameters

  a | First operand.
  b | Second operand.
  result | Vector where copy will be stored.

References IG.Num.IVector.GetNew().

static int IG.Num.VectorBase.GetHashCode | ( | IVector | vec | ) |
| inline static

Returns hash code of the specified vector.

Parameters

  vec | Vector whose hath code is returned.

This method should be used when overriding the GetHashCode() in vector classes, in order to unify equality check over different vector classes.

static bool IG.Num.VectorBase.Equals | ( | IVector | v1,
|  | IVector | v2
| ) |  |
| inline static

Returns true if the specified vectors are equal, false if not.

Parameters

  v1 | The first of the two vectors that are checked for equality.
  v2 | The second of the two vectors that are checked for equality.

This method should be used when overriding the Equals() method in vector classes, in order to unify calculation of hash code over different vector classes.

If both vectors are nulll or both have dimension less than 1 then vectors are considered equal.

This method is consistent with the VectorBase.Compare method, i.e. it returns the same value as the expression VectorBase.Compare(v1 , v2 ==0).

static int IG.Num.VectorBase.GetHashFunctionInt | ( | IVector | vec | ) |
| inline static

Returns an integer valued hash function of the specified vector object.

The returned value is calculated by the Util.GetHashFunctionInt method.

<vec>Vector object whose hash function is calculated and returned.</vec>

See also
  Util.GetHashFunctionInt

References IG.Lib.Util.GetHashFunctionInt().

static string IG.Num.VectorBase.GetHashFunctionString | ( | IVector | vec | ) |
| inline static

Returns a string valued hash function of the specified vector object.

The returned value is calculated by the Util.GetHashFunctionString method.

<vec>Vector object whose hash function is calculated and returned.</vec>

See also
  Util.GetHashFunctionString

References IG.Lib.Util.GetHashFunctionString().

static void IG.Num.VectorBase.OrthoNormalizeGramSchmidt | ( | IList< IVector > | original,
|  | ref IList< IVector > | resOrthogonal,
|  | ref IVector | resNorms,
|  | ref IVector | auxProjection,
|  | double | tolDependent = `1e-10`,
|  | bool | normalize = `false`,
|  | int | numRequestedVectors = `0`,
|  | IRandomGenerator | rand = `null`,
|  | int | maxExcessGenerated = `5`
| ) |  |
| inline static

Performs the Gramm-Schmidt orthogonalization procedure in order to calculate a set of orthonormal vectors from the specified set of arbitrary independent vectors.

This method is robust, it fails if input vectors are almost linearly dependent (limited by tolerance).

Parameters

  original | A set of original vectors, must be of the same dimensiions.
  resOrthogonal | Resulting list where a set of orthogonal vectors is stored.
  resNorms | A vector where norms of the resulting orthogonal vectors are stored. Its dimension must be at least equal to the number of original vectors, otherwise it is resized to the dimension of the original vectors.
  auxProjection | Auxiliary vector used in computatioin.
  tolDependent | Tolerance on the size of the vector after subtracting all projections, divided by original size.
  normalize | If true then the resulting vectors are normalized, otherwise they are not.
  numRequestedVectors | Number of requested normal vectors. If 0 then the number is the same as vector dimension.
  rand | Random number generator used for generation of random original vectors when this is necessary (i.e., when the number of provided linnearly independent original vector is smaller than the requested number of calculated vectors). If not specified then the global random number generator is taken.
  maxExcessGenerated | Maximal number of excessive original vectors that are randomly generated, to compensate for linearly dependent input vectors. This is the number of randomly generated input vectors above those eventually needed because of linear dependency or insufficient number of provided input vectors.

If 0 then only the minimal number of generated vectors is allowed in order to compensate for insufficient number of procided input vectors (i.e. less than the number of requested v.) o for linear dependency upon them. If any generated input vector is dependent on input and previously generated vectors then the operation will fail with exception thrown.

If -1 then generation of additional input vectors is not allowed at all, and in the case of insufficiency of input vectors (too few linearly independent vectors) operation will fail with exception thrown.

If positive, this number tells how many additional input vectors can be generated because other generated vectors (including the necessary ones - due to insufficiency of input vectors) suffered for linear dependency.

Returns
  The number of orthogonal vectors that were actually calculated from the specified original vectors. This coincides with the dimension of the space spanned by the provided original vectors.

static int IG.Num.VectorBase.OrthogonalizeGramSchmidt | ( | IList< IVector > | original,
|  | ref IList< IVector > | resOrthogonal,
|  | ref IVector | resNorms,
|  | ref IVector | auxProjection,
|  | double | tolDependent = `1e-10`,
|  | bool | normalize = `false`,
|  | int | numRequestedVectors = `0`,
|  | IRandomGenerator | rand = `null`,
|  | int | maxExcessGenerated = `5`
| ) |  |
| inline static

Performs the Gramm-Schmidt orthogonalization procedure in order to calculate a set of orthogonall vectors from the specified set of arbitrary independent vectors.

This method is robust, if input vectors are almost linearly dependent (limited by tolerance) then random iput vectors are generated and replace the original ones, until the orthogonal set is finally created..

Parameters

  original | A set of original vectors, must be of the same dimensiions.
  resOrthogonal | Resulting list where a set of orthogonal vectors is stored.
  resNorms | A vector where norms of the resulting orthogonal vectors are stored. Its dimension must be at least equal to the number of original vectors, otherwise it is resized to the dimension of the original vectors.
  auxProjection | Auxiliary vector used in computatiioin.
  tolDependent | Tolerance on the size of the vector after subtracting all projections, divided by original size..
  normalize | If true then the resulting vectors are normalized, otherwise they are not.
  numRequestedVectors | Number of orthogonal vectors to be calculated. If 0 then the number is the same as vector dimension. If larger than dimension then exception is thrown.
  rand | Random number generator used for generation of random original vectors when this is necessary (i.e., when the number of provided linnearly independent original vector is smaller than the requested number of calculated vectors). If not specified then the global random number generator is taken.
  maxExcessGenerated | Maximal number of excessive original vectors that are randomly generated, to compensate for linearly dependent input vectors. This is the number of randomly generated input vectors above those eventually needed because of linear dependency or insufficient number of provided input vectors.

If 0 then only the minimal number of generated vectors is allowed in order to compensate for insufficient number of procided input vectors (i.e. less than the number of requested v.) o for linear dependency upon them. If any generated input vector is dependent on input and previously generated vectors then the operation will fail with exception thrown.

If -1 then generation of additional input vectors is not allowed at all, and in the case of insufficiency of input vectors (too few linearly independent vectors) operation will fail with exception thrown. This effectively means that the we have nonrobust procedure.

If positive, this number tells how many additional input vectors can be generated because other generated vectors (including the necessary ones - due to insufficiency of input vectors) suffered for linear dependency.

Returns
  The number of orthogonal vectors that were actually calculated from the specified original vectors. This coincides with the dimension of the space spanned by the provided original vectors.

References IG.Num.VectorBase.Copy(), IG.Num.IVector.GetNew(), IG.Num.RandomGenerator.Global, IG.Num.VectorBase.MultiplyPlain(), IG.Num.VectorBase.Norm2Plain(), IG.Num.VectorBase.OrthogonalProjectionPlain(), IG.Num.VectorBase.Resize(), IG.Num.VectorBase.SetRandom(), and IG.Num.VectorBase.SubtractPlain().

static void IG.Num.VectorBase.OrthoNormalizeGramSchmidtNonRobust | ( | IList< IVector > | original,
|  | ref IList< IVector > | resOrthogonal,
|  | ref IVector | resNorms,
|  | ref IVector | auxProjection,
|  | double | tolSize = `0`,
|  | bool | normalize = `false`,
|  | bool | modifiedGrammSchmidt = `true`
| ) |  |
| inline static

Performs the Gramm-Schmidt orthogonalization procedure in order to calculate a set of orthonormal vectors from the specified set of arbitrary independent vectors.

This method is not robust, it fails if input vectors are almost linearly dependent (limited by tolerance).

Parameters

  original | A set of original vectors, must be of the same dimensiions.
  resOrthogonal | Resulting list where a set of orthogonal vectors is stored.
  resNorms | A vector where norms of the resulting orthogonal vectors are stored. Its dimension must be at least equal to the number of original vectors, otherwise it is resized to the dimension of the original vectors.
  auxProjection | Auxiliary vector used in computatioin.
  tolSize | Tolerance on the size of the vector after subtracting all projections.
  normalize | If true then the resulting vectors are normalized, otherwise they are not.
  modifiedGrammSchmidt | If true (which is default) then a more stable modification is used.

static void IG.Num.VectorBase.OrthogonalizeGramSchmidtNonRobust | ( | IList< IVector > | original,
|  | ref IList< IVector > | resOrthogonal,
|  | ref IVector | resNorms,
|  | ref IVector | auxProjection,
|  | double | tolSize = `0`,
|  | bool | normalize = `false`,
|  | bool | modifiedGrammSchmidt = `true`
| ) |  |
| inline static

Performs the Gramm-Schmidt orthogonalization procedure in order to calculate a set of orthogonall vectors from the specified set of arbitrary independent vectors.

This method is not robust, it fails if input vectors are almost linearly dependent (limited by tolerance).

Parameters

  original | A set of original vectors, must be of the same dimensiions.
  resOrthogonal | Resulting list where a set of orthogonal vectors is stored.
  resNorms | A vector where norms of the resulting orthogonal vectors are stored. Its dimension must be at least equal to the number of original vectors, otherwise it is resized to the dimension of the original vectors.
  auxProjection | Auxiliary vector used in computatiioin.
  tolSize | Tolerance on the size of the vector after subtracting all projections.
  normalize | If true then the resulting vectors are normalized, otherwise they are not.
  modifiedGrammSchmidt | If true (which is default) then a more stable modification is used.

References IG.Num.VectorBase.Copy(), IG.Num.VectorBase.MultiplyPlain(), IG.Num.VectorBase.Norm2Plain(), IG.Num.VectorBase.OrthogonalProjectionPlain(), IG.Num.VectorBase.Resize(), and IG.Num.VectorBase.SubtractPlain().

static bool IG.Num.VectorBase.TestGramSchmidtOrthogonalization | ( | int | dim,
|  | int | numRepetitions = `1`,
|  | double | tol = `1e-8`,
|  | int | outputLevel = `0`,
|  | IRandomGenerator | randomGenerator = `null`,
|  | bool | normalize = `false`,
|  | bool | modifiedGrammSchmidt = `true`,
|  | bool | nonRobust = `false`
| ) |  |
| inline static

Performs a test of Gramm-Schmidt orthogonalization on a set of random vectors.

Parameters

  dim | dimension of vectors to be orthogonalized.
  numGenerations | Nomber of repetitions (how many times the procedure is repeated).
  tol | Tolerance for zero length of resulting vectors.
  outputLevel | Level of output.
  randomGenerator | Random generator used.
  normalize | Whether resulting vectors are normalized.
  modifiedGrammSchmidt | Whether a modified gramm-schmidt algorithm is used.
  nonRobust | If true then non - robust algorithm is tested. Otherwise, the default robust algorithm is tested (which produces the required number of orthogonal vectors even if the dimension of the subspace spanned by the original vectors is smaller than dimension of the original vector space).

Returns
  True if the test completes successfully, false otherwise.

References IG.Num.VectorBase.Add(), IG.Lib.StopWatch1.CpuTime, IG.Num.RandomGenerator.Global, IG.Num.Vector.Random(), IG.Num.VectorBase.ScalarProduct(), IG.Lib.StopWatch1.Start(), IG.Lib.StopWatch1.Stop(), IG.Lib.StopWatch1.Time, and IG.Num.VectorBase.ToStringMath().

static VectorBase IG.Num.VectorBase.operator+ | ( | VectorBase | v | ) |
| inline static

Unary plus, returns the operand.

References IG.Num.VectorBase.GetCopyBase().

static VectorBase IG.Num.VectorBase.operator- | ( | VectorBase | v | ) |
| inline static

Unary negation, returns the negative operand.

References IG.Num.VectorBase.GetCopyBase(), and IG.Num.VectorBase.Negate().

static VectorBase IG.Num.VectorBase.operator+ | ( | VectorBase | a,
|  | VectorBase | b
| ) |  |
| inline static

Vector addition.

References IG.Num.VectorBase.GetNewBase().

static VectorBase IG.Num.VectorBase.operator- | ( | VectorBase | a,
|  | VectorBase | b
| ) |  |
| inline static

Vector subtraction.

References IG.Num.VectorBase.GetNewBase().

static double IG.Num.VectorBase.operator* | ( | VectorBase | a,
|  | VectorBase | b
| ) |  |
| inline static

Scalar product of two vectors.

static VectorBase IG.Num.VectorBase.operator* | ( | VectorBase | a,
|  | double | b
| ) |  |
| inline static

Product of a vector by a scalar.

References IG.Num.VectorBase.GetNewBase().

static VectorBase IG.Num.VectorBase.operator* | ( | double | a,
|  | VectorBase | b
| ) |  |
| inline static

Product of a vector by a scalar.

References IG.Num.VectorBase.GetNewBase().

static VectorBase IG.Num.VectorBase.operator/ | ( | VectorBase | a,
|  | double | b
| ) |  |
| inline static

Vector subtraction.

References IG.Num.VectorBase.GetNewBase().

static string IG.Num.VectorBase.ToString | ( | IVector | vec | ) |
| inline static

Returns a string representation of the specified vector in a standard IGLib form.

Parameters

  vec | Vector whose string representation is returned.

References IG.Lib.Util.NullRepresentationString.

Referenced by IG.Num.VectorExtensions.ToString().

static string IG.Num.VectorBase.ToStringMath | ( | IVector | vec | ) |
| inline static

Returns a string representation of the specified vector in a standard IGLib form (Mathematica-like format but with C representation of numbers).

Parameters

  vec | Vector whose string representation is returned.

References IG.Num.IVector.ToString().

Referenced by IG.Num.VectorBase.TestGramSchmidtOrthogonalization(), IG.Num.VectorExtensions.ToStringMath(), IG.Num.AnalysisResults.ToStringMath(), and IG.Num.AnalysisResults.ToStringRequestMath().

static string IG.Num.VectorBase.ToString | ( | IVector | vec,
|  | string | elementFormat
| ) |  |
| inline static

Returns a string representation of the specified vector in a standard IGLib form, with the specified format for elements of the vector.

Parameters

  vec | Vector whose string representation is returned.
  elementFormat | Format specification for printing individual element.

References IG.Lib.Util.NullRepresentationString.

static string IG.Num.VectorBase.ToStringMath | ( | IVector | vec,
|  | string | elementFormat
| ) |  |
| inline static

Returns a string representation of the specified vector in a standard IGLib form (Mathematica-like format but with C representation of numbers), with the specified format for elements of the vector.

Parameters

  vec | Vector whose string representation is returned.
  elementFormat | Format specification for printing individual element.

References IG.Num.IVector.ToString().

static void IG.Num.VectorBase.SaveJson | ( | IVector | vec,
|  | string | filePath
| ) |  |
| inline static

Saves (serializes) the specified vector to the specified JSON file. File is owerwritten if it exists.

Parameters

  vec | Object that is saved to a file.
  inputFilePath | Path to the file in which object is is saved.

Referenced by IG.Neural.NeuraApproximationFileManager.ClientTestCalculateApproximation(), IG.Neural.NeuralAllpicationCommands.CmdNeuralCalculateApproximationPlain(), IG.Neural.MappingApproximationFileManager.WriteFunctionInput(), IG.Neural.MappingApproximationFileManager.WriteFunctionOutput(), IG.Neural.NeuraApproximationFileManager.WriteNeuralInput(), and IG.Neural.NeuraApproximationFileManager.WriteNeuralOutput().

static void IG.Num.VectorBase.SaveJson | ( | IVector | vec,
|  | string | filePath,
|  | bool | append
| ) |  |
| inline static

Saves (serializes) the specified vector to the specified JSON file. If the file already exists, contents either overwrites the file or is appended at the end, dependent on the value of the append flag.

Parameters

  vec | Object that is saved to a file.
  inputFilePath | Path to the file in which object is saved.
  append | Specifies whether serialized data is appended at the end of the file in the case that the file already exists.

static void IG.Num.VectorBase.LoadJson | ( | string | filePath,
|  | ref IVector | vecRestored
| ) |  |
| inline static

Restores (deserializes) a vector from the specified file in JSON format.

Parameters

  inputFilePath | File from which object is restored.
  vecRestored | Object that is restored by deserialization.

Referenced by IG.Num.OptFileManager.ClientTestCalculateAnalysisResults(), IG.Neural.NeuraApproximationFileManager.ClientTestCalculateApproximation(), IG.Neural.MappingApproximationFileManager.ClientTestCalculateMappingApproximation(), IG.Neural.NeuralAllpicationCommands.CmdNeuralCalculateApproximationPlain(), IG.Neural.MappingApproximationFileManager.ReadFunctionInput(), IG.Neural.MappingApproximationFileManager.ReadFunctionOutput(), IG.Neural.NeuraApproximationFileManager.ReadNeuralInput(), and IG.Neural.NeuraApproximationFileManager.ReadNeuralOutput().

static void IG.Num.VectorBase.SaveCsv | ( | IVector | vec,
|  | string | filePath
| ) |  |
| inline static

Saves the specified vector to a CSV file. It the specified file already exists then it is overwritten. Constant UtilStr.DefaultCsvSeparator is used as separator.

Parameters

  vec | Vector to be stored to a file.
  inputFilePath | Path of the file to which vector is stored.
  separator | Separator used in the CSV file.

References IG.Lib.UtilCsv.DefaultCsvSeparator.

Referenced by IG.Num.SimKosecFileManagerBase.WriteOutputValues().

static void IG.Num.VectorBase.SaveCsv | ( | IVector | vec,
|  | string | filePath,
|  | string | separator
| ) |  |
| inline static

Saves the specified vector to a CSV file. It the specified file already exists then it is overwritten.

Parameters

  vec | Vector to be stored to a file.
  inputFilePath | Path of the file to which vector is stored.
  separator | Separator used in the CSV file.

static void IG.Num.VectorBase.SaveCsv | ( | IVector | vec,
|  | string | filePath,
|  | bool | append
| ) |  |
| inline static

Saves the specified vector to a CSV file. Constant UtilStr.DefaultCsvSeparator is used as separator in CSV.

Parameters

  vec | Vector to be stored to a file.
  inputFilePath | Path of the file to which vector is stored.
  append | Specifies whether the data is appended at the end of the file in the case that the ifle already exists.

References IG.Lib.UtilCsv.DefaultCsvSeparator.

static void IG.Num.VectorBase.SaveCsv | ( | IVector | vec,
|  | string | filePath,
|  | string | separator,
|  | bool | append
| ) |  |
| inline static

Saves the specified vector to a CSV file.

Parameters

  vec | Vector to be stored to a file.
  inputFilePath | Path of the file to which vector is stored.
  separator | Separator used in the CSV file.
  append | Specifies whether the data is appended at the end of the file in the case that the ifle already exists.

References IG.Lib.UtilCsv.SaveCsv().

static void IG.Num.VectorBase.LoadCsv | ( | string | filePath,
|  | ref IVector | vecRestored
| ) |  |
| inline static

Reads a vector from a CSV file. Constant Str.DefaultCsvSeparator is used as separator in CSV file. If there are no components then a null vector is returned by this method (no exceptions thrown). If there are more than one rows in the CSV file then vector is read from the first row.

Parameters

    inputFilePath | Path to the file that contains a vector in CSV format. Parameters
    inputFilePath | Path to the file that vector is read form.
    vecRestored | Vector object where the read-in vector is stored.

References IG.Lib.UtilCsv.DefaultCsvSeparator.

Referenced by IG.Num.SimKosecFileManagerBase.ReadOutputValues().

static void IG.Num.VectorBase.LoadCsv | ( | string | filePath,
|  | string | separator,
|  | ref IVector | vecRestored
| ) |  |
| inline static

Reads a vector written in CSV format from a file. If there are no components then a null vector is returned by this method (no exceptions thrown). If there are more than one rows in the CSV file then vector is read from the first row.

Parameters

  inputFilePath | Path to the file that contains a vector in CSV format.
  separator | Separator that is used to separate values in a row in the CSV file.
  vecRestored | Vector object where the read-in vector is stored.

References IG.Lib.UtilCsv.LoadCsv(), and IG.Num.VectorBase.Resize().

static void IG.Num.VectorBase.LoadCsv | ( | string | filePath,
|  | int | rowNum,
|  | ref IVector | vecRestored
| ) |  |
| inline static

Reads a vector from the specified row of a CSV file. Constant UtilStr.DefaultCsvSeparator is used as CSV separator. If the specified row does not exisist in the file then exception is thrown.

Parameters

  inputFilePath | Path to the file that contains a vector in CSV format.
  rowNum | Number of the row from which the vector is read.
  vecRestored | Vector object where the read-in vector is stored.

References IG.Lib.UtilCsv.DefaultCsvSeparator.

static void IG.Num.VectorBase.LoadCsv | ( | string | filePath,
|  | int | rowNum,
|  | string | separator,
|  | ref IVector | vecRestored
| ) |  |
| inline static

Reads a vector from the specified row of a CSV file. If the specified row does not exisist in the file then exception is thrown.

Parameters

  inputFilePath | Path to the file that contains a vector in CSV format.
  rowNum | Number of the row from which the vector is read.
  separator | Separator that is used to separate values in a row in the CSV file.
  vecRestored | Vector object where the read-in vector is stored.

References IG.Lib.UtilCsv.LoadCsv(), and IG.Num.VectorBase.Resize().

override string IG.Num.VectorBase.ToString | ( |  | ) |
| inline

Returns a string representation of this vector in a standard IGLib form.

Implements IG.Num.IVector.

virtual string IG.Num.VectorBase.ToStringMath | ( |  | ) |
| inline virtual

Returns a string representation of this vector in a standard IGLib form (Mathematica-like format but with C representation of numbers).

Implements IG.Num.IVector.

virtual string IG.Num.VectorBase.ToString | ( | string | elementFormat | ) |
| inline virtual

Returns a string representation of the current vector in a standard IGLib form, with the specified format for elements of the vector.

Parameters

  vec | Vector whose string representation is returned.
  elementFormat | Format specification for printing individual element.

Implements IG.Num.IVector.

virtual string IG.Num.VectorBase.ToStringMath | ( | string | elementFormat | ) |
| inline virtual

Returns a string representation of the current vector in a standard IGLib form (Mathematica-like format but with C representation of numbers), with the specified format for elements of the vector.

Parameters

  vec | Vector whose string representation is returned.
  elementFormat | Format specification for printing individual element.

Implements IG.Num.IVector.

## Member Data Documentation

VectorStore IG.Num.VectorBase._matrixStore
| static private

## Property Documentation

abstract int IG.Num.VectorBase.Length
| get

Gets dimension of the vector.

abstract double IG.Num.VectorBase.this[int i]
| get set

Gets or sets the element indexed by `i` in the `Vector`.

Parameters

  i | Element index, 0 - based.

virtual double IG.Num.VectorBase.Norm
| get

Gets Euclidean norm of the vector.

virtual double IG.Num.VectorBase.Norm2
| get

Gets Euclidean norm of the vector.

virtual double IG.Num.VectorBase.NormEuclidean
| get

Gets Euclidean norm of the vector.

virtual double IG.Num.VectorBase.SquaredNorm
| get

Squared Euclidean norm, sum of squared components.

virtual double IG.Num.VectorBase.Norm1
| get

1-norm (Manhattan norm or Taxicab norm), sum of absolute values of components.

virtual double IG.Num.VectorBase.NormInf
| get

Infinity-norm, maximum absolute value of any component.

VectorStore IG.Num.VectorBase.VectorStore
| static get

Gets the matrix store for recycling auxiliary matrices.

Matrix store is created only once, on the first access.

The documentation for this class was generated from the following file:

- igbase/numeric/VectorBase.cs