WSUtilityFunctions¶
jwsutils.spad line 1 [edit on github]
Julia Wolfram Symbolic utility functions using the MathLink Julia package.
- fourierMatrix: PositiveInteger -> WSMatrix WSExpression
fourierMatrix(n)returns thenxnFourier matrix.
- gaussianMatrix: WSReal -> WSMatrix WSReal
gaussianMatrix(r)returns the Gaussian matrix with radiusr. For example: example{gaussianMatrix “2.2”}
- hankelMatrix: PositiveInteger -> WSMatrix WSInteger
hankelMatrix(n)returns the square Hankel matrix with integer coefficients.
- hilbertMatrix: PositiveInteger -> WSMatrix WSRational
hilbertMatrix(n)returns the square Hilbert matrix.
- identityMatrix: PositiveInteger -> WSMatrix WSInteger
identityMatrix(n)returns the identity matrix of sizen.
- jlWSDateString: () -> WSExpression
jlWSDateString()returns the WSExpression string of the local date and time. For example: example{toString jlWSDateString()}
- jlWSDateString: (WSExpression, WSExpression) -> WSExpression
jlWSDateString(expr, form)returns WSExpression string of the date from aWSdate object withWSformat form. For example: example{jlWSDateString(jWSExpr(“Now”), jWSExpr(“Entity[_”Language_”, _”French::367gk_”]”))}
- jlWSDateString: WSExpression -> WSExpression
jlWSDateString(expr)returns the WSExpression string of the date from aWSdate object. For example: example{jlWSDateString jWSExpr “Tomorrow”}
- jlWSDocumentation: Symbol -> WSExpression
jlWSDocumentation(sym)printsWSinformation about the symbolsym. Note that theWSlanguage is preferable. Trivial implementation. For example: example{jlWSDocumentation sin} example{jlWSDocumentation ArcSin}
- jlWSExport: (String, WSExpression) -> WSExpression
jlWSExport(file.ext, obj)exports the object obj to the file file.ext. The extension ext will determine the saved format. AWSexpression for example can be exported in an image file, it will be saved in theWS‘StandardForm’ whereas in FriCAS it is displayed inWS‘OutputForm':example{x:=jWSExpr(x);jlWSExport(“legendreP.png”, legendreP(7, x))}
- jlWSExportString: (WSExpression, WSExpression) -> WSExpression
jlWSExportString(expr, jWSString(format))returns the string representation ofexprin the specified format. Use toString or string to obtain the FriCAS String. For example: example{jWSExpr "Probability[x < 0, x \[Distributed] NormalDistribution[]]"} example{jWSExpr "Probability[x < 1, x \[Distributed] NormalDistribution[]]"} example{string jlWSExportString(%,jWSString “TeX”)}
- jlWSFileFormat: (String, WSExpression) -> WSExpression
jlWSFileFormat(src, list(form))tries to determine the format of the sourcesrcfrom its content using the list of formats form. ReturnsWSNone if no format is found. Can be used with jWSImport. For example:jlWSFileFormat("examples/customers-100.csv",jWSExpr "{_"CSV_",_"TSV_"}")
- jlWSFileFormat: String -> WSExpression
jlWSFileFormat(src)tries to determine the format of the sourcesrcfrom its content. Can be used with jWSImport. For example: example{jlWSFileFormat(“examples/customers-100.csv”)}
- jlWSImport: (WSExpression, WSExpression) -> WSExpression
jlWSImport(myfile, form)imports the filemyfilewith format form. For example: example{file:=jlWSImport(jWSString(“examples/customers-100.csv”), jWSString “CSV”);}
- jlWSImport: WSExpression -> WSExpression
jlWSImport(src)imports the sourcesrc. For example: example{file:=jlWSImport jWSString “examples/customers-100.csv”;} example{jlWSDateString(file.2.11)}
- jlWSPlot: (WSExpression, WSExpression) -> WSExpression
jlWSPlot(expr, options)is theWSplot function. Since it should be run in a Wolfram notebook or any other supported graphical interfaces, the Wolfram Jupyter “plugin” for example, it is left to the user for testing purposes. The following uses the jlWSExport function: example{x:=jWSExpr(x);opt:=jWSList [x,-5,5]} example{jlWSExport(“sin.png”, jlWSPlot(sin(x),opt))}
- jlWSSeedRandom!: WSInteger -> WSExpression
jlWSSeedRandom!(n)reseeds the random number generator withnas seed. Returns the random generator state.
- jlWSSnippet: (WSExpression, WSInteger) -> WSExpression
jlWSSnippet(expr, n)returns the first (or last)nsnippets of the WSExpressionexpr. For example: example{jlWSSnippet(jlWSImport jWSString “http://www.fricas.org/”,-2)}
- jWSDateObject: () -> WSExpression
jWSDateObject()returns the WSExpression object of the local date and time.
- jWSDateObject: (WSExpression, WSExpression) -> WSExpression
jWSDateObject(date,type)returns the WSExpression object of thedateandtype, for example “Month”.
- jWSDateObject: WSExpression -> WSExpression
jWSDateObject(expr)returns the WSExpression object of the date fromexpr.
- jWSRange: (WSInteger, WSInteger) -> WSList WSInteger
jWSRange(n,m)returns a WSList that ranges fromntom.
- jWSRange: (WSInteger, WSInteger, WSInteger) -> WSList WSInteger
jWSRange(n,m,d)returns a WSList that ranges fromntomwith stepd.
- jWSRange: WSInteger -> WSList WSInteger
jWSRange(n)returns a WSList that ranges from 1 ton. For example: example{jWSRange(10)@WSLIST(WSINT)}
- urand01Complex: (PositiveInteger, PositiveInteger) -> WSMatrix WSComplex
urand01Complex(rows,cols)returns a JuliaWSmatrix with uniformly distributed random complex elements in the unit square. Convenience function.
- urand01Complex: PositiveInteger -> WSVector WSComplex
urand01Complex(n)returns a JuliaWSvector with uniformly distributed random complex elements in the unit square. Convenience function.
- urand01Real: (PositiveInteger, PositiveInteger) -> WSMatrix WSReal
urand01Real(rows,cols)returns a JuliaWSmatrix with uniformly distributed random elements in the range 0..1. Convenience function.
- urand01Real: PositiveInteger -> WSVector WSReal
urand01Real(n)returns a JuliaWSvector with uniformly distributed random elements in the range 0..1. Convenience function.
- vandermondeMatrix: (WSList WSExpression, WSInteger) -> WSMatrix WSExpression
vandermondeMatrix(lvars, m)returns a Vandermonde matrix with nodes fromlvarsandmcolumns.
- vandermondeMatrix: WSList WSExpression -> WSMatrix WSExpression
vandermondeMatrix(lvars)returns a Vandermonde matrix with nodes fromlvars.
- zeroMatrix: (PositiveInteger, PositiveInteger) -> WSMatrix WSInteger
zeroMatrix(m, n)returns anm-by-nzero matrix.