IGLib
1.5
The IGLib base library for development of numerical, technical and business applications.
|
Base class for real vectors. More...
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 |
Base class for real vectors.
$A Igor Jan08 Jul10 Nov10;
|
inlinevirtual |
Copies the current vector to an array.
|
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-().
|
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.
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/().
|
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.
|
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.
rowCount | Number of rows of the returned matrix. |
columnCount | Number of rows of the returned matrix. |
Implemented in IG.Num.Vector, IG.Num.Vector3d, and IG.Num.Vector2d.
|
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.
|
inlinevirtual |
Returns a deep copy of the current object.
Implements IG.Num.IVector.
|
inlinevirtual |
Creates and returns a new vector with the specified dimension, and of the same type as the current vector.
length | Dimension of the newly created vector. |
Implements IG.Num.IVector.
|
inlinevirtual |
Creates and returns a new vector with the same dimension and of the same type as the current vector.
Implements IG.Num.IVector.
|
inlinevirtual |
Creates and returns a new matrix with the specified dimensona, and of a type that is consistent with the type of the current vector.
rowCount | Number of rows of the returned matrix. |
columnCount | Number of rows of the returned matrix. |
Implements IG.Num.IVector.
|
inlinevirtual |
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.
|
inlinevirtual |
Sets all components of the current vector to 0.
Implements IG.Num.IVector.
|
inlinevirtual |
Sets all components of the current vector to the specified value.
elementValue | Value to which vector elements are set. |
Implements IG.Num.IVector.
|
inlinevirtual |
Sets the current vector to the specific unit vector (one component equals 1, others are 0).
which | Specifies which unit vector is set (i.e., which component equals 1). |
Implements IG.Num.IVector.
|
inlinevirtual |
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().
|
inlinevirtual |
Sets the current vector such that it contains random elements on the interval (0,1].
rnd | Random generator used to generate vector elements. |
Implements IG.Num.IVector.
|
inlinevirtual |
p-norm, p-th root of sum of absolute values of components raised to the power of p.
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).
ArgumentException | If p is less than 1.0. |
|
inlinestatic |
Returns Euclidean norm of the specified vector.
Vector can NOT be null (inthis case, exception is thrown).
|
inlinestatic |
Returns Euclidean norm of the specified vector.
Vector can be null (0 is returned in this case).
|
inlinestatic |
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().
|
inlinestatic |
Returns Euclidean norm of the specified vector.
Vector can be null (0 is returned in this case).
|
inlinestatic |
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.
|
inlinestatic |
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).
|
inlinestatic |
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).
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).
ArgumentException | If p is less than 1.0. |
References IG.Num.Vector.Length.
|
inlinestatic |
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).
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).
ArgumentException | If p is less than 1.0. |
|
inlinestatic |
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.
|
inlinestatic |
Returns the Infinity-norm (maximum absolute value of any element) of the specified vector.
Vector can be null (0 is returned in this case).
Returns Euqlidean distance between the specified two vectors.
WARNING: This is a plain version of the method that does not perform any consistency checks.
a | First vector. |
b | Second vector. |
Referenced by IG.Num.DistanceComparer< PointContainerType, PointType >.DefaultDistanceFunction(), and IG.Num.DistanceComparer< PointContainerType, PointType >.OutputDistance().
Returns Euqlidean distance between the specified two vectors.
WARNING: Dimensions must match, otherwise exception is thrown..
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().
|
inlinestatic |
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.
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().
|
inlinestatic |
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.
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). |
|
inlinestatic |
Returns weighted Euclidean norm of the specified vector.
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().
|
inlinestatic |
Returns weighted Euclidean norm of the specified vector.
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().
|
inline |
Returns a vector that equals a normalized current vector.
Implements IG.Num.IVector.
|
inline |
Normalizes the current vector.
|
inline |
|
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().
|
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().
|
inline |
Returns an integer valued hash function of the current vector object.
The returned value is calculated by the Util.GetHashFunctionInt method.
Implements IG.Num.IVector.
References IG.Lib.Util.GetHashFunctionInt().
|
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.
Implements IG.Num.IVector.
References IG.Lib.Util.GetHashFunctionString().
|
inlinestatic |
Sets all components of the current vector to 0.
vec | Vector whose components are set. |
|
inlinestatic |
Sets all components of the current vector to the specified value.
vec | Vector whose components are set. |
elementValue | Value to which vector elements are set. |
|
inlinestatic |
Sets the current vector to the specific unit vector (one component equals 1, others are 0).
vec | Vector whose components are set. |
which | Specifies which unit vector is set (i.e., which component equals 1). |
|
inlinestatic |
Sets the current vector such that it contains random elements on the interval (0,1].
vec | Vector whose components are set. |
References IG.Num.IRandomGenerator.NextDouble().
|
inlinestatic |
Sets the current vector such that it contains random elements on the interval (0,1].
vec | Vector whose components are set. |
rnd | Random generator used to generate vector elements. |
References IG.Num.IRandomGenerator.NextDouble().
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.
v1 | First vector to be compared. |
v2 | Second vector to be compared. |
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().
|
inlinestatic |
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.
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().
|
inlinestatic |
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.
vec | Vector that is resized. |
dimenson | Dimension to which vector is resized (if less or equal to 0 then exception is thrown). |
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.
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.
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().
Copies components of a vector to another vector. WARNING: dimensions of the copied vector and result vector must match.
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().
Copies components of a vectr to another vector. Resulting vector is allocated or reallocated if necessary.
a | Original vector. |
result | Vector where copy will be stored. |
References IG.Num.IVector.GetNew().
|
inlinestatic |
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.
a | Original vector. |
result | Vector where copy will be stored. Dimensions must match dimensions of original. |
|
inlinestatic |
Copies components of a vector to another vector. WARNING: dimensions of the copied vector and result vector must match.
a | Original vector. |
result | Vector where copy will be stored. Dimensions must match dimensions of original. |
|
inlinestatic |
Copies components of a vectr to another vector. Resulting vector is allocated or reallocated if necessary.
a | Original vector. |
result | Vector where copy will be stored. |
|
inlinestatic |
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.
a | Original vector. |
result | Vector where copy will be stored. Dimensions must match dimensions of original. |
|
inlinestatic |
Copies components of a vector to another vector. WARNING: dimensions of the copied vector and result vector must match.
a | Original vector. |
result | Vector where copy will be stored. Dimensions must match dimensions of original. |
|
inlinestatic |
Copies components of a vectr to another vector. Resulting vector is allocated or reallocated if necessary.
a | Original vector. |
result | Vector where copy will be stored. |
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.
a | Original vector. |
result | Vector where result is be stored. Dimensions must match dimensions of original. |
Stores a negative vector of the specified vector to another vector. WARNING: dimensions of the copied vector and result vector must match.
a | Original vector. |
result | Vector where result is be stored. Dimensions must match dimensions of original. |
Stores a negative vector of the specified vector to another vector. Resulting vector is allocated or reallocated if necessary.
a | Original vector. |
result | Vector where result is be stored. |
References IG.Num.IVector.GetNew().
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.
a | First operand. |
b | Second operand. |
result | Vector where result is stored. Dimension must match dimensions of operands. |
Referenced by IG.Num.AffineTransformationSquare.TransformCoordinatesPlain().
Sums two vectors and stores the result in the specified result vector. WARNING: dimensions of vectors must match, otherwise an exception is thrown.
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().
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.
a | First operand. |
b | Second operand. |
result | Vector where copy will be stored. |
References IG.Num.IVector.GetNew().
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.
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().
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.
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().
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.
a | First operand. |
b | Second operand. |
result | Vector where copy will be stored. |
References IG.Num.IVector.GetNew().
|
inlinestatic |
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).
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.
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().
|
inlinestatic |
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).
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. |
|
inlinestatic |
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).
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().
|
inlinestatic |
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).
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().
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).
v1 | First operand (vector). |
d | Second operand (scalar). |
result | Result. |
Addition of a scalar to all components of a vector. Vector operand must be defined (non-null).
v1 | First operand (vector). |
d | Second operand (scalar). |
result | Result. |
Addition of a scalar to all components of a vector. Vector operand must be defined (non-null).
v1 | First operand (vector). |
d | Second operand (scalar). |
result | Result. |
References IG.Num.IVector.GetNew().
|
inlinestatic |
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).
v1 | First operand (vector). |
d | Second operand (scalar). |
result | Result. |
Subtraction of a scalar from all components of a vector. Vector operand must be defined (non-null).
v1 | First operand (vector). |
d | Second operand (scalar). |
result | Result. |
|
inlinestatic |
Subtraction of a scalar to all components of a vector. Vector operand must be defined (non-null).
v1 | First operand (vector). |
d | Second operand (scalar). |
result | Result. |
References IG.Num.IVector.GetNew().
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).
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().
Multiplication of a vector by a scalar. Vector operand must be defined (non-null).
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().
Multiplication of a vector by a scalar. Vector operand must be defined (non-null).
v1 | First operand (vector). |
d | Second operand (scalar). |
result | Result. |
References IG.Num.IVector.GetNew().
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).
v1 | First operand (vector). |
d | Second operand (scalar). |
result | Result. |
Multiplication of a vector by a scalar. Vector operand must be defined (non-null).
v1 | First operand (vector). |
d | Second operand (scalar). |
result | Result. |
Multiplication of a vector by a scalar. Vector operand must be defined (non-null).
v1 | First operand (vector). |
d | Second operand (scalar). |
result | Result. |
References IG.Num.IVector.GetNew().
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).
v1 | First operand (vector). |
d | Second operand (scalar). |
result | Result. |
Division of a vector by a scalar. Vector operand must be defined (non-null).
v1 | First operand (vector). |
d | Second operand (scalar). |
result | Result. |
Referenced by IG.Num.ScalarFunctionUntransformedBase.Test().
Division of a vector by a scalar. Vector operand must be defined (non-null).
v1 | First operand (vector). |
d | Second operand (scalar). |
result | Result. |
References IG.Num.IVector.GetNew().
Scalar product of teo vectors.
a | First operand (vector). |
b | Second operand (vector). |
Referenced by IG.Num.VectorBase.TestGramSchmidtOrthogonalization(), IG.Num.ScalarFunctionLinear.Value(), and IG.Num.ScalarFunctionQuadratic.Value().
|
inlinestatic |
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.
a | First operand. |
b | Second operand. |
result | Matrix where result is stored. Dimension must match dimensions of operands. |
Calculates dyadic product of two vectors and stores the result in the specified result matrix. WARNING: dimensions must match, otherwise an exception is thrown.
a | First operand. |
b | Second operand. |
result | Matrix where result is stored. Dimension must match dimensions of operands. |
|
inlinestatic |
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.
a | First operand. |
b | Second operand. |
result | Matrix where copy will be stored. |
References IG.Num.IVector.GetNewMatrix().
|
inlinestatic |
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.
a | First operand. |
b | Second operand. |
result | Vector where result is stored. Dimension must match dimensions of operands. |
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.
a | First operand. |
b | Second operand. |
result | Vector where result is stored. Dimension must match dimensions of operands. |
|
inlinestatic |
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.
a | First operand. |
b | Second operand. |
result | Vector where copy will be stored. |
References IG.Num.IVector.GetNew().
|
inlinestatic |
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.
a | First operand. |
b | Second operand. |
result | Vector where result is stored. Dimension must match dimensions of operands. |
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.
a | First operand. |
b | Second operand. |
result | Vector where result is stored. Dimension must match dimensions of operands. |
|
inlinestatic |
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.
a | First operand. |
b | Second operand. |
result | Vector where copy will be stored. |
|
inlinestatic |
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.
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().
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.
a | First operand. |
b | Second operand. |
result | Vector where result is stored. Dimension must match dimensions of operands. |
|
inlinestatic |
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.
a | First operand. |
b | Second operand. |
result | Vector where copy will be stored. |
References IG.Num.IVector.GetNew().
|
inlinestatic |
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.
a | First operand. |
b | Second operand. |
result | Vector where result is stored. Dimension must match dimensions of operands. |
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.
a | First operand. |
b | Second operand. |
result | Vector where result is stored. Dimension must match dimensions of operands. |
|
inlinestatic |
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.
a | First operand. |
b | Second operand. |
result | Vector where copy will be stored. |
References IG.Num.IVector.GetNew().
|
inlinestatic |
Returns hash code of the specified vector.
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.
Returns true if the specified vectors are equal, false if not.
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).
|
inlinestatic |
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>
References IG.Lib.Util.GetHashFunctionInt().
|
inlinestatic |
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>
References IG.Lib.Util.GetHashFunctionString().
|
inlinestatic |
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).
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.
|
inlinestatic |
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..
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.
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().
|
inlinestatic |
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).
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. |
|
inlinestatic |
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).
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().
|
inlinestatic |
Performs a test of Gramm-Schmidt orthogonalization on a set of random vectors.
dim | dimension of vectors to be orthogonalized. |
numRepetitions | 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). |
References IG.Num.VectorBase.Add(), IG.Lib.StopWatch.CpuTime, IG.Num.RandomGenerator.Global, IG.Num.Vector.Random(), IG.Num.VectorBase.ScalarProduct(), IG.Lib.StopWatch.Start(), IG.Lib.StopWatch.Stop(), IG.Lib.StopWatch.Time, and IG.Num.VectorBase.ToStringMath().
|
inlinestatic |
Unary plus, returns the operand.
References IG.Num.VectorBase.GetCopyBase().
|
inlinestatic |
Unary negation, returns the negative operand.
References IG.Num.VectorBase.GetCopyBase(), and IG.Num.VectorBase.Negate().
|
inlinestatic |
Vector addition.
References IG.Num.VectorBase.GetNewBase().
|
inlinestatic |
Vector subtraction.
References IG.Num.VectorBase.GetNewBase().
|
inlinestatic |
Scalar product of two vectors.
|
inlinestatic |
Product of a vector by a scalar.
References IG.Num.VectorBase.GetNewBase().
|
inlinestatic |
Product of a vector by a scalar.
References IG.Num.VectorBase.GetNewBase().
|
inlinestatic |
Vector subtraction.
References IG.Num.VectorBase.GetNewBase().
|
inlinestatic |
Returns a string representation of the specified vector in a standard IGLib form.
vec | Vector whose string representation is returned. |
References IG.Lib.Util.NullRepresentationString.
Referenced by IG.Num.VectorExtensions.ToString().
|
inlinestatic |
Returns a string representation of the specified vector in a standard IGLib form (Mathematica-like format but with C representation of numbers).
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().
|
inlinestatic |
Returns a string representation of the specified vector in a standard IGLib form, with the specified format for elements of the vector.
vec | Vector whose string representation is returned. |
elementFormat | Format specification for printing individual element. |
References IG.Lib.Util.NullRepresentationString.
|
inlinestatic |
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.
vec | Vector whose string representation is returned. |
elementFormat | Format specification for printing individual element. |
References IG.Num.IVector.ToString().
|
inlinestatic |
Saves (serializes) the specified vector to the specified JSON file. File is owerwritten if it exists.
vec | Object that is saved to a file. |
filePath | 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().
|
inlinestatic |
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.
vec | Object that is saved to a file. |
filePath | 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. |
|
inlinestatic |
Restores (deserializes) a vector from the specified file in JSON format.
filePath | 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().
|
inlinestatic |
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.
vec | Vector to be stored to a file. |
filePath | 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().
|
inlinestatic |
Saves the specified vector to a CSV file. It the specified file already exists then it is overwritten.
vec | Vector to be stored to a file. |
filePath | Path of the file to which vector is stored. |
separator | Separator used in the CSV file. |
|
inlinestatic |
Saves the specified vector to a CSV file. Constant UtilStr.DefaultCsvSeparator is used as separator in CSV.
vec | Vector to be stored to a file. |
filePath | 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.
|
inlinestatic |
Saves the specified vector to a CSV file.
vec | Vector to be stored to a file. |
filePath | 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().
|
inlinestatic |
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.
filePath | Path to the file that contains a vector in CSV format.
|
References IG.Lib.UtilCsv.DefaultCsvSeparator.
Referenced by IG.Num.SimKosecFileManagerBase.ReadOutputValues().
|
inlinestatic |
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.
filePath | 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().
|
inlinestatic |
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.
filePath | 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.
|
inlinestatic |
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.
filePath | 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().
|
inline |
Returns a string representation of this vector in a standard IGLib form.
Implements IG.Num.IVector.
|
inlinevirtual |
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.
|
inlinevirtual |
Returns a string representation of the current vector in a standard IGLib form, with the specified format for elements of the vector.
vec | Vector whose string representation is returned. |
elementFormat | Format specification for printing individual element. |
Implements IG.Num.IVector.
|
inlinevirtual |
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.
vec | Vector whose string representation is returned. |
elementFormat | Format specification for printing individual element. |
Implements IG.Num.IVector.
|
staticprivate |
|
get |
Gets dimension of the vector.
|
getset |
Gets or sets the element indexed by i
in the Vector
.
i | Element index, 0 - based. |
|
get |
Gets Euclidean norm of the vector.
|
get |
Gets Euclidean norm of the vector.
|
get |
Gets Euclidean norm of the vector.
|
get |
Squared Euclidean norm, sum of squared components.
|
get |
1-norm (Manhattan norm or Taxicab norm), sum of absolute values of components.
|
get |
Infinity-norm, maximum absolute value of any component.
|
staticget |
Gets the matrix store for recycling auxiliary matrices.
Matrix store is created only once, on the first access.