Click or drag to resize
Accord.NET (logo)

OctaveArrayFormatProvider Class

Format provider for the matrix format used by Octave.
Inheritance Hierarchy
SystemObject
  Accord.MathMatrixFormatProviderBase
    Accord.MathOctaveArrayFormatProvider

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

The OctaveArrayFormatProvider type exposes the following members.

Constructors
  NameDescription
Public methodOctaveArrayFormatProvider
Initializes a new instance of the OctaveMatrixFormatProvider 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
Examples

Converting from a multidimensional matrix to a string representation:

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

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

// the final result will be equivalent to
"[ 1, 2, 3, 4]"

Converting from strings to actual matrices:

// Declare an input string
string str = "[ 1, 2, 3, 4]";

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

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