UnityMol  0.9.6-875
UnityMol viewer / In developement
BenTools.Mathematics.Vector Class Reference
+ Inheritance diagram for BenTools.Mathematics.Vector:
+ Collaboration diagram for BenTools.Mathematics.Vector:

Public Member Functions

 Vector (int dim)
 
 Vector (params double[] X)
 
 Vector (Vector O)
 
 Vector (string S)
 
void Randomize (double Min, double Max)
 
void Randomize (Vector[] MinMax)
 
void Multiply (double r)
 
void Add (Vector V)
 
void Add (double d)
 
override string ToString ()
 
override bool Equals (object obj)
 
override int GetHashCode ()
 
int CompareTo (object obj)
 
virtual Vector Clone ()
 

Static Public Member Functions

static Vector operator- (Vector A, Vector B)
 
static Vector operator+ (Vector A, Vector B)
 
static double operator* (Vector A, Vector B)
 
static Vector operator* (Vector A, double B)
 
static Vector operator* (double A, Vector B)
 
static operator double[] (Vector A)
 
static double Dist (Vector V1, Vector V2)
 

Public Attributes

object Tag =null
 

Static Public Attributes

static int Precision = 10
 

Properties

double this[int i] [get, set]
 
int Dim [get]
 
double SquaredLength [get]
 
double ElementSum [get]
 

Private Member Functions

IEnumerator IEnumerable. GetEnumerator ()
 

Private Attributes

double[] data
 

Detailed Description

A vector class, implementing all interesting features of vectors

Definition at line 10 of file Vector.cs.

Constructor & Destructor Documentation

BenTools.Mathematics.Vector.Vector ( int  dim)

Build a new vector

Parameters
dimThe dimension

Definition at line 22 of file Vector.cs.

BenTools.Mathematics.Vector.Vector ( params double[]  X)

Build a new vector

Parameters
XThe elements of the vector

Definition at line 30 of file Vector.cs.

BenTools.Mathematics.Vector.Vector ( Vector  O)

Build a new vector as a copy of an existing one

Parameters
OThe existing vector

Definition at line 39 of file Vector.cs.

BenTools.Mathematics.Vector.Vector ( string  S)

Build a new vector from a string

Parameters
SA string, as produced by ToString

Definition at line 46 of file Vector.cs.

References BenTools.Mathematics.MathTools.HighLevelSplit().

+ Here is the call graph for this function:

Member Function Documentation

void BenTools.Mathematics.Vector.Add ( Vector  V)

Add another vector

Parameters
VV

Definition at line 151 of file Vector.cs.

Referenced by OptimalView.OptimalView.GetOptimalPosition().

+ Here is the caller graph for this function:

void BenTools.Mathematics.Vector.Add ( double  d)

Add a constant to all elements

Parameters
dThe constant

Definition at line 163 of file Vector.cs.

virtual Vector BenTools.Mathematics.Vector.Clone ( )
virtual

Get a copy of one vector

Returns

Definition at line 341 of file Vector.cs.

int BenTools.Mathematics.Vector.CompareTo ( object  obj)

Compare two vectors

Definition at line 314 of file Vector.cs.

References BenTools.Mathematics.Vector.Dim, and BenTools.Mathematics.Vector.SquaredLength.

static double BenTools.Mathematics.Vector.Dist ( Vector  V1,
Vector  V2 
)
static

Get the distance of two vectors

Definition at line 296 of file Vector.cs.

References BenTools.Mathematics.Vector.Dim.

override bool BenTools.Mathematics.Vector.Equals ( object  obj)

Compares this vector with another one

Parameters
obj
Returns

data[i].Equals(B.data[i]) &&

Definition at line 199 of file Vector.cs.

References BenTools.Mathematics.Vector.data.

Referenced by BenTools.Mathematics.VNode.ProcessCircleEvent().

+ Here is the caller graph for this function:

IEnumerator IEnumerable. BenTools.Mathematics.Vector.GetEnumerator ( )
private

Definition at line 171 of file Vector.cs.

override int BenTools.Mathematics.Vector.GetHashCode ( )

Retrieves a hashcode that is dependent on the elements

Returns
The hashcode

Definition at line 217 of file Vector.cs.

void BenTools.Mathematics.Vector.Multiply ( double  r)

Scale all elements by r

Parameters
rThe scalar

Definition at line 139 of file Vector.cs.

static BenTools.Mathematics.Vector.operator double[] ( Vector  A)
explicitstatic

Interprete the vector as a double-array

Definition at line 289 of file Vector.cs.

References BenTools.Mathematics.Vector.data.

static double BenTools.Mathematics.Vector.operator* ( Vector  A,
Vector  B 
)
static

Get the scalar product of two vectors

Definition at line 256 of file Vector.cs.

References BenTools.Mathematics.Vector.Dim.

static Vector BenTools.Mathematics.Vector.operator* ( Vector  A,
double  B 
)
static

Scale one vector

Definition at line 270 of file Vector.cs.

References BenTools.Mathematics.Vector.Dim.

static Vector BenTools.Mathematics.Vector.operator* ( double  A,
Vector  B 
)
static

Scale one vector

Definition at line 282 of file Vector.cs.

static Vector BenTools.Mathematics.Vector.operator+ ( Vector  A,
Vector  B 
)
static

Add two vectors

Definition at line 242 of file Vector.cs.

References BenTools.Mathematics.Vector.Dim.

static Vector BenTools.Mathematics.Vector.operator- ( Vector  A,
Vector  B 
)
static

Subtract two vectors

Definition at line 228 of file Vector.cs.

References BenTools.Mathematics.Vector.Dim.

void BenTools.Mathematics.Vector.Randomize ( double  Min,
double  Max 
)

Reset all elements with ransom values from the given range

Parameters
MinMin
MaxMax

Definition at line 114 of file Vector.cs.

References BenTools.Mathematics.MathTools.R.

void BenTools.Mathematics.Vector.Randomize ( Vector[]  MinMax)

Reset all elements with ransom values from the given range

Parameters
MinMaxMinMax[0] - Min MinMax[1] - Max

Definition at line 127 of file Vector.cs.

References BenTools.Mathematics.MathTools.R.

override string BenTools.Mathematics.Vector.ToString ( )

Convert the vector into a reconstructable string representation

Returns
A string from which the vector can be rebuilt

Definition at line 180 of file Vector.cs.

Member Data Documentation

double [] BenTools.Mathematics.Vector.data
private
int BenTools.Mathematics.Vector.Precision = 10
static

Global precision for any calculation

Definition at line 15 of file Vector.cs.

object BenTools.Mathematics.Vector.Tag =null

Definition at line 17 of file Vector.cs.

Property Documentation

double BenTools.Mathematics.Vector.ElementSum
get

The sum of all elements in the vector

Definition at line 99 of file Vector.cs.

double BenTools.Mathematics.Vector.SquaredLength
get

The squared length of the vector

Definition at line 88 of file Vector.cs.

Referenced by BenTools.Mathematics.Vector.CompareTo().

double BenTools.Mathematics.Vector.this[int i]
getset

Gets or sets the value of the vector at the given index

Definition at line 62 of file Vector.cs.


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