![]() |
UnityMol
1.0.25beta
|
A vector class, implementing all interesting features of vectors More...
Public Member Functions | |
Vector (int dim) | |
Build a new vector More... | |
Vector (params float[] X) | |
Build a new vector More... | |
Vector (Vector O) | |
Build a new vector as a copy of an existing one More... | |
Vector (string S) | |
Build a new vector from a string More... | |
void | Randomize (float Min, float Max) |
Reset all elements with ransom values from the given range More... | |
void | Randomize (Vector[] MinMax) |
Reset all elements with ransom values from the given range More... | |
void | Multiply (float r) |
Scale all elements by r More... | |
void | Add (Vector V) |
Add another vector More... | |
void | Add (float d) |
Add a constant to all elements More... | |
override string | ToString () |
Convert the vector into a reconstructable string representation More... | |
override bool | Equals (object obj) |
Compares this vector with another one More... | |
override int | GetHashCode () |
Retrieves a hashcode that is dependent on the elements More... | |
int | CompareTo (object obj) |
Compare two vectors More... | |
virtual Vector | Clone () |
Get a copy of one vector More... | |
Static Public Member Functions | |
static Vector | operator - (Vector A, Vector B) |
Subtract two vectors More... | |
static Vector | operator+ (Vector A, Vector B) |
Add two vectors More... | |
static float | operator * (Vector A, Vector B) |
Get the scalar product of two vectors More... | |
static Vector | operator * (Vector A, float B) |
Scale one vector More... | |
static Vector | operator * (float A, Vector B) |
Scale one vector More... | |
static | operator float[] (Vector A) |
Interprete the vector as a float-array More... | |
static float | Dist (Vector V1, Vector V2) |
Get the distance of two vectors More... | |
Public Attributes | |
object | Tag = null |
Static Public Attributes | |
static int | Precision = 10 |
Global precision for any calculation More... | |
Properties | |
float | this[int i] [get, set] |
Gets or sets the value of the vector at the given index More... | |
int | Dim [get] |
The dimension of the vector More... | |
float | SquaredLength [get] |
The squared length of the vector More... | |
float | ElementSum [get] |
The sum of all elements in the vector More... | |
A vector class, implementing all interesting features of vectors
BenTools.Mathematics.Vector.Vector | ( | int | dim | ) |
Build a new vector
dim | The dimension |
BenTools.Mathematics.Vector.Vector | ( | params float [] | X | ) |
Build a new vector
X | The elements of the vector |
BenTools.Mathematics.Vector.Vector | ( | Vector | O | ) |
Build a new vector as a copy of an existing one
O | The existing vector |
BenTools.Mathematics.Vector.Vector | ( | string | S | ) |
Build a new vector from a string
S | A string, as produced by ToString |
void BenTools.Mathematics.Vector.Add | ( | Vector | V | ) |
Add another vector
V | V |
void BenTools.Mathematics.Vector.Add | ( | float | d | ) |
Add a constant to all elements
d | The constant |
|
virtual |
Get a copy of one vector
int BenTools.Mathematics.Vector.CompareTo | ( | object | obj | ) |
Compare two vectors
Get the distance of two vectors
override bool BenTools.Mathematics.Vector.Equals | ( | object | obj | ) |
Compares this vector with another one
obj |
data[i].Equals(B.data[i]) &&
override int BenTools.Mathematics.Vector.GetHashCode | ( | ) |
Retrieves a hashcode that is dependent on the elements
void BenTools.Mathematics.Vector.Multiply | ( | float | r | ) |
Scale all elements by r
r | The scalar |
Get the scalar product of two vectors
Subtract two vectors
|
explicitstatic |
Interprete the vector as a float-array
void BenTools.Mathematics.Vector.Randomize | ( | float | Min, |
float | Max | ||
) |
Reset all elements with ransom values from the given range
Min | Min |
Max | Max |
void BenTools.Mathematics.Vector.Randomize | ( | Vector [] | MinMax | ) |
Reset all elements with ransom values from the given range
MinMax | MinMax[0] - Min MinMax[1] - Max |
override string BenTools.Mathematics.Vector.ToString | ( | ) |
Convert the vector into a reconstructable string representation
|
static |
Global precision for any calculation
object BenTools.Mathematics.Vector.Tag = null |
|
get |
The dimension of the vector
|
get |
The sum of all elements in the vector
|
get |
The squared length of the vector
|
getset |
Gets or sets the value of the vector at the given index