-
Notifications
You must be signed in to change notification settings - Fork 9
MGroup.LinearAlgebra.Vectors
A vector that supports indexing and dimension querying. These are the most basic operations all vector classes must implement. Authors: Serafeim Bakalakos
public interface MGroup.LinearAlgebra.Vectors.IIndexable1DProperties
| Type | Name | Summary |
|---|---|---|
Double |
Item | Returns the entry at ``. |
Int32 |
Length | The number of entries of the vector. |
Methods
| Type | Name | Summary |
|---|---|---|
Boolean |
Equals(IIndexable1D other, Double tolerance = 1E-13) |
Returns true if 1) this and have the same `MGroup.LinearAlgebra.Vectors.IIndexable1D.Length` and 2) this[i] -[i] is within the acceptable `` for all i. |
Can return subvectors containing select entries. Authors: Serafeim Bakalakos
public interface MGroup.LinearAlgebra.Vectors.ISliceable1D
: IIndexable1DMethods
| Type | Name | Summary |
|---|---|---|
Vector |
GetSubvector(Int32[] indices) |
Returns a subvector with the entries of the original vector that correspond to the provided indices. The relative order of the entries in the returned subvector can be different than the original one. It is defined by the order of the provided indices. |
Vector |
GetSubvector(Int32 startInclusive, Int32 endExclusive) |
Returns a subvector with the entries of the original vector that correspond to the provided indices. The relative order of the entries in the returned subvector can be different than the original one. It is defined by the order of the provided indices. |
Operations specified by this interface modify the vector. Therefore it is possible that they may throw exceptions if they are used on sparse vector formats and the zero entries are overwritten. Authors: Serafeim Bakalakos
public interface MGroup.LinearAlgebra.Vectors.IVector
: IVectorView, IIndexable1D, IReducibleMethods
| Type | Name | Summary |
|---|---|---|
void |
AddNonContiguouslyFrom(Int32[] thisIndices, IVectorView otherVector, Int32[] otherIndices) |
Adds selected entries from to this vector: this[[i]] += [[i]], for 0 <= i < .Length = .Length. |
void |
AddNonContiguouslyFrom(Int32[] thisIndices, IVectorView otherVector) |
Adds selected entries from to this vector: this[[i]] += [[i]], for 0 <= i < .Length = .Length. |
void |
AxpyIntoThis(IVectorView otherVector, Double otherCoefficient) |
Performs the following operation for all i: this[i] = *[i] + this[i]. Optimized version of and . Named after BLAS axpy (y = a*x plus y). The resulting vector overwrites the entries of this. |
void |
AxpySubvectorIntoThis(Int32 destinationIndex, IVectorView sourceVector, Double sourceCoefficient, Int32 sourceIndex, Int32 length) |
Performs the following operation for consecutive entries starting from the provided indices: this[i] = * ``[i] + this[i]. |
void |
Clear() | Sets all entries to 0. For sparse or block vectors: the indexing arrays will not be mutated. Therefore the sparsity pattern will be preserved. The non-zero entries will be set to 0, but they will still be stored explicitly. |
void |
CopyFrom(IVectorView sourceVector) |
Copies all entries from `` to this MGroup.LinearAlgebra.Vectors.IVector. |
void |
CopyNonContiguouslyFrom(Int32[] thisIndices, IVectorView otherVector, Int32[] otherIndices) |
Copies selected entries from to this vector: this[[i]] = [[i]], for 0 <= i < .Length = .Length. |
void |
CopyNonContiguouslyFrom(IVectorView otherVector, Int32[] otherIndices) |
Copies selected entries from to this vector: this[[i]] = [[i]], for 0 <= i < .Length = .Length. |
void |
CopySubvectorFrom(Int32 destinationIndex, IVectorView sourceVector, Int32 sourceIndex, Int32 length) |
Copies consecutive entries from to this MGroup.LinearAlgebra.Vectors.IVector starting from the provided indices. |
void |
DoEntrywiseIntoThis(IVectorView otherVector, Func<Double, Double, Double> binaryOperation) |
Performs a binary operation on each pair of entries: this[i] = (this[i], [i]). The resulting vector overwrites the entries of this. |
void |
DoToAllEntriesIntoThis(Func<Double, Double> unaryOperation) |
Performs a unary operation on each entry: this[i] = ``(this[i]). The resulting vector overwrites the entries of this. |
void |
LinearCombinationIntoThis(Double thisCoefficient, IVectorView otherVector, Double otherCoefficient) |
Performs the following operation for all i: this[i] = * this[i] + * ``[i]. Optimized version of MGroup.LinearAlgebra.Vectors.IVector.DoEntrywiseIntoThis(MGroup.LinearAlgebra.Vectors.IVectorView,System.Func{System.Double,System.Double,System.Double}). The resulting vector overwrites the entries of this. |
void |
ScaleIntoThis(Double scalar) |
Performs the following operation for all i: this[i] = `` * this[i]. The resulting vector overwrites the entries of this. |
void |
Set(Int32 index, Double value) |
Setter that will work as expected for general dense vectors. For sparse vectors it will throw a MGroup.LinearAlgebra.Exceptions.SparsityPatternModifiedException, if a structural zero entry is written to. |
It supports common operations that do not mutate the underlying vector. If you need to store a vector and then pass it around or allow acceess to it, consider using this interface instead of MGroup.LinearAlgebra.Vectors.Vector for extra safety. Authors: Serafeim Bakalakos
public interface MGroup.LinearAlgebra.Vectors.IVectorView
: IIndexable1D, IReducibleMethods
| Type | Name | Summary |
|---|---|---|
IVector |
Axpy(IVectorView otherVector, Double otherCoefficient) |
Performs the following operation for all i: result[i] = *[i] + this[i]. Optimized version of MGroup.LinearAlgebra.Vectors.IVectorView.DoEntrywise(MGroup.LinearAlgebra.Vectors.IVectorView,System.Func{System.Double,System.Double,System.Double}) and MGroup.LinearAlgebra.Vectors.IVectorView.LinearCombination(System.Double,MGroup.LinearAlgebra.Vectors.IVectorView,System.Double). Named after BLAS axpy (y = a*x plus y). The resulting vector is written in a new object and then returned. |
IVector |
Copy(Boolean copyIndexingData = False) |
Copies this MGroup.LinearAlgebra.Vectors.IVectorView object. A new vector of the same type as this object is initialized and returned. |
Double[] |
CopyToArray() | Returns an array with the entries of the vector. This is a deep copy operation. For vectors that do not explicitly store zeros, the copy may be much larger than the original vector. |
IVector |
CreateZeroVectorWithSameFormat() | Initializes a new instance of the same type as this vector, with the exact same storage format and zero entries. |
IVector |
DoEntrywise(IVectorView vector, Func<Double, Double, Double> binaryOperation) |
Performs a binary operation on each pair of entries: result[i] = (this[i], [i]). The resulting vector is written in a new object and then returned. |
IVector |
DoToAllEntries(Func<Double, Double> unaryOperation) |
Performs a unary operation on each entry: result[i] = ``(this[i]). The resulting vector is written in a new object and then returned. |
Double |
DotProduct(IVectorView vector) |
Calculates the dot (or inner/scalar) product of this vector with : result = sum over all i of this[i] * [i]). |
IVector |
LinearCombination(Double thisCoefficient, IVectorView otherVector, Double otherCoefficient) |
Performs the following operation for all i: result[i] = * this[i] + * ``[i]. Optimized version of . The resulting vector is written in a new object and then returned. |
Double |
Norm2() | Calculates the Euclidian norm or 2-norm of this vector. For more see https://en.wikipedia.org/wiki/Norm_(mathematics)#Euclidean_norm. |
IVector |
Scale(Double scalar) |
Performs the following operation for all i: result[i] = `` * this[i]. The resulting vector is written in a new object and then returned. |
A vector that only stores non-zero entries. Some zero entries can also be stored but they are non-structural zeros and thus handled as non-zero entries. Authors: Serafeim Bakalakos
public class MGroup.LinearAlgebra.Vectors.SparseVector
: IVector, IVectorView, IIndexable1D, IReducibleProperties
| Type | Name | Summary |
|---|---|---|
Double |
Item | See MGroup.LinearAlgebra.Vectors.IIndexable1D.Item(System.Int32)
|
Int32 |
Length | See MGroup.LinearAlgebra.Vectors.IIndexable1D.Length. |
Int32[] |
RawIndices | The internal array that stores the indices of the non-zero entries of the vector. Its length is equal to the number of non-zero entries. It should only be used for passing the raw array to linear algebra libraries. |
Double[] |
RawValues | The internal array that stores the values of the non-zero entries of the vector. Its length is equal to the number of non-zero entries. It should only be used for passing the raw array to linear algebra libraries. |
Methods
| Type | Name | Summary |
|---|---|---|
void |
AddNonContiguouslyFrom(Int32[] thisIndices, IVectorView otherVector, Int32[] otherIndices) |
See MGroup.LinearAlgebra.Vectors.IVector.AddNonContiguouslyFrom(System.Int32[],MGroup.LinearAlgebra.Vectors.IVectorView,System.Int32[])
|
void |
AddNonContiguouslyFrom(Int32[] thisIndices, IVectorView otherVector) |
See MGroup.LinearAlgebra.Vectors.IVector.AddNonContiguouslyFrom(System.Int32[],MGroup.LinearAlgebra.Vectors.IVectorView,System.Int32[])
|
IVector |
Axpy(IVectorView otherVector, Double otherCoefficient) |
See MGroup.LinearAlgebra.Vectors.IVectorView.Axpy(MGroup.LinearAlgebra.Vectors.IVectorView,System.Double). |
void |
AxpyIntoThis(IVectorView otherVector, Double otherCoefficient) |
See MGroup.LinearAlgebra.Vectors.IVector.AxpyIntoThis(MGroup.LinearAlgebra.Vectors.IVectorView,System.Double). |
void |
AxpyIntoThis(SparseVector otherVector, Double otherCoefficient) |
See MGroup.LinearAlgebra.Vectors.IVector.AxpyIntoThis(MGroup.LinearAlgebra.Vectors.IVectorView,System.Double). |
void |
AxpySubvectorIntoThis(Int32 destinationIndex, IVectorView sourceVector, Double sourceCoefficient, Int32 sourceIndex, Int32 length) |
See MGroup.LinearAlgebra.Vectors.IVector.AxpySubvectorIntoThis(System.Int32,MGroup.LinearAlgebra.Vectors.IVectorView,System.Double,System.Int32,System.Int32). |
void |
Clear() | See MGroup.LinearAlgebra.Vectors.IVector.Clear. |
IVector |
Copy(Boolean copyIndexingData) |
See . |
SparseVector |
Copy() | See . |
void |
CopyFrom(IVectorView sourceVector) |
See MGroup.LinearAlgebra.Vectors.IVector.CopyFrom(MGroup.LinearAlgebra.Vectors.IVectorView)
|
void |
CopyNonContiguouslyFrom(Int32[] thisIndices, IVectorView otherVector, Int32[] otherIndices) |
See MGroup.LinearAlgebra.Vectors.IVector.CopyNonContiguouslyFrom(System.Int32[],MGroup.LinearAlgebra.Vectors.IVectorView,System.Int32[])
|
void |
CopyNonContiguouslyFrom(IVectorView otherVector, Int32[] otherIndices) |
See MGroup.LinearAlgebra.Vectors.IVector.CopyNonContiguouslyFrom(System.Int32[],MGroup.LinearAlgebra.Vectors.IVectorView,System.Int32[])
|
void |
CopySubvectorFrom(Int32 destinationIndex, IVectorView sourceVector, Int32 sourceIndex, Int32 length) |
See MGroup.LinearAlgebra.Vectors.IVector.CopySubvectorFrom(System.Int32,MGroup.LinearAlgebra.Vectors.IVectorView,System.Int32,System.Int32)
|
Double[] |
CopyToArray() | See MGroup.LinearAlgebra.Vectors.IVectorView.CopyToArray. |
Vector |
CopyToFullVector() | Initializes a new instance of MGroup.LinearAlgebra.Vectors.Vector that contains the same non-zero entries as this MGroup.LinearAlgebra.Vectors.SparseVector, while the rest entries are explicitly 0. |
Int32 |
CountNonZeros() | Counts how many non zero entries are stored in the vector. This includes zeros that are explicitly stored. |
IVector |
CreateZeroVectorWithSameFormat() | See MGroup.LinearAlgebra.Vectors.IVectorView.CreateZeroVectorWithSameFormat
|
IVector |
DoEntrywise(IVectorView otherVector, Func<Double, Double, Double> binaryOperation) |
See MGroup.LinearAlgebra.Vectors.IVectorView.DoEntrywise(MGroup.LinearAlgebra.Vectors.IVectorView,System.Func{System.Double,System.Double,System.Double}). |
void |
DoEntrywiseIntoThis(IVectorView otherVector, Func<Double, Double, Double> binaryOperation) |
See . |
IVector |
DoToAllEntries(Func<Double, Double> unaryOperation) |
See MGroup.LinearAlgebra.Vectors.IVectorView.DoToAllEntries(System.Func{System.Double,System.Double}). |
void |
DoToAllEntriesIntoThis(Func<Double, Double> unaryOperation) |
See MGroup.LinearAlgebra.Vectors.IVector.DoToAllEntriesIntoThis(System.Func{System.Double,System.Double}). |
Double |
DotProduct(IVectorView vector) |
See MGroup.LinearAlgebra.Vectors.IVectorView.DotProduct(MGroup.LinearAlgebra.Vectors.IVectorView). |
IEnumerable<ValueTuple<Int32, Double>> |
EnumerateNonZeros() | Iterates over the non zero entries of the vector. This includes zeros that are explicitly stored. |
Boolean |
Equals(IIndexable1D other, Double tolerance = 1E-13) |
See MGroup.LinearAlgebra.Vectors.IIndexable1D.Equals(MGroup.LinearAlgebra.Vectors.IIndexable1D,System.Double). |
IVector |
LinearCombination(Double thisCoefficient, IVectorView otherVector, Double otherCoefficient) |
See MGroup.LinearAlgebra.Vectors.IVectorView.LinearCombination(System.Double,MGroup.LinearAlgebra.Vectors.IVectorView,System.Double). |
void |
LinearCombinationIntoThis(Double thisCoefficient, IVectorView otherVector, Double otherCoefficient) |
See MGroup.LinearAlgebra.Vectors.IVector.LinearCombinationIntoThis(System.Double,MGroup.LinearAlgebra.Vectors.IVectorView,System.Double)
|
Double |
Norm2() | See MGroup.LinearAlgebra.Vectors.IVectorView.Norm2
|
Double |
Reduce(Double identityValue, ProcessEntry processEntry, ProcessZeros processZeros, Finalize finalize) |
See MGroup.LinearAlgebra.Reduction.IReducible.Reduce(System.Double,MGroup.LinearAlgebra.Reduction.ProcessEntry,MGroup.LinearAlgebra.Reduction.ProcessZeros,MGroup.LinearAlgebra.Reduction.Finalize). |
SparseVector |
Scale(Double scalar) |
Performs the following operation for 0 <= i < this.MGroup.LinearAlgebra.Vectors.SparseVector.Length: result[i] = `` * this[i]. The resulting vector is written to a new MGroup.LinearAlgebra.Vectors.SparseVector and then returned. |
void |
ScaleIntoThis(Double scalar) |
|
void |
Set(Int32 index, Double value) |
See MGroup.LinearAlgebra.Vectors.IVector.Set(System.Int32,System.Double)
|
Static Methods
| Type | Name | Summary |
|---|---|---|
SparseVector |
CreateFromArrays(Int32 length, Double[] values, Int32[] indices, Boolean checkInput, Boolean sortInput) |
Creates a new instance of MGroup.LinearAlgebra.Vectors.SparseVector with the provided arrays as its internal data. |
SparseVector |
CreateFromDense(Double[] denseArray) |
Creates a new instance of MGroup.LinearAlgebra.Vectors.SparseVector with the entries of . Only the entries that satisfy: [i] != 0 are explicitly stored in the new MGroup.LinearAlgebra.Vectors.SparseVector. |
SparseVector |
CreateFromDense(Double[] denseArray, Double tolerance) |
Creates a new instance of MGroup.LinearAlgebra.Vectors.SparseVector with the entries of . Only the entries that satisfy: [i] != 0 are explicitly stored in the new MGroup.LinearAlgebra.Vectors.SparseVector. |
SparseVector |
CreateFromDense(Vector denseVector) |
Creates a new instance of MGroup.LinearAlgebra.Vectors.SparseVector with the entries of . Only the entries that satisfy: [i] != 0 are explicitly stored in the new MGroup.LinearAlgebra.Vectors.SparseVector. |
SparseVector |
CreateFromDense(Vector denseVector, Double tolerance) |
Creates a new instance of MGroup.LinearAlgebra.Vectors.SparseVector with the entries of . Only the entries that satisfy: [i] != 0 are explicitly stored in the new MGroup.LinearAlgebra.Vectors.SparseVector. |
SparseVector |
CreateFromDictionary(Int32 length, Dictionary<Int32, Double> nonZeroEntries) |
Creates a new instance of MGroup.LinearAlgebra.Vectors.SparseVector that has the provided and explicitly stores only the entries in. All other entries are considered as 0. First `` will be sorted. |
SparseVector |
CreateFromDictionary(Int32 length, SortedDictionary<Int32, Double> nonZeroEntries) |
Creates a new instance of MGroup.LinearAlgebra.Vectors.SparseVector that has the provided and explicitly stores only the entries in. All other entries are considered as 0. First `` will be sorted. |
General purpose vector class with more functionality than other vectors. No sparsity is assumed. Authors: Serafeim Bakalakos
public class MGroup.LinearAlgebra.Vectors.Vector
: IVector, IVectorView, IIndexable1D, IReducible, ISliceable1DProperties
| Type | Name | Summary |
|---|---|---|
Double |
Item | See MGroup.LinearAlgebra.Vectors.IIndexable1D.Item(System.Int32). |
Int32 |
Length | See MGroup.LinearAlgebra.Vectors.IIndexable1D.Length. |
Double[] |
RawData | The internal array that stores the entries of the vector. It should only be used for passing the raw array to linear algebra libraries. |
Methods
| Type | Name | Summary |
|---|---|---|
void |
AddNonContiguouslyFrom(Int32[] thisIndices, IVectorView otherVector, Int32[] otherIndices) |
See MGroup.LinearAlgebra.Vectors.IVector.AddNonContiguouslyFrom(System.Int32[],MGroup.LinearAlgebra.Vectors.IVectorView,System.Int32[])
|
void |
AddNonContiguouslyFrom(Int32[] thisIndices, IVectorView otherVector) |
See MGroup.LinearAlgebra.Vectors.IVector.AddNonContiguouslyFrom(System.Int32[],MGroup.LinearAlgebra.Vectors.IVectorView,System.Int32[])
|
void |
AddSubvector(Vector subvector, Int32 destinationIndex) |
Performs the operation: this[ + i] = this[ + i] + [i], for 0 <= i < .MGroup.LinearAlgebra.Vectors.Vector.Length. |
Vector |
Append(Vector last) |
Creates a new MGroup.LinearAlgebra.Vectors.Vector that contains all entries of this followed by all entries of ``. |
IVector |
Axpy(IVectorView otherVector, Double otherCoefficient) |
See MGroup.LinearAlgebra.Vectors.IVectorView.Axpy(MGroup.LinearAlgebra.Vectors.IVectorView,System.Double). |
Vector |
Axpy(Vector otherVector, Double otherCoefficient) |
See MGroup.LinearAlgebra.Vectors.IVectorView.Axpy(MGroup.LinearAlgebra.Vectors.IVectorView,System.Double). |
void |
AxpyIntoThis(IVectorView otherVector, Double otherCoefficient) |
See MGroup.LinearAlgebra.Vectors.IVector.AxpyIntoThis(MGroup.LinearAlgebra.Vectors.IVectorView,System.Double). |
void |
AxpyIntoThis(Vector otherVector, Double otherCoefficient) |
See MGroup.LinearAlgebra.Vectors.IVector.AxpyIntoThis(MGroup.LinearAlgebra.Vectors.IVectorView,System.Double). |
void |
AxpySubvectorIntoThis(Int32 destinationIndex, IVectorView sourceVector, Double sourceCoefficient, Int32 sourceIndex, Int32 length) |
See MGroup.LinearAlgebra.Vectors.IVector.CopySubvectorFrom(System.Int32,MGroup.LinearAlgebra.Vectors.IVectorView,System.Int32,System.Int32). |
void |
Clear() | See MGroup.LinearAlgebra.Vectors.IVector.Clear. |
IVector |
Copy(Boolean copyIndexingData) |
See . |
Vector |
Copy() | See . |
void |
CopyFrom(IVectorView sourceVector) |
See MGroup.LinearAlgebra.Vectors.IVector.CopyFrom(MGroup.LinearAlgebra.Vectors.IVectorView)
|
void |
CopyFrom(Vector sourceVector) |
See MGroup.LinearAlgebra.Vectors.IVector.CopyFrom(MGroup.LinearAlgebra.Vectors.IVectorView)
|
void |
CopyNonContiguouslyFrom(Int32[] thisIndices, IVectorView otherVector, Int32[] otherIndices) |
See MGroup.LinearAlgebra.Vectors.IVector.CopyNonContiguouslyFrom(System.Int32[],MGroup.LinearAlgebra.Vectors.IVectorView,System.Int32[])
|
void |
CopyNonContiguouslyFrom(IVectorView otherVector, Int32[] otherIndices) |
See MGroup.LinearAlgebra.Vectors.IVector.CopyNonContiguouslyFrom(System.Int32[],MGroup.LinearAlgebra.Vectors.IVectorView,System.Int32[])
|
void |
CopySubvectorFrom(Int32 destinationIndex, IVectorView sourceVector, Int32 sourceIndex, Int32 length) |
See MGroup.LinearAlgebra.Vectors.IVector.CopySubvectorFrom(System.Int32,MGroup.LinearAlgebra.Vectors.IVectorView,System.Int32,System.Int32)
|
Double[] |
CopyToArray() | See MGroup.LinearAlgebra.Vectors.IVectorView.CopyToArray. |
void |
CopyToArray(Int32 sourceIndex, Double[] destinationArray, Int32 destinationIndex, Int32 length) |
See MGroup.LinearAlgebra.Vectors.IVectorView.CopyToArray. |
IVector |
CreateZeroVectorWithSameFormat() | See MGroup.LinearAlgebra.Vectors.IVectorView.CreateZeroVectorWithSameFormat
|
IVector |
DoEntrywise(IVectorView vector, Func<Double, Double, Double> binaryOperation) |
See MGroup.LinearAlgebra.Vectors.IVectorView.DoEntrywise(MGroup.LinearAlgebra.Vectors.IVectorView,System.Func{System.Double,System.Double,System.Double}). |
Vector |
DoEntrywise(Vector vector, Func<Double, Double, Double> binaryOperation) |
See MGroup.LinearAlgebra.Vectors.IVectorView.DoEntrywise(MGroup.LinearAlgebra.Vectors.IVectorView,System.Func{System.Double,System.Double,System.Double}). |
void |
DoEntrywiseIntoThis(IVectorView vector, Func<Double, Double, Double> binaryOperation) |
See MGroup.LinearAlgebra.Vectors.IVector.DoEntrywiseIntoThis(MGroup.LinearAlgebra.Vectors.IVectorView,System.Func{System.Double,System.Double,System.Double}). |
void |
DoEntrywiseIntoThis(Vector vector, Func<Double, Double, Double> binaryOperation) |
See MGroup.LinearAlgebra.Vectors.IVector.DoEntrywiseIntoThis(MGroup.LinearAlgebra.Vectors.IVectorView,System.Func{System.Double,System.Double,System.Double}). |
Vector |
DoToAllEntries(Func<Double, Double> unaryOperation) |
Performs a unary operation on each entry: result[i] = ``(this[i]), for 0 <= i < this.MGroup.LinearAlgebra.Vectors.Vector.Length. The resulting vector is written to a new `MGroup.LinearAlgebra.Vectors.Vector` and then returned. |
void |
DoToAllEntriesIntoThis(Func<Double, Double> unaryOperation) |
Performs a unary operation on each entry: this[i] = ``(this[i]), for 0 <= i < this.MGroup.LinearAlgebra.Vectors.Vector.Length. The resulting vector overwrites the entries of this `MGroup.LinearAlgebra.Vectors.Vector` instance. |
Double |
DotProduct(IVectorView vector) |
See MGroup.LinearAlgebra.Vectors.IVectorView.DotProduct(MGroup.LinearAlgebra.Vectors.IVectorView). |
Double |
DotProduct(Vector vector) |
See MGroup.LinearAlgebra.Vectors.IVectorView.DotProduct(MGroup.LinearAlgebra.Vectors.IVectorView). |
Boolean |
Equals(IIndexable1D other, Double tolerance = 1E-13) |
See MGroup.LinearAlgebra.Vectors.IIndexable1D.Equals(MGroup.LinearAlgebra.Vectors.IIndexable1D,System.Double). |
Vector |
GetSubvector(Int32[] indices) |
See MGroup.LinearAlgebra.Vectors.ISliceable1D.GetSubvector(System.Int32[]). |
Vector |
GetSubvector(Int32 startInclusive, Int32 endExclusive) |
See MGroup.LinearAlgebra.Vectors.ISliceable1D.GetSubvector(System.Int32[]). |
Boolean |
IsZero(Double tolerance) |
Returns true if this[i] <= `` for 0 <= i < this.MGroup.LinearAlgebra.Vectors.Vector.Length. Otherwise false is returned. |
IVector |
LinearCombination(Double thisCoefficient, IVectorView otherVector, Double otherCoefficient) |
See MGroup.LinearAlgebra.Vectors.IVectorView.LinearCombination(System.Double,MGroup.LinearAlgebra.Vectors.IVectorView,System.Double). |
Vector |
LinearCombination(Double thisCoefficient, Vector otherVector, Double otherCoefficient) |
See MGroup.LinearAlgebra.Vectors.IVectorView.LinearCombination(System.Double,MGroup.LinearAlgebra.Vectors.IVectorView,System.Double). |
void |
LinearCombinationIntoThis(Double thisCoefficient, IVectorView otherVector, Double otherCoefficient) |
See MGroup.LinearAlgebra.Vectors.IVector.LinearCombinationIntoThis(System.Double,MGroup.LinearAlgebra.Vectors.IVectorView,System.Double). |
void |
LinearCombinationIntoThis(Double thisCoefficient, Vector otherVector, Double otherCoefficient) |
See MGroup.LinearAlgebra.Vectors.IVector.LinearCombinationIntoThis(System.Double,MGroup.LinearAlgebra.Vectors.IVectorView,System.Double). |
Vector |
MultiplyEntrywise(Vector vector) |
Performs the following operation for 0 <= i < this.MGroup.LinearAlgebra.Vectors.Vector.Length: result[i] = this[i] * ``[i]. The resulting vector is written to a new MGroup.LinearAlgebra.Vectors.Vector and then returned. |
void |
MultiplyEntrywiseIntoThis(Vector vector) |
Performs the following operation for 0 <= i < this.MGroup.LinearAlgebra.Vectors.Vector.Length: this[i] = this[i] * ``[i]. The resulting vector overwrites the entries of this MGroup.LinearAlgebra.Vectors.Vector instance. |
Double |
Norm2() | See MGroup.LinearAlgebra.Vectors.IVectorView.Norm2
|
Double |
Reduce(Double identityValue, ProcessEntry processEntry, ProcessZeros processZeros, Finalize finalize) |
See MGroup.LinearAlgebra.Reduction.IReducible.Reduce(System.Double,MGroup.LinearAlgebra.Reduction.ProcessEntry,MGroup.LinearAlgebra.Reduction.ProcessZeros,MGroup.LinearAlgebra.Reduction.Finalize). |
Vector[] |
RemoveDuplicatesFindMultiplicity() | This method is used to remove duplicate values of a Knot Value Vector and return the multiplicity up to the requested Knot. The multiplicity of a single Knot can be derived using the exported multiplicity vector. The entries of this MGroup.LinearAlgebra.Vectors.Vector will be sorted. |
Vector |
Reorder(IReadOnlyList<Int32> permutation, Boolean oldToNew) |
Creates a new MGroup.LinearAlgebra.Vectors.Vector that contains the entries of this MGroup.LinearAlgebra.Vectors.Vector with a different order, which is specified by the provided and. |
Vector |
Scale(Double scalar) |
Performs the following operation for 0 <= i < this.MGroup.LinearAlgebra.Vectors.Vector.Length: result[i] = `` * this[i]. The resulting vector is written to a new MGroup.LinearAlgebra.Vectors.Vector and then returned. |
void |
ScaleIntoThis(Double scalar) |
See MGroup.LinearAlgebra.Vectors.IVector.ScaleIntoThis(System.Double). |
void |
Set(Int32 index, Double value) |
See MGroup.LinearAlgebra.Vectors.IVector.Set(System.Int32,System.Double). |
void |
SetAll(Double value) |
Sets all entries of this vector to be equal to ``. |
Matrix |
TensorProduct(Vector vector) |
Calculates the tensor product of this vector with ``: result[i, j] = this[i] * vector[j], for all valid i, j. |
Static Methods
| Type | Name | Summary |
|---|---|---|
Vector |
CreateFromArray(Double[] data, Boolean copyArray = False) |
Initializes a new instance of MGroup.LinearAlgebra.Vectors.Vector with `` or a clone as its internal array. |
Vector |
CreateFromVector(IVectorView original) |
Initializes a new instance of MGroup.LinearAlgebra.Vectors.Vector by copying the entries of an existing vector: ``. |
Vector |
CreateWithValue(Int32 length, Double value) |
Initializes a new instance of MGroup.LinearAlgebra.Vectors.Vector with all entries being equal to ``. |
Vector |
CreateZero(Int32 length) |
Initializes a new instance of MGroup.LinearAlgebra.Vectors.Vector with all entries being equal to 0. |
A vector with 2 entries. Optimized version of MGroup.LinearAlgebra.Vectors.Vector. Authors: Serafeim Bakalakos
public class MGroup.LinearAlgebra.Vectors.Vector2
: IVector, IVectorView, IIndexable1D, IReducibleProperties
| Type | Name | Summary |
|---|---|---|
Double[] |
InternalData | The internal array that stores the entries of the vector. It should only be used for passing the raw array to linear algebra libraries. |
Double |
Item | See MGroup.LinearAlgebra.Vectors.IIndexable1D.Item(System.Int32). |
Int32 |
Length | See MGroup.LinearAlgebra.Vectors.IIndexable1D.Length. |
Methods
| Type | Name | Summary |
|---|---|---|
void |
AddIntoThis(Vector2 vector) |
Performs the operation: this[i] = this[i] + ``[i], for 0 <= i < 2. The resulting vector overwrites the entries of this MGroup.LinearAlgebra.Vectors.Vector2 instance. |
void |
AddNonContiguouslyFrom(Int32[] thisIndices, IVectorView otherVector, Int32[] otherIndices) |
See MGroup.LinearAlgebra.Vectors.IVector.AddNonContiguouslyFrom(System.Int32[],MGroup.LinearAlgebra.Vectors.IVectorView,System.Int32[])
|
void |
AddNonContiguouslyFrom(Int32[] thisIndices, IVectorView otherVector) |
See MGroup.LinearAlgebra.Vectors.IVector.AddNonContiguouslyFrom(System.Int32[],MGroup.LinearAlgebra.Vectors.IVectorView,System.Int32[])
|
IVector |
Axpy(IVectorView otherVector, Double otherCoefficient) |
See MGroup.LinearAlgebra.Vectors.IVectorView.Axpy(MGroup.LinearAlgebra.Vectors.IVectorView,System.Double). |
Vector2 |
Axpy(Vector2 otherVector, Double otherCoefficient) |
See MGroup.LinearAlgebra.Vectors.IVectorView.Axpy(MGroup.LinearAlgebra.Vectors.IVectorView,System.Double). |
void |
AxpyIntoThis(IVectorView otherVector, Double otherCoefficient) |
See MGroup.LinearAlgebra.Vectors.IVector.AxpyIntoThis(MGroup.LinearAlgebra.Vectors.IVectorView,System.Double)
|
void |
AxpyIntoThis(Vector2 otherVector, Double otherCoefficient) |
See MGroup.LinearAlgebra.Vectors.IVector.AxpyIntoThis(MGroup.LinearAlgebra.Vectors.IVectorView,System.Double)
|
void |
AxpySubvectorIntoThis(Int32 destinationIndex, IVectorView sourceVector, Double sourceCoefficient, Int32 sourceIndex, Int32 length) |
See MGroup.LinearAlgebra.Vectors.IVector.AxpySubvectorIntoThis(System.Int32,MGroup.LinearAlgebra.Vectors.IVectorView,System.Double,System.Int32,System.Int32)
|
void |
Clear() | See MGroup.LinearAlgebra.Vectors.IVector.Clear. |
IVector |
Copy(Boolean copyIndexingData = False) |
See |
Vector2 |
Copy() | See |
void |
CopyFrom(IVectorView sourceVector) |
See MGroup.LinearAlgebra.Vectors.IVector.CopyFrom(MGroup.LinearAlgebra.Vectors.IVectorView)
|
void |
CopyNonContiguouslyFrom(IVectorView otherVector, Int32[] otherIndices) |
See MGroup.LinearAlgebra.Vectors.IVector.CopyNonContiguouslyFrom(MGroup.LinearAlgebra.Vectors.IVectorView,System.Int32[])
|
void |
CopyNonContiguouslyFrom(Int32[] thisIndices, IVectorView otherVector, Int32[] otherIndices) |
See MGroup.LinearAlgebra.Vectors.IVector.CopyNonContiguouslyFrom(MGroup.LinearAlgebra.Vectors.IVectorView,System.Int32[])
|
void |
CopySubvectorFrom(Int32 destinationIndex, IVectorView sourceVector, Int32 sourceIndex, Int32 length) |
See MGroup.LinearAlgebra.Vectors.IVector.CopySubvectorFrom(System.Int32,MGroup.LinearAlgebra.Vectors.IVectorView,System.Int32,System.Int32)
|
Double[] |
CopyToArray() | See MGroup.LinearAlgebra.Vectors.IVectorView.CopyToArray. |
IVector |
CreateZeroVectorWithSameFormat() | See MGroup.LinearAlgebra.Vectors.IVectorView.CreateZeroVectorWithSameFormat
|
Double |
CrossProduct(Vector2 vector) |
Performs the operation: result = this[0] * other[1] - this[1] * other[0]. The result is a scalar value. Also note that: other.Cross(this) = - this.Cross(other). |
IVector |
DoEntrywise(IVectorView vector, Func<Double, Double, Double> binaryOperation) |
See MGroup.LinearAlgebra.Vectors.IVectorView.DoEntrywise(MGroup.LinearAlgebra.Vectors.IVectorView,System.Func{System.Double,System.Double,System.Double}). |
Vector2 |
DoEntrywise(Vector2 vector, Func<Double, Double, Double> binaryOperation) |
See MGroup.LinearAlgebra.Vectors.IVectorView.DoEntrywise(MGroup.LinearAlgebra.Vectors.IVectorView,System.Func{System.Double,System.Double,System.Double}). |
void |
DoEntrywiseIntoThis(IVectorView otherVector, Func<Double, Double, Double> binaryOperation) |
See MGroup.LinearAlgebra.Vectors.IVector.DoEntrywiseIntoThis(MGroup.LinearAlgebra.Vectors.IVectorView,System.Func{System.Double,System.Double,System.Double})
|
void |
DoEntrywiseIntoThis(Vector2 vector, Func<Double, Double, Double> binaryOperation) |
See MGroup.LinearAlgebra.Vectors.IVector.DoEntrywiseIntoThis(MGroup.LinearAlgebra.Vectors.IVectorView,System.Func{System.Double,System.Double,System.Double})
|
Vector2 |
DoToAllEntries(Func<Double, Double> unaryOperation) |
Performs a unary operation on each entry: result[i] = ``(this[i]), for 0 <= i < 2. The resulting vector is written to a new MGroup.LinearAlgebra.Vectors.Vector2 and then returned. |
void |
DoToAllEntriesIntoThis(Func<Double, Double> unaryOperation) |
See MGroup.LinearAlgebra.Vectors.IVector.DoToAllEntriesIntoThis(System.Func{System.Double,System.Double})
|
Double |
DotProduct(IVectorView vector) |
See MGroup.LinearAlgebra.Vectors.IVectorView.DotProduct(MGroup.LinearAlgebra.Vectors.IVectorView). |
Double |
DotProduct(Vector2 vector) |
See MGroup.LinearAlgebra.Vectors.IVectorView.DotProduct(MGroup.LinearAlgebra.Vectors.IVectorView). |
Boolean |
Equals(Vector2 other, Double tolerance = 1E-13) |
Returns true if this[i] - [i] is within the acceptable for all 0 <= i < 2. |
IVector |
LinearCombination(Double thisCoefficient, IVectorView otherVector, Double otherCoefficient) |
See MGroup.LinearAlgebra.Vectors.IVectorView.LinearCombination(System.Double,MGroup.LinearAlgebra.Vectors.IVectorView,System.Double). |
Vector2 |
LinearCombination(Double thisCoefficient, Vector2 otherVector, Double otherCoefficient) |
See MGroup.LinearAlgebra.Vectors.IVectorView.LinearCombination(System.Double,MGroup.LinearAlgebra.Vectors.IVectorView,System.Double). |
void |
LinearCombinationIntoThis(Double thisCoefficient, IVectorView otherVector, Double otherCoefficient) |
See MGroup.LinearAlgebra.Vectors.IVector.LinearCombinationIntoThis(System.Double,MGroup.LinearAlgebra.Vectors.IVectorView,System.Double)
|
void |
LinearCombinationIntoThis(Double thisCoefficient, Vector2 otherVector, Double otherCoefficient) |
See MGroup.LinearAlgebra.Vectors.IVector.LinearCombinationIntoThis(System.Double,MGroup.LinearAlgebra.Vectors.IVectorView,System.Double)
|
Double |
Norm2() | See MGroup.LinearAlgebra.Vectors.IVectorView.Norm2
|
Double |
Reduce(Double identityValue, ProcessEntry processEntry, ProcessZeros processZeros, Finalize finalize) |
See MGroup.LinearAlgebra.Reduction.IReducible.Reduce(System.Double,MGroup.LinearAlgebra.Reduction.ProcessEntry,MGroup.LinearAlgebra.Reduction.ProcessZeros,MGroup.LinearAlgebra.Reduction.Finalize). |
Vector2 |
Scale(Double scalar) |
Performs the operation: result[i] = `` * this[i], for 0 <= i < 2. The resulting vector is written to a new MGroup.LinearAlgebra.Vectors.Vector2 and then returned. |
void |
ScaleIntoThis(Double scalar) |
Performs the operation: this[i] = `` * this[i], for 0 <= i < 2. The resulting vector overwrites the entries of this MGroup.LinearAlgebra.Vectors.Vector2 instance. |
void |
Set(Int32 index, Double value) |
See MGroup.LinearAlgebra.Vectors.IVector.Set(System.Int32,System.Double)
|
void |
SetAll(Double value) |
Sets all entries of this vector to be equal to ``. |
void |
SubtractIntoThis(Vector2 vector) |
Performs the operation: this[i] = this[i] - ``[i], for 0 <= i < 2. The resulting vector overwrites the entries of this MGroup.LinearAlgebra.Vectors.Vector2 instance. |
Static Methods
| Type | Name | Summary |
|---|---|---|
Vector2 |
Create(Double entry0, Double entry1) |
Initializes a new instance of MGroup.LinearAlgebra.Vectors.Vector2 that contains the provided entries: {, }. |
Vector2 |
CreateFromArray(Double[] data, Boolean copyArray = False) |
Initializes a new instance of MGroup.LinearAlgebra.Vectors.Vector2 with `` or a clone as its internal array. |
Vector2 |
CreateZero() | Creates an new instance of MGroup.LinearAlgebra.Vectors.Vector2 with all entries being equal to 0. |
A vector with 3 entries. Optimized version of MGroup.LinearAlgebra.Vectors.Vector. Authors: Serafeim Bakalakos
public class MGroup.LinearAlgebra.Vectors.Vector3
: IVector, IVectorView, IIndexable1D, IReducibleProperties
| Type | Name | Summary |
|---|---|---|
Double[] |
InternalData | The internal array that stores the entries of the vector. It should only be used for passing the raw array to linear algebra libraries. |
Double |
Item | See MGroup.LinearAlgebra.Vectors.IIndexable1D.Item(System.Int32). |
Int32 |
Length | See MGroup.LinearAlgebra.Vectors.IIndexable1D.Length. |
Methods
| Type | Name | Summary |
|---|---|---|
void |
AddIntoThis(Vector3 vector) |
Performs the operation: this[i] = this[i] + ``[i], for 0 <= i < 3. The resulting vector overwrites the entries of this MGroup.LinearAlgebra.Vectors.Vector3 instance. |
void |
AddNonContiguouslyFrom(Int32[] thisIndices, IVectorView otherVector, Int32[] otherIndices) |
See MGroup.LinearAlgebra.Vectors.IVector.AddNonContiguouslyFrom(System.Int32[],MGroup.LinearAlgebra.Vectors.IVectorView,System.Int32[])
|
void |
AddNonContiguouslyFrom(Int32[] thisIndices, IVectorView otherVector) |
See MGroup.LinearAlgebra.Vectors.IVector.AddNonContiguouslyFrom(System.Int32[],MGroup.LinearAlgebra.Vectors.IVectorView,System.Int32[])
|
IVector |
Axpy(IVectorView otherVector, Double otherCoefficient) |
See MGroup.LinearAlgebra.Vectors.IVectorView.Axpy(MGroup.LinearAlgebra.Vectors.IVectorView,System.Double). |
Vector3 |
Axpy(Vector3 otherVector, Double otherCoefficient) |
See MGroup.LinearAlgebra.Vectors.IVectorView.Axpy(MGroup.LinearAlgebra.Vectors.IVectorView,System.Double). |
void |
AxpyIntoThis(IVectorView otherVector, Double otherCoefficient) |
See MGroup.LinearAlgebra.Vectors.IVector.AxpyIntoThis(MGroup.LinearAlgebra.Vectors.IVectorView,System.Double)
|
void |
AxpyIntoThis(Vector3 otherVector, Double otherCoefficient) |
See MGroup.LinearAlgebra.Vectors.IVector.AxpyIntoThis(MGroup.LinearAlgebra.Vectors.IVectorView,System.Double)
|
void |
AxpySubvectorIntoThis(Int32 destinationIndex, IVectorView sourceVector, Double sourceCoefficient, Int32 sourceIndex, Int32 length) |
See MGroup.LinearAlgebra.Vectors.IVector.AxpySubvectorIntoThis(System.Int32,MGroup.LinearAlgebra.Vectors.IVectorView,System.Double,System.Int32,System.Int32)
|
void |
Clear() | See MGroup.LinearAlgebra.Vectors.IVector.Clear. |
IVector |
Copy(Boolean copyIndexingData = False) |
See |
Vector3 |
Copy() | See |
void |
CopyFrom(IVectorView sourceVector) |
See MGroup.LinearAlgebra.Vectors.IVector.CopyFrom(MGroup.LinearAlgebra.Vectors.IVectorView)
|
void |
CopyNonContiguouslyFrom(Int32[] thisIndices, IVectorView otherVector, Int32[] otherIndices) |
See MGroup.LinearAlgebra.Vectors.IVector.CopyNonContiguouslyFrom(System.Int32[],MGroup.LinearAlgebra.Vectors.IVectorView,System.Int32[])
|
void |
CopyNonContiguouslyFrom(IVectorView otherVector, Int32[] otherIndices) |
See MGroup.LinearAlgebra.Vectors.IVector.CopyNonContiguouslyFrom(System.Int32[],MGroup.LinearAlgebra.Vectors.IVectorView,System.Int32[])
|
void |
CopySubvectorFrom(Int32 destinationIndex, IVectorView sourceVector, Int32 sourceIndex, Int32 length) |
See MGroup.LinearAlgebra.Vectors.IVector.CopySubvectorFrom(System.Int32,MGroup.LinearAlgebra.Vectors.IVectorView,System.Int32,System.Int32)
|
Double[] |
CopyToArray() | See MGroup.LinearAlgebra.Vectors.IVectorView.CopyToArray. |
IVector |
CreateZeroVectorWithSameFormat() | See MGroup.LinearAlgebra.Vectors.IVectorView.CreateZeroVectorWithSameFormat
|
Vector3 |
CrossProduct(Vector3 vector) |
Performs the operation: result = { a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0]}. The result is a vector. Also note that: other.Cross(this) = - this.Cross(other). |
IVector |
DoEntrywise(IVectorView vector, Func<Double, Double, Double> binaryOperation) |
See MGroup.LinearAlgebra.Vectors.IVectorView.DoEntrywise(MGroup.LinearAlgebra.Vectors.IVectorView,System.Func{System.Double,System.Double,System.Double}). |
Vector3 |
DoEntrywise(Vector3 vector, Func<Double, Double, Double> binaryOperation) |
See MGroup.LinearAlgebra.Vectors.IVectorView.DoEntrywise(MGroup.LinearAlgebra.Vectors.IVectorView,System.Func{System.Double,System.Double,System.Double}). |
void |
DoEntrywiseIntoThis(IVectorView otherVector, Func<Double, Double, Double> binaryOperation) |
See MGroup.LinearAlgebra.Vectors.IVector.DoEntrywiseIntoThis(MGroup.LinearAlgebra.Vectors.IVectorView,System.Func{System.Double,System.Double,System.Double})
|
void |
DoEntrywiseIntoThis(Vector3 vector, Func<Double, Double, Double> binaryOperation) |
See MGroup.LinearAlgebra.Vectors.IVector.DoEntrywiseIntoThis(MGroup.LinearAlgebra.Vectors.IVectorView,System.Func{System.Double,System.Double,System.Double})
|
Vector3 |
DoToAllEntries(Func<Double, Double> unaryOperation) |
Performs a unary operation on each entry: result[i] = ``(this[i]), for 0 <= i < 3. The resulting vector is written to a new MGroup.LinearAlgebra.Vectors.Vector3 and then returned. |
void |
DoToAllEntriesIntoThis(Func<Double, Double> unaryOperation) |
Performs a unary operation on each entry: result[i] = ``(this[i]), for 0 <= i < 3. The resulting vector overwrites the entries of this MGroup.LinearAlgebra.Vectors.Vector3 instance. |
Double |
DotProduct(IVectorView vector) |
See MGroup.LinearAlgebra.Vectors.IVectorView.DotProduct(MGroup.LinearAlgebra.Vectors.IVectorView). |
Double |
DotProduct(Vector3 vector) |
See MGroup.LinearAlgebra.Vectors.IVectorView.DotProduct(MGroup.LinearAlgebra.Vectors.IVectorView). |
Boolean |
Equals(Vector3 other, Double tolerance = 1E-13) |
Returns true if this[i] - [i] is within the acceptable for all 0 <= i < 3. |
IVector |
LinearCombination(Double thisCoefficient, IVectorView otherVector, Double otherCoefficient) |
See MGroup.LinearAlgebra.Vectors.IVectorView.LinearCombination(System.Double,MGroup.LinearAlgebra.Vectors.IVectorView,System.Double). |
Vector3 |
LinearCombination(Double thisCoefficient, Vector3 otherVector, Double otherCoefficient) |
See MGroup.LinearAlgebra.Vectors.IVectorView.LinearCombination(System.Double,MGroup.LinearAlgebra.Vectors.IVectorView,System.Double). |
void |
LinearCombinationIntoThis(Double thisCoefficient, IVectorView otherVector, Double otherCoefficient) |
See MGroup.LinearAlgebra.Vectors.IVector.LinearCombinationIntoThis(System.Double,MGroup.LinearAlgebra.Vectors.IVectorView,System.Double)
|
void |
LinearCombinationIntoThis(Double thisCoefficient, Vector3 otherVector, Double otherCoefficient) |
See MGroup.LinearAlgebra.Vectors.IVector.LinearCombinationIntoThis(System.Double,MGroup.LinearAlgebra.Vectors.IVectorView,System.Double)
|
Double |
Norm2() | See MGroup.LinearAlgebra.Vectors.IVectorView.Norm2
|
Double |
Reduce(Double identityValue, ProcessEntry processEntry, ProcessZeros processZeros, Finalize finalize) |
See MGroup.LinearAlgebra.Reduction.IReducible.Reduce(System.Double,MGroup.LinearAlgebra.Reduction.ProcessEntry,MGroup.LinearAlgebra.Reduction.ProcessZeros,MGroup.LinearAlgebra.Reduction.Finalize). |
Vector3 |
Scale(Double scalar) |
Performs the operation: result[i] = `` * this[i], for 0 <= i < 23. The resulting vector is written to a new MGroup.LinearAlgebra.Vectors.Vector3 and then returned. |
void |
ScaleIntoThis(Double scalar) |
Performs the operation: this[i] = `` * this[i], for 0 <= i < 3. The resulting vector overwrites the entries of this MGroup.LinearAlgebra.Vectors.Vector3 instance. |
void |
Set(Int32 index, Double value) |
See MGroup.LinearAlgebra.Vectors.IVector.Set(System.Int32,System.Double)
|
void |
SetAll(Double value) |
Sets all entries of this vector to be equal to ``. |
void |
SubtractIntoThis(Vector3 vector) |
Performs the operation: this[i] = this[i] - ``[i], for 0 <= i < 3. The resulting vector overwrites the entries of this MGroup.LinearAlgebra.Vectors.Vector3 instance. |
Static Methods
| Type | Name | Summary |
|---|---|---|
Vector3 |
Create(Double entry0, Double entry1, Double entry2) |
Initializes a new instance of MGroup.LinearAlgebra.Vectors.Vector3 that contains the provided entries: {, , ``}. |
Vector3 |
CreateFromArray(Double[] data, Boolean copyArray = False) |
Initializes a new instance of MGroup.LinearAlgebra.Vectors.Vector3 with `` or a clone as its internal array. |
Vector3 |
CreateZero() | Creates an new instance of MGroup.LinearAlgebra.Vectors.Vector3 with all entries being equal to 0. |
Defines common vector operation shortcuts that can be used as extensions for MGroup.LinearAlgebra.Vectors.Vector. Authors: Serafeim Bakalakos
public static class MGroup.LinearAlgebra.Vectors.VectorExtensionsStatic Methods
| Type | Name | Summary |
|---|---|---|
IVector |
Add(this IVectorView thisVector, IVectorView otherVector) |
Performs the operation: result[i] = [i] + [i], for 0 <= i < .`MGroup.LinearAlgebra.Vectors.IIndexable1D.Length` = .MGroup.LinearAlgebra.Vectors.IIndexable1D.Length. The resulting vector is written in a new object and then returned. |
void |
AddIntoThis(this IVector thisVector, IVectorView otherVector) |
Performs the operation: [i] = [i] + [i], for 0 <= i < .MGroup.LinearAlgebra.Vectors.IIndexable1D.Length = ``.MGroup.LinearAlgebra.Vectors.IIndexable1D.Length. The resulting vector overwrites the entries of this `MGroup.LinearAlgebra.Vectors.IVector` instance. |
void |
AddIntoThis(this Vector thisVector, Vector otherVector) |
Performs the operation: [i] = [i] + [i], for 0 <= i < .MGroup.LinearAlgebra.Vectors.IIndexable1D.Length = ``.MGroup.LinearAlgebra.Vectors.IIndexable1D.Length. The resulting vector overwrites the entries of this `MGroup.LinearAlgebra.Vectors.IVector` instance. |
void |
AddSubvectorIntoThis(this IVector destinationVector, Int32 destinationIndex, IVectorView sourceVector, Int32 sourceIndex, Int32 length) |
Performs the following operation for consecutive entries starting from the provided indices: this[i] = this[i] +[i]. |
Vector |
CrossProduct(this Vector thisVector, Vector otherVector) |
Performs the operation: a x b = { a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0]}, where a = , b = and both have exactly 3 entries.. The result is a vector. Also note that: other.Cross(this) = - this.Cross(other). |
IVector |
Subtract(this IVectorView thisVector, IVectorView otherVector) |
Performs the operation: result[i] = [i] - [i], for 0 <= i < .`MGroup.LinearAlgebra.Vectors.IIndexable1D.Length` = .MGroup.LinearAlgebra.Vectors.IIndexable1D.Length. The resulting vector is written in a new object and then returned. |
void |
SubtractIntoThis(this IVector thisVector, IVectorView otherVector) |
Performs the operation: [i] = [i] - [i], for 0 <= i < .MGroup.LinearAlgebra.Vectors.IIndexable1D.Length = ``.MGroup.LinearAlgebra.Vectors.IIndexable1D.Length. The resulting vector overwrites the entries of this `MGroup.LinearAlgebra.Vectors.IVector` instance. |
void |
SubtractIntoThis(this Vector thisVector, Vector otherVector) |
Performs the operation: [i] = [i] - [i], for 0 <= i < .MGroup.LinearAlgebra.Vectors.IIndexable1D.Length = ``.MGroup.LinearAlgebra.Vectors.IIndexable1D.Length. The resulting vector overwrites the entries of this `MGroup.LinearAlgebra.Vectors.IVector` instance. |
void |
SubtractSubvectorIntoThis(this IVector destinationVector, Int32 destinationIndex, IVectorView sourceVector, Int32 sourceIndex, Int32 length) |
Performs the following operation for consecutive entries starting from the provided indices: this[i] = this[i] -[i]. |