Click or drag to resize
Accord.NET (logo)

DefaultArrayFormatProvider Class

Gets the default matrix representation, where each row is separated by a new line, and columns are separated by spaces.
Inheritance Hierarchy
SystemObject
  Accord.MathMatrixFormatProviderBase
    Accord.MathDefaultArrayFormatProvider

Namespace:  Accord.Math
Assembly:  Accord.Math (in Accord.Math.dll) Version: 3.8.0
Syntax
public sealed class DefaultArrayFormatProvider : MatrixFormatProviderBase
Request Example View Source

The DefaultArrayFormatProvider type exposes the following members.

Constructors
  NameDescription
Public methodDefaultArrayFormatProvider
Initializes a new instance of the DefaultArrayFormatProvider class.
Top
Properties
  NameDescription
Public propertyStatic memberCurrentCulture
Gets the IMatrixFormatProvider which uses the CultureInfo used by the current thread.
Public propertyFormatColDelimiter
A string containing the column delimiter for a matrix to be used in formatting.
(Inherited from MatrixFormatProviderBase.)
Public propertyFormatColEnd
A string denoting the end of a matrix column to be used in formatting.
(Inherited from MatrixFormatProviderBase.)
Public propertyFormatColStart
A string denoting the start of a matrix column to be used in formatting.
(Inherited from MatrixFormatProviderBase.)
Public propertyFormatMatrixEnd
A string denoting the end of the matrix to be used in formatting.
(Inherited from MatrixFormatProviderBase.)
Public propertyFormatMatrixStart
A string denoting the start of the matrix to be used in formatting.
(Inherited from MatrixFormatProviderBase.)
Public propertyFormatRowDelimiter
A string containing the row delimiter for a matrix to be used in formatting.
(Inherited from MatrixFormatProviderBase.)
Public propertyFormatRowEnd
A string denoting the end of a matrix row to be used in formatting.
(Inherited from MatrixFormatProviderBase.)
Public propertyFormatRowStart
A string denoting the start of a matrix row to be used in formatting.
(Inherited from MatrixFormatProviderBase.)
Public propertyInnerProvider
Gets the culture specific formatting information to be used during parsing or formatting.
(Inherited from MatrixFormatProviderBase.)
Public propertyStatic memberInvariantCulture
Gets the IMatrixFormatProvider which uses the invariant system culture.
Public propertyParseColDelimiter
A string containing the column delimiter for a matrix to be used in parsing.
(Inherited from MatrixFormatProviderBase.)
Public propertyParseColEnd
A string denoting the end of a matrix column to be used in parsing.
(Inherited from MatrixFormatProviderBase.)
Public propertyParseColStart
A string denoting the start of a matrix column to be used in parsing.
(Inherited from MatrixFormatProviderBase.)
Public propertyParseMatrixEnd
A string denoting the end of the matrix to be used in parsing.
(Inherited from MatrixFormatProviderBase.)
Public propertyParseMatrixStart
A string denoting the start of the matrix to be used in parsing.
(Inherited from MatrixFormatProviderBase.)
Public propertyParseRowDelimiter
A string containing the row delimiter for a matrix to be used in parsing.
(Inherited from MatrixFormatProviderBase.)
Public propertyParseRowEnd
A string denoting the end of a matrix row to be used in parsing.
(Inherited from MatrixFormatProviderBase.)
Public propertyParseRowStart
A string denoting the start of a matrix row to be used in parsing.
(Inherited from MatrixFormatProviderBase.)
Top
Methods
  NameDescription
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodGetFormat
Returns an object that provides formatting services for the specified type. Currently, only IMatrixFormatProvider is supported.
(Inherited from MatrixFormatProviderBase.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Extension Methods
  NameDescription
Public Extension MethodHasMethod
Checks whether an object implements a method with the given name.
(Defined by ExtensionMethods.)
Public Extension MethodIsEqual
Compares two objects for equality, performing an elementwise comparison if the elements are vectors or matrices.
(Defined by Matrix.)
Public Extension MethodTo(Type)Overloaded.
Converts an object into another type, irrespective of whether the conversion can be done at compile time or not. This can be used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.)
Public Extension MethodToTOverloaded.
Converts an object into another type, irrespective of whether the conversion can be done at compile time or not. This can be used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.)
Top
Remarks
This class can be used to convert to and from C# arrays and their string representation. Please see the example for details.
Examples

Converting from an array matrix to a string representation:

// Declare a number array
double[] x = { 5, 6, 7, 8 };

// Convert the aforementioned array to a string representation:
string str = x.ToString(DefaultArrayFormatProvider.CurrentCulture);

// the final result will be equivalent to
"5, 6, 7, 8"

Converting from strings to actual matrices:

// Declare an input string
string str = "5, 6, 7, 8";

// Convert the string representation to an actual number array:
double[] array = Matrix.Parse(str, DefaultArrayFormatProvider.InvariantCulture);

// array will now contain the actual number 
// array representation of the given string.
See Also