JuliaWSUtilityFunctions

jwsutils.spad line 1 [edit on github]

Julia Wolfram Symbolic utility functions using Wolfram Symbolic Transport Protocol.

gaussianMatrix: JuliaWSReal -> JuliaWSMatrix JuliaWSReal

gaussianMatrix(r) returns the Gaussian matrix with radius r. For example: example{gaussianMatrix “2.2”}

hankelMatrix: PositiveInteger -> JuliaWSMatrix JuliaWSInteger

hankelMatrix(n) returns the square Hankel matrix with integer coefficients.

hilbertMatrix: PositiveInteger -> JuliaWSMatrix JuliaWSRational

hilbertMatrix(n) returns the square Hilbert matrix.

identityMatrix: PositiveInteger -> JuliaWSMatrix JuliaWSInteger

identityMatrix(n) returns the identity matrix of size n.

jlWSExport: (String, JuliaWSExpression) -> JuliaWSExpression

jlWSExport(file.ext, obj) exports the object obj to the file file.ext. The extension ext will determine the saved format. A WS expression for example can be exported in an image file, it will be saved in the WS ‘StandardForm’ whereas in FriCAS it is outputted in WS ‘OutputForm': example{x:=jWSExpr(x);jlWSExport(“legendreP.png”, legendreP(7, x))}

jlWSExportString: (JuliaWSExpression, JuliaWSExpression) -> JuliaWSExpression

jlWSExportString(expr, jWSString(format)) returns the string representation of expr in the format form. 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”)}

jlWSPlot: (JuliaWSExpression, JuliaWSExpression) -> JuliaWSExpression

jlWSPlot(expr, options) is the WS plot 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))}

range: (JuliaWSInteger, JuliaWSInteger) -> JuliaWSList JuliaWSInteger

range(n,m) returns a WS agg that ranges from n to m.

range: (JuliaWSInteger, JuliaWSInteger, JuliaWSInteger) -> JuliaWSList JuliaWSInteger

range(n,m,d) returns a WS agg that ranges from n to m with step d.

range: JuliaWSInteger -> JuliaWSList JuliaWSInteger

range(n) returns a WS agg that ranges from 1 to n. For example: example{range(10)@JWSLIST(JWSINT)}

seedRandom: JuliaWSInteger -> JuliaWSExpression

seedRandom(n) reseed the random number generator with n as seed. Returns the random generator state.

urand01Complex: (PositiveInteger, PositiveInteger) -> JuliaWSMatrix JuliaWSComplex

urand01Complex(rows,cols) returns a Julia WS matrix with uniformly distributed random complex elements in the unit square. Convenience function.

urand01Complex: PositiveInteger -> JuliaWSVector JuliaWSComplex

urand01Complex(n) returns a Julia WS vector with uniformly distributed random complex elements in the unit square. Convenience function.

urand01Real: (PositiveInteger, PositiveInteger) -> JuliaWSMatrix JuliaWSReal

urand01Real(rows,cols) returns a Julia WS matrix with uniformly distributed random elements in the range 0..1. Convenience function.

urand01Real: PositiveInteger -> JuliaWSVector JuliaWSReal

urand01Real(n) returns a Julia WS vector with uniformly distributed random elements in the range 0..1. Convenience function.

vandermondeMatrix: (JuliaWSList JuliaWSExpression, JuliaWSInteger) -> JuliaWSMatrix JuliaWSExpression

vandermondeMatrix(lvars, m) returns a Vandermonde matrix with nodes from lvars and m columns.

vandermondeMatrix: JuliaWSList JuliaWSExpression -> JuliaWSMatrix JuliaWSExpression

vandermondeMatrix(lvars) returns a Vandermonde matrix with nodes from lvars.

zeroMatrix: (PositiveInteger, PositiveInteger) -> JuliaWSMatrix JuliaWSInteger

zeroMatrix(m, n) returns an m-by-n zero matrix.