Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion PackageInfo.g
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SetPackageInfo( rec(

PackageName := "MachineLearningForCAP",
Subtitle := "Exploring categorical machine learning in CAP",
Version := "2024.07-12",
Version := "2024.07-13",
Date := (function ( ) if IsBound( GAPInfo.SystemEnvironment.GAP_PKG_RELEASE_DATE ) then return GAPInfo.SystemEnvironment.GAP_PKG_RELEASE_DATE; else return Concatenation( ~.Version{[ 1 .. 4 ]}, "-", ~.Version{[ 6, 7 ]}, "-01" ); fi; end)( ),
License := "GPL-2.0-or-later",

Expand Down
14 changes: 14 additions & 0 deletions examples/Expressions.g
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ LazyDiff( e, 1 )( dummy_input );;
# "(((Sin(x1))/(Cos(x1)))+((Sin(x2))^(2)))+((Cos(x2))^(2))", 1 )( [ x1, x2, x3 ] );
JacobianMatrixUsingPython( [ x1*Cos(x2)+Exp(x3), x1*x2*x3 ], [ 1, 2, 3 ] );
#! [ [ "Cos(x2)", "-x1*Sin(x2)", "Exp(x3)" ], [ "x2*x3", "x1*x3", "x1*x2" ] ]
JacobianMatrix( [ "x1", "x2", "x3" ], [ "x1*Cos(x2)+Exp(x3)", "x1*x2*x3" ],
[ 1, 2, 3 ] )(dummy_input);
#! [ [ Cos(x2), (-x1)*Sin(x2), Exp(x3) ], [ x2*x3, x1*x3, x1*x2 ] ]
LaTeXOutputUsingPython( e );
#! "\\frac{\\sin{\\left(x_{1} \\right)}}{\\cos{\\left(x_{1} \\right)}}
#! + \\sin^{2}{\\left(x_{2} \\right)} + \\cos^{2}{\\left(x_{2} \\right)}"
Expand All @@ -93,4 +96,15 @@ labels := List( points, point -> SelectBasedOnCondition( point[2] < 0.5, 0, 1 )
#! 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
ScatterPlotUsingPython( points, labels : size := "100", action := "save" );;
# e.g, dir("/tmp/gaptempdirX7Qsal/")
AsCythonFunction( [ [ "x", "y" ], [ "z" ] ], [ "f", "g" ], [ "x*y", "Sin(z)" ] );;
# e.g.,
# cd /tmp/gaptempdirI6rq3l/
#
# start python!
#
# from cython_functions import f, g;
#
# # w = [ 2 entries :) ]
#
# # f(w)
#! @EndExample
4 changes: 2 additions & 2 deletions gap/Tools.gi
Original file line number Diff line number Diff line change
Expand Up @@ -690,8 +690,8 @@ InstallMethod( AsCythonFunction,

fi;

Print(
Concatenation( "cd ", Filename( dir, "" ), "\n\n" ),
return
Concatenation( "cd ", Filename( dir, "" ), "\n\n",
"start python!\n\n",
"from cython_functions import ",
JoinStringsWithSeparator( function_names, ", " ),
Expand Down