Click or drag to resize

FloatVector Class

Class FloatVector represents a mathematical vector of floating point numbers.
Inheritance Hierarchy
SystemObject
  CenterSpace.NMath.CoreFloatVector

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

The FloatVector type exposes the following members.

Constructors
 NameDescription
Public methodFloatVector Undefined vector. Must be resized before using.
Public methodFloatVector(DataRow) Constructs a FloatVector instance whose values are derived from the first column of each of the rows in the double row array.
Public methodFloatVector(DataRowCollection) Constructs a FloatVector instance whose values are derived from the first column of each of the rows in the data row collection.
Public methodFloatVector(DataTable) Constructs a FloatVector instance whose values are derived from the first column of the given data table.
Public methodFloatVector(DataView) Constructs a FloatVector instance whose values are derived from the first column of the given data view.
Public methodFloatVector(FloatVector) Constructs a deep copy of a FloatVector.
Public methodFloatVector(Int32) Constructs a FloatVector instance with the given length.
Public methodFloatVector(Single) Constructs a FloatVector instance from the contents of the given array.
Public methodFloatVector(String) Constructs a FloatVector instance from a given string representation.
Public methodFloatVector(TextReader) Constructs a FloatVector instance from the given text reader.
Public methodFloatVector(Int32, RandomNumberGenerator) Constructs a FloatVector instance from a random number generator.
Public methodFloatVector(Int32, Single) Constructs a FloatVector instance with the given length, and all values initialized to the given value.
Public methodFloatVector(String, NumberStyles) Returns a new FloatVector instance from a given string representation using the specified style.
Public methodFloatVector(TextReader, NumberStyles) Constructs a FloatVector instance from a given text reader using the specified style.
Public methodFloatVector(FloatDataBlock, Int32, Int32) Constructs a FloatVector instance with the specifed length, stride and referenced data.
Public methodFloatVector(Int32, RandomNumberStream, IRandomNumberDistributionSingle) Constructs a FloatVector instance from a random number generator.
Public methodFloatVector(Int32, Single, Single) Constructs a FloatVector 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.
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 FloatVector 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(FloatVector, FloatVector) Adds two vectors.
Public methodStatic memberAdd(FloatVector, Single) Adds a vector and a scalar.
Public methodStatic memberAdd(Single, FloatVector) Adds a scalar and a vector.
Public methodStatic memberAdd(FloatVector, FloatVector, FloatVector) Adds two vectors and puts the result into a third vector.
Public methodStatic memberAdd(FloatVector, Single, FloatVector) Adds a vector and a scalar and puts the result into another vector.
Public methodStatic memberAdd(Single, FloatVector, FloatVector) Adds a scalar and a vector and puts the result into another vector.
Public methodAppend(FloatVector) Appends the given vector to this vector.
Public methodAppend(Single) Appends the given element to this vector.
Public methodApply(FuncSingle, Single) 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(FuncSingle, Int32, Single, 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 methodApply(FuncSingle, Single, Single, FloatVector) 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(FuncSingle, Single, Single, Single) 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 floating point 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(FloatVector, FloatVector) Divides a vector by another vector.
Public methodStatic memberDivide(FloatVector, Single) Divides a vector by a scalar.
Public methodStatic memberDivide(Single, FloatVector) Divides a scalar by a vector.
Public methodStatic memberDivide(FloatVector, FloatVector, FloatVector) Divides one vector by another vector and puts the result into a third vector.
Public methodStatic memberDivide(FloatVector, Single, FloatVector) Divides a vector by a scalar and puts the result into another vector.
Public methodStatic memberDivide(Single, FloatVector, FloatVector) Divides a scalar by a vector 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 methodGetEnumerator Creates an IEnumerator{float} out of the data elements in this vector.
Public methodGetFloatEnumerator Creates an IFloatEnumerator 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 methodStatic memberIncrement(FloatVector) Increments the elements in a vector.
Public methodIncrement(Single) Adds the specified value to each element in the vector.
Public methodInfinityNorm Computes the infinity-norm of this vector.
Public methodStatic memberMultiply(FloatComplex, FloatVector) Multiplies a complex scalar by a vector.
Public methodStatic memberMultiply(FloatVector, FloatComplex) Multiplies a vector by a complex scalar.
Public methodStatic memberMultiply(FloatVector, FloatVector) Multiplies two vectors.
Public methodStatic memberMultiply(FloatVector, Single) Multiplies a vector with a scalar.
Public methodStatic memberMultiply(Single, FloatVector) Multiplies a scalar with a vector.
Public methodStatic memberMultiply(FloatVector, FloatVector, FloatVector) Multiplies two vectors and puts the result into a third vector.
Public methodStatic memberMultiply(FloatVector, Single, FloatVector) Multiplies a vector and a scalar and puts the result into another vector.
Public methodStatic memberMultiply(Single, FloatVector, FloatVector) Multiplies a scalar and a vector 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(String) Returns a new FloatVector instance from a given string representation.
Public methodStatic memberParse(TextReader) Constructs a FloatVector instance from the given text reader.
Public methodStatic memberParse(String, NumberStyles) Returns a new FloatVector instance from a given string representation using the specified style.
Public methodStatic memberParse(TextReader, NumberStyles) Constructs a FloatVector instance from a given text reader using the specified style.
Public methodCode exampleReadXml Generates a FloatVector instance form its XML representation.
Example
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(Single) Sets the data elements of this vector to the specified value.
Public methodSet(Slice, Single) 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(FloatVector, FloatVector) Subtracts a vector from a vector.
Public methodStatic memberSubtract(FloatVector, Single) Subtracts a scalar from a vector.
Public methodStatic memberSubtract(Single, FloatVector) Subtracts a vector from a scalar.
Public methodStatic memberSubtract(FloatVector, FloatVector, FloatVector) Subtracts a vector from a second vector and puts the result into a third vector.
Public methodStatic memberSubtract(FloatVector, Single, FloatVector) Subtracts a scalar from a vector and puts the result into another vector.
Public methodStatic memberSubtract(Single, FloatVector, FloatVector) Subtracts a vector from a scalar and puts the result into another vector.
Public methodToArray Copies data into an 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(FuncSingle) Modifies the elements of this vector by applying the given no-argument function to each element.
Public methodTransform(FuncSingle, Single) Modifies the elements of this vector by applying the given unary function to each element.
Public methodTransform(FuncSingle, Int32, Single, 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 methodTransform(FuncSingle, Single, Single, FloatVector) 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(FuncSingle, Single, Single, Single) 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 floating point 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.
Example
The vector: [ 1 2 3 ] would be serialized as:
Top
Operators
 NameDescription
Public operatorStatic memberAddition(FloatVector, FloatVector) Adds two vectors.
Public operatorStatic memberAddition(FloatVector, Single) Adds a vector and a scalar.
Public operatorStatic memberAddition(Single, FloatVector) Adds a scalar and a vector.
Public operatorStatic memberDecrement(FloatVector) Decrements the elements in this vector.
Public operatorStatic memberDivision(FloatVector, FloatVector) Divides a vector by another vector.
Public operatorStatic memberDivision(FloatVector, Single) Divides a vector by a scalar.
Public operatorStatic memberDivision(Single, FloatVector) Divides a scalar by a vector.
Public operatorStatic memberEquality(FloatVector, FloatVector) Tests for equality of two vectors. Two vectors are equal if they have the same dimensions and all values are equal.
Public operatorStatic memberIncrement(FloatVector) Increments the elements in this vector.
Public operatorStatic memberInequality(FloatVector, FloatVector) 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(FloatComplex, FloatVector) Multiplies a complex scalar by a vector.
Public operatorStatic memberMultiply(FloatVector, FloatComplex) Multiplies a complex scalar by a vector.
Public operatorStatic memberMultiply(FloatVector, FloatVector) Multiplies two vectors.
Public operatorStatic memberMultiply(FloatVector, Single) Multiplies a vector by a scalar.
Public operatorStatic memberMultiply(Single, FloatVector) Multiplies a scalar by a vector.
Public operatorStatic memberSubtraction(FloatVector, FloatVector) Subtracts a vector from another vector.
Public operatorStatic memberSubtraction(FloatVector, Single) Subtracts a scalar from a vector.
Public operatorStatic memberSubtraction(Single, FloatVector) Subtracts a vector from a scalar.
Public operatorStatic memberUnaryNegation(FloatVector) Negates the elements in this vector.
Public operatorStatic memberUnaryPlus(FloatVector) 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