Click or drag to resize

DoubleVector Class

Class DoubleVector represents a mathematical vector of double-precision floating point numbers.
Inheritance Hierarchy
SystemObject
  CenterSpace.NMath.CoreDoubleVector

Namespace:  CenterSpace.NMath.Core
Assembly:  NMath (in NMath.dll) Version: 7.3
Syntax
[SerializableAttribute]
public class DoubleVector : ISliceable<DoubleVector>, 
	IEnumerable<double>, IEnumerable, ICloneable, IXmlSerializable

The DoubleVector type exposes the following members.

Constructors
  NameDescription
Public methodDoubleVector
Undefined vector. Must be resized before using.
Public methodDoubleVector(DataRow)
Constructs a DoubleVector instance whose values are derived from the first column of each of the rows in the double row array.
Public methodDoubleVector(DataRowCollection)
Constructs a DoubleVector instance whose values are derived from the first column of each of the rows in the data row collection.
Public methodDoubleVector(DataTable)
Constructs a DoubleVector instance whose values are derived from the first column of the given data table.
Public methodDoubleVector(DataView)
Constructs a DoubleVector instance whose values are derived from the first column of the given data view.
Public methodDoubleVector(Double)
Constructs a DoubleVector instance from the contents of the given array.
Public methodDoubleVector(Int32)
Constructs a DoubleVector instance with the given length.
Public methodDoubleVector(TextReader)
Constructs a DoubleVector instance from the given text reader.
Public methodDoubleVector(String)
Constructs a DoubleVector instance from a given string representation.
Public methodDoubleVector(DoubleVector)
Constructs a deep copy of a DoubleVector.
Public methodDoubleVector(Int32, RandomNumberGenerator)
Constructs a DoubleVector instance from a random number generator.
Public methodDoubleVector(Int32, Double)
Constructs a DoubleVector instance with the given length, and all values initialized to the given value.
Public methodDoubleVector(Int32, Single)
Constructs a DoubleVector instance with the given length, and all values initialized to the given value.
Public methodDoubleVector(TextReader, NumberStyles)
Constructs a DoubleVector instance from a given text reader using the specified style.
Public methodDoubleVector(String, NumberStyles)
Returns a new DoubleVector instance from a given string representation using the specified style.
Public methodDoubleVector(Int32, RandomNumberStream, IRandomNumberDistributionDouble)
Constructs a DoubleVector instance from a random number generator.
Public methodDoubleVector(Int32, Double, Double)
Constructs a DoubleVector instance with the given length. Values are initialized starting with the given initial value, incremented by the specified amount for each element in the vector.
Public methodDoubleVector(DoubleDataBlock, Int32, Int32)
Constructs a DoubleVector instance with the specifed length, stride and referenced data.
Top
Properties
  NameDescription
Public propertyDataBlock
Gets a reference to the underlying data that this vector is viewing.
Public propertyItemInt32
Gets and sets the data element at the given position.
Public propertyCode exampleItemSlice
Returns a new DoubleVector instance pointing to the subset of this vector's data indicated by the given Slice.
Public propertyLength
Gets the number of data elements in this vector.
Public propertyStride
Gets the step between successive elements in the data that this vector is viewing.
Top
Methods
  NameDescription
Public methodStatic memberAdd(Double, DoubleVector)
Adds a scalar and a vector.
Public methodStatic memberAdd(DoubleVector, DoubleVector)
Adds two vectors.
Public methodStatic memberAdd(DoubleVector, Double)
Adds a vector and a scalar.
Public methodStatic memberAdd(Double, DoubleVector, DoubleVector)
Adds a scalar and a vector and puts the result into another vector.
Public methodStatic memberAdd(DoubleVector, DoubleVector, DoubleVector)
Adds two vectors and puts the result into a third vector.
Public methodStatic memberAdd(DoubleVector, Double, DoubleVector)
Adds a vector and a scalar and puts the result into another vector.
Public methodAppend(Double)
Appends the given element to this vector.
Public methodAppend(DoubleVector)
Appends the given vector to this vector.
Public methodApply(FuncDouble, Double)
Returns a new vector with the same size as this vector, whose values are the result of applying the given unary function to each element of this vector.
Public methodApply(FuncDouble, Double, Double, DoubleVector)
Returns a new vector with the same size as this vector, whose values are the result of applying the given binary function to each element of this vector. The first parameter to the binary function is an element of self; the second parameter is the corresponding element of the passed vector.
Public methodApply(FuncDouble, Double, Double, Double)
Returns a new vector with the same size as this vector, whose values are the result of applying the given binary function to each element of this vector. The first parameter to the binary function is the vector element; the second parameter is the passed double-precision value.
Public methodApply(FuncDouble, Int32, Double, Int32)
Returns a new vector with the same size as this vector, whose values are the result of applying the given binary function to each element of this vector. The first parameter to the binary function is the vector element; the second parameter is the passed integer value.
Public methodClear
Sets the data elements of this vector to zero.
Public methodClear(Slice)
Sets the data elements of this vector indicated by the given Slice to zero.
Public methodClone
Creates a deep copy of this vector.
Public methodStatic memberDecrement
Decrements the elements in a vector.
Public methodDeepenThisCopy
Guarantees that there is only one reference to the underlying data and that this data is in contiguous storage.
Public methodStatic memberDivide(Double, DoubleVector)
Divides a scalar by a vector.
Public methodStatic memberDivide(DoubleVector, DoubleVector)
Divides a vector by another vector.
Public methodStatic memberDivide(DoubleVector, Double)
Divides a vector by a scalar.
Public methodStatic memberDivide(Double, DoubleVector, DoubleVector)
Divides a scalar by a vector and puts the result into another vector.
Public methodStatic memberDivide(DoubleVector, DoubleVector, DoubleVector)
Divides one vector by another vector and puts the result into a third vector.
Public methodStatic memberDivide(DoubleVector, Double, DoubleVector)
Divides a vector by a scalar and puts the result into another vector.
Public methodEquals
Tests for equality of this vector and another vector. Two vectors are equal if they have the same dimensions and all values are equal.
(Overrides ObjectEquals(Object).)
Public methodGetDoubleEnumerator
Creates an IDoubleEnumerator out of the data elements in this vector.
Public methodGetEnumerator
Creates an IEnumerator{double} out of the data elements in this vector.
Public methodGetHashCode
Returns an integer hash code for this vector.
(Overrides ObjectGetHashCode.)
Public methodGetSchema
The method is reserved and should not be used.
Public methodIncrement(Double)
Adds the specified value to each element in the vector.
Public methodStatic memberIncrement(DoubleVector)
Increments the elements in a vector.
Public methodInfinityNorm
Computes the infinity-norm of this vector.
Public methodStatic memberMultiply(Double, DoubleVector)
Multiplies a scalar with a vector.
Public methodStatic memberMultiply(DoubleComplex, DoubleVector)
Multiplies a complex scalar by a vector.
Public methodStatic memberMultiply(DoubleVector, DoubleComplex)
Multiplies a vector by a complex scalar.
Public methodStatic memberMultiply(DoubleVector, DoubleVector)
Multiplies two vectors.
Public methodStatic memberMultiply(DoubleVector, Double)
Multiplies a vector with a scalar.
Public methodStatic memberMultiply(Double, DoubleVector, DoubleVector)
Multiplies a scalar and a vector and puts the result into another vector.
Public methodStatic memberMultiply(DoubleVector, DoubleVector, DoubleVector)
Multiplies two vectors and puts the result into a third vector.
Public methodStatic memberMultiply(DoubleVector, Double, DoubleVector)
Multiplies a vector and a scalar and puts the result into another vector.
Public methodNaNEquals
Tests for equality of this vector and another vector. Two vectors are equal if they have the same dimensions and all values are equal.
Public methodStatic memberNegate
Negates a vector.
Public methodOneNorm
Computes the 1-norm of this vector.
Public methodStatic memberParse(TextReader)
Constructs a DoubleVector instance from the given text reader.
Public methodStatic memberParse(String)
Returns a new DoubleVector instance from a given string representation.
Public methodStatic memberParse(TextReader, NumberStyles)
Constructs a DoubleVector instance from a given text reader using the specified style.
Public methodStatic memberParse(String, NumberStyles)
Returns a new DoubleVector instance from a given string representation using the specified style.
Public methodCode exampleReadXml
Generates a DoubleVector instance form its XML representation.
Examples
The vector: [ 1 2 3 ] would be serialized as:
Public methodResize
Changes the size of this vector to the specified length, adding zeros or truncating as necessary.
Public methodResizeAndClear
Changes the size of this vector to the specified length, and resets the value of all data elements to zero.
Public methodReverse
Returns a new vector view of the data in reverse order.
Public methodScale
Scales each element in the vector by the specified value.
Public methodSet(Double)
Sets the data elements of this vector to the specified value.
Public methodSet(Slice, Double)
Sets the data elements of this vector indicated by the given Slice to the specified value.
Public methodShallowCopy
Creates a shallow copy of this vector.
Public methodStatic memberSubtract(Double, DoubleVector)
Subtracts a vector from a scalar.
Public methodStatic memberSubtract(DoubleVector, DoubleVector)
Subtracts a vector from a vector.
Public methodStatic memberSubtract(DoubleVector, Double)
Subtracts a scalar from a vector.
Public methodStatic memberSubtract(Double, DoubleVector, DoubleVector)
Subtracts a vector from a scalar and puts the result into another vector.
Public methodStatic memberSubtract(DoubleVector, DoubleVector, DoubleVector)
Subtracts a vector from a second vector and puts the result into a third vector.
Public methodStatic memberSubtract(DoubleVector, Double, DoubleVector)
Subtracts a scalar from a vector and puts the result into another vector.
Public methodToArray
Copies data into a new array and returns it.
Public methodToDataTable
Creates a data table of one column that contains the values in this vector.
Public methodToDataTable(String)
Creates a data table of one column that contains the values in this vector.
Public methodToString
Returns a formatted string representation of this vector.
(Overrides ObjectToString.)
Public methodToString(String)
Returns a formatted string representation of this vector.
Public methodTransform(FuncDouble)
Modifies the elements of this vector by applying the given no-argument function to each element.
Public methodTransform(FuncDouble, Double)
Modifies the elements of this vector by applying the given unary function to each element.
Public methodTransform(FuncDouble, Double, Double, DoubleVector)
Modifies the contents of this vector by applying the given binary function to each element. The first parameter to the binary function is an element of self; the second parameter is the corresponding element of the passed vector.
Public methodTransform(FuncDouble, Double, Double, Double)
Modifies the contents of this vector by applying the given binary function to each element. The first parameter to the binary function is the vector element; the second parameter is the passed double-precision value.
Public methodTransform(FuncDouble, Int32, Double, Int32)
Modifies the contents of this vector by applying the given function to each element. The first parameter to the function is the vector element; the second parameter is the passed integer value.
Public methodTwoNorm
Computes the 2-norm of this vector.
Public methodTwoNormSquared
Computes the 2-norm squared of this vector.
Public methodWrite(TextWriter)
Writes a text representation of this vector to the given writer.
Public methodWrite(TextWriter, String)
Writes a formatted text representation of this vector.
Public methodCode exampleWriteXml
Converts an object into its XML representation.
Examples
The vector: [ 1 2 3 ] would be serialized as:
Top
Operators
  NameDescription
Public operatorStatic memberAddition(Double, DoubleVector)
Adds a scalar and a vector.
Public operatorStatic memberAddition(DoubleVector, DoubleVector)
Adds two vectors.
Public operatorStatic memberAddition(DoubleVector, Double)
Adds a vector and a scalar.
Public operatorStatic memberDecrement
Decrements the elements in this vector.
Public operatorStatic memberDivision(Double, DoubleVector)
Divides a scalar by a vector.
Public operatorStatic memberDivision(DoubleVector, DoubleVector)
Divides a vector by another vector.
Public operatorStatic memberDivision(DoubleVector, Double)
Divides a vector by a scalar.
Public operatorStatic memberEquality
Tests for equality of two vectors. Two vectors are equal if they have the same dimensions and all values are equal.
Public operatorStatic member(FloatVector to DoubleVector)
Implicitly converts a FloatVector instance into a DoubleVector instance.
Public operatorStatic memberIncrement
Increments the elements in this vector.
Public operatorStatic memberInequality
Tests for inequality of two vectors. Two vectors are unequal if they have different dimensions or their values are not all equal.
Public operatorStatic memberMultiply(Double, DoubleVector)
Multiplies a scalar by a vector.
Public operatorStatic memberMultiply(DoubleComplex, DoubleVector)
Multiplies a DoubleComplex scalar by a vector.
Public operatorStatic memberMultiply(DoubleVector, DoubleComplex)
Multiplies a DoubleComplex scalar by a vector.
Public operatorStatic memberMultiply(DoubleVector, DoubleVector)
Multiplies two vectors.
Public operatorStatic memberMultiply(DoubleVector, Double)
Multiplies a vector by a scalar.
Public operatorStatic memberSubtraction(Double, DoubleVector)
Subtracts a vector from a scalar.
Public operatorStatic memberSubtraction(DoubleVector, DoubleVector)
Subtracts a vector from another vector.
Public operatorStatic memberSubtraction(DoubleVector, Double)
Subtracts a scalar from a vector.
Public operatorStatic memberUnaryNegation
Negates the elements in this vector.
Public operatorStatic memberUnaryPlus
Returns a vector.
Top
Fields
  NameDescription
Public fieldStatic memberXmlDataElement
XML data element name.
Public fieldStatic memberXmlDatumElement
XML datum element name.
Public fieldStatic memberXmlLengthAttribute
XML length attribute name.
Top
See Also