java.lang.Object
imagingbook.common.util.MathematicaIO
This class provides some static methods for formatting Java arrays (representing vectors, matrices or measurements)
for copy-pasting to Mathematica.
- Version:
- 2014/12/03
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
Generates a string holding the named definition of a 1D double array for Mathematica in the form name = {A[0], A[1], ...,A[m-1]};static String
Generates a string holding the named definition of a 2D double array for Mathematica in the form name = {{A[0][0],...,A[0][m-1]}, {A[1][0],...,A[1][m-1]}, ..., {A[n-1][0], A[n-1][1], ...,A[n-1][m-1]}};static String
Generates a string holding the named definition of a 1D float array for Mathematica in the formname = {A[0], A[1], ...,A[m-1]};
static String
Generates a string holding the named definition of a 2D float array for Mathematica in the form name = {{A[0][0],...,A[0][m-1]}, {A[1][0],...,A[1][m-1]}, ..., {A[n-1][0], A[n-1][1], ...,A[n-1][m-1]}};static String
Generates a string holding the named definition of a 1D int array for Mathematica in the formname = {A[0], A[1], ...,A[m-1]};
-
Method Details
-
listArray
Generates a string holding the named definition of a 1D double array for Mathematica in the form name = {A[0], A[1], ...,A[m-1]};- Parameters:
name
- the identifier to be used in Mathematica.A
- the array to be encoded (of length m).- Returns:
- a String holding the Mathematica definition.
-
listArray
Generates a string holding the named definition of a 1D float array for Mathematica in the formname = {A[0], A[1], ...,A[m-1]};
- Parameters:
name
- the name (Mathematica symbol) for the resulting arrayA
- the array to be encoded (of length m).- Returns:
- a String holding the Mathematica definition.
-
listArray
Generates a string holding the named definition of a 1D int array for Mathematica in the formname = {A[0], A[1], ...,A[m-1]};
- Parameters:
name
- the name (Mathematica symbol) for the resulting arrayA
- the array to be encoded (of length m).- Returns:
- a String holding the Mathematica definition.
-
listArray
Generates a string holding the named definition of a 2D double array for Mathematica in the form name = {{A[0][0],...,A[0][m-1]}, {A[1][0],...,A[1][m-1]}, ..., {A[n-1][0], A[n-1][1], ...,A[n-1][m-1]}};- Parameters:
name
- the identifier to be used in Mathematica.A
- the array to be encoded (of length m).- Returns:
- a String holding the Mathematica definition.
-
listArray
Generates a string holding the named definition of a 2D float array for Mathematica in the form name = {{A[0][0],...,A[0][m-1]}, {A[1][0],...,A[1][m-1]}, ..., {A[n-1][0], A[n-1][1], ...,A[n-1][m-1]}};- Parameters:
name
- the identifier to be used in Mathematica.A
- the array to be encoded (of length m).- Returns:
- a String holding the Mathematica definition.
-