Maxima Plugin
A SMath Plugin
Loading...
Searching...
No Matches
MaximaPlugin.Converter.ConvertToSMath Class Reference

Data and Functions for conversion from Maxima to SMath More...

Static Public Member Functions

static string PrepareStringsForSMath (string text)
 Replaces string constants to SMath More...
 
static string ConvertPowerStringBuilder (PowerDataContainer container)
 Generates an SMath expression string from a PowerDataContainer object More...
 
static string ConvertPower (string text)
 Adds appropriate curly braces in expressions with powers More...
 
static string PrepareTermsForSMath (string text)
 Translate Maxima string to SMath string More...
 

Static Public Attributes

static bool skipConverting = false
 

Static Private Attributes

static Dictionary< string, string > constantsToSMath
 
static Dictionary< string, string > symbolsToSMath
 
static Dictionary< string, string > logicToSMath
 
static Dictionary< string, string > seperatorsToSMath
 
static Dictionary< string, string > functionNamesToSMath
 

Detailed Description

Data and Functions for conversion from Maxima to SMath

Member Function Documentation

◆ ConvertPower()

static string MaximaPlugin.Converter.ConvertToSMath.ConvertPower ( string  text)
static

Adds appropriate curly braces in expressions with powers

Parameters
textInput string
Returns
Converted string

◆ ConvertPowerStringBuilder()

static string MaximaPlugin.Converter.ConvertToSMath.ConvertPowerStringBuilder ( PowerDataContainer  container)
static

Generates an SMath expression string from a PowerDataContainer object

Parameters
containerPowerDataContainer object
Returns
SMath expression string

◆ PrepareStringsForSMath()

static string MaximaPlugin.Converter.ConvertToSMath.PrepareStringsForSMath ( string  text)
static

Replaces string constants to SMath

Parameters
textstring to translate
Returns
Translated string

◆ PrepareTermsForSMath()

static string MaximaPlugin.Converter.ConvertToSMath.PrepareTermsForSMath ( string  text)
static

Translate Maxima string to SMath string

Parameters
textMaxima expression
Returns
SMath expression

Member Data Documentation

◆ constantsToSMath

Dictionary<string, string> MaximaPlugin.Converter.ConvertToSMath.constantsToSMath
staticprivate
Initial value:
= new Dictionary<string, string>
{
{ @"(^|\W)(%e)($|\W)", "$1e$3" },
{ @"(^|\W)(%i)($|\W)", "$1i$3" },
{ @"%pi", "π"},
{ ControlObjects.Replacement.Sharp + @"(\w)", "#$1" },
{ @"(\w)" + ControlObjects.Replacement.Sharp, "$1#" },
{ @"(?<=\W)(" + ControlObjects.Replacement.Sharp + @")(?=\W)", "#"},
{ @"([,\‍(])(?=[,\‍)])", "$1#"},
}

◆ functionNamesToSMath

Dictionary<string, string> MaximaPlugin.Converter.ConvertToSMath.functionNamesToSMath
staticprivate
Initial value:
= new Dictionary<string, string>
{
{ @"\bintegrate\‍(", "int(" },
{ @"\blog\‍(", "ln(" },
{ @"\blimit\‍(", "lim(" },
{ @"\bsignum\‍(", "sign(" },
{ @"\bdeterminant\‍(", "det(" },
{ @"\brealpart\‍(", "Re(" },
{ @"\bimagpart\‍(", "Im(" },
{ @"\?at\‍(", "at(" },
{ @"\bntewurzel\‍(", "nthroot(" },
{ @"\bround\‍((.+)\‍)", "round($1,0)" },
}

◆ logicToSMath

Dictionary<string, string> MaximaPlugin.Converter.ConvertToSMath.logicToSMath
staticprivate
Initial value:
= new Dictionary<string, string>
{
{ @"(\s)<=(\s)", "$1≤$2" },
{ @"(\s)>=(\s)", "$1≥$2" },
{ @"(\s)#(\s)", "$1≠$2" },
{ @"(\s)not(\s)", "$1¬$2" },
{ @"(\s)and(\s)", "$1&$2" },
{ @"(\s)or(\s)", "$1|$2" },
}

◆ seperatorsToSMath

Dictionary<string, string> MaximaPlugin.Converter.ConvertToSMath.seperatorsToSMath
staticprivate
Initial value:
= new Dictionary<string, string>
{
{ @"\?\%", "" },
{ @"'([^\+\-*/])", "$1" },
{ @"%unit([^\+\-*/])", "'$1" },
{ @"%([^\+\-*/])", "$1" },
{ String.Format(@"(^|[\+\-*/\‍(\‍)])([^()\[\]{0}]+)\[([^()\[\]{0}]+)\{0}([^()\[\]{0}]+)\]($|[\+\-*/\‍(\‍)])",GlobalProfile.ArgumentsSeparatorStandard), String.Format("$1el($2{0}$3{0}$4)$5",GlobalProfile.ArgumentsSeparatorStandard) },
{ String.Format(@"(^|[\+\-*/\‍(\‍)])([^()\[\]{0}]+)\[([^()\[\]{0}]+)\]($|[\+\-*/\‍(\‍)])",GlobalProfile.ArgumentsSeparatorStandard), String.Format("$1el($2{0}$3)$4",GlobalProfile.ArgumentsSeparatorStandard) },
{ @"(=)", "≡" },
{ @"~", "†" },
}

◆ symbolsToSMath

Dictionary<string, string> MaximaPlugin.Converter.ConvertToSMath.symbolsToSMath
staticprivate
Initial value:
= new Dictionary<string, string>
{
{ @"(^|\W)(inf)($|\W)","$1∞$3" },
{ @"(^|\W)(minf)($|\W)","$1-∞$3" },
{ @"(^|\W)(infinity)($|\W)","$1∞$3" },
{ @"(\d+\.\d+)[bBeE](\+\d+|\-\d+|\d+)", "$1*10^$2" },
}

The documentation for this class was generated from the following file: