Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[apps/KhiCAS] Update KhiCAS #19

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
with:
submodules: true
- run: make -C apps/KhiCAS cleanall
- run: make -C apps/KhiCAS src/lib/libmpfi.a
- run: make KhiCAS_rebuild
- run: ./tool/archive KhiCAS.tar KhiCAS
- uses: actions/upload-artifact@master
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,6 @@ apps/KhiCAS/src/gmp*/trialdivtab.h
*.pc
**/libtool
**/aclocal.m4
khiext/
khiext.tgz
*~
2 changes: 1 addition & 1 deletion apps/KhiCAS/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ To update KhiCAS, you have some things to do:
3. Copy the contents of the folder `khiext/apps/KhiCAS` to the folder `apps/KhiCAS`
4. Now, you have the new version of KhiCAS, but you have to apply some changes to the code.
5. Replace `inline bool iskeydown(int key){ return getkey(key | 0x80000000); }` by `inline bool iskeydown(int key);`
6. Add this code in the file `apps/KhiCAS/main.cpp`:
6. Add this code in the file `apps/KhiCAS/src/main.cpp`:

```cpp
bool iskeydown(int key) {
Expand Down
Binary file modified apps/KhiCAS/app.elf
Binary file not shown.
65 changes: 0 additions & 65 deletions apps/KhiCAS/buildDeps~

This file was deleted.

17 changes: 0 additions & 17 deletions apps/KhiCAS/buildGiac~

This file was deleted.

Empty file modified apps/KhiCAS/examples/bac11.xw
100755 → 100644
Empty file.
Empty file modified apps/KhiCAS/examples/bac12.xw
100755 → 100644
Empty file.
27 changes: 0 additions & 27 deletions apps/KhiCAS/src/giac-1.6.0/src/Makefile.numworks.n0110~

This file was deleted.

4 changes: 2 additions & 2 deletions apps/KhiCAS/src/giac-1.6.0/src/alg_ext.cc
Original file line number Diff line number Diff line change
Expand Up @@ -728,10 +728,10 @@ namespace giac {
if (!rootof_trylock()){
if (lvptr){
gen vexpr=r2e(v,vecteur(lvptr->begin()+1,lvptr->end()),contextptr);
symbolic_rootof_list()[vexpr]=gaa+k*gbb;
symbolic_rootof_list()[vexpr]=k*gaa+gbb;
}
else
symbolic_rootof_list()[v]=gaa+k*gbb;
symbolic_rootof_list()[v]=k*gaa+gbb;
rootof_unlock();
}
}
Expand Down
6 changes: 3 additions & 3 deletions apps/KhiCAS/src/giac-1.6.0/src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@
#define PACKAGE_NAME "giac"

/* Define to the full name and version of this package. */
#define PACKAGE_STRING "giac 1.7.0"
#define PACKAGE_STRING "giac 1.9.0"

/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "giac"
Expand All @@ -464,7 +464,7 @@
#define PACKAGE_URL ""

/* Define to the version of this package. */
#define PACKAGE_VERSION "1.7.0"
#define PACKAGE_VERSION "1.9.0"

/* Define if <inttypes.h> exists and defines unusable PRI* macros. */
/* #undef PRI_MACROS_BROKEN */
Expand Down Expand Up @@ -506,7 +506,7 @@
/* #undef USE_OPENGL32 */

/* Version number of package */
#define VERSION "1.7.0"
#define VERSION "1.9.0"

/* Define to 1 if the X Window System is missing or not being used. */
#define X_DISPLAY_MISSING 1
Expand Down
32 changes: 29 additions & 3 deletions apps/KhiCAS/src/giac-1.6.0/src/derive.cc
Original file line number Diff line number Diff line change
Expand Up @@ -808,6 +808,8 @@ namespace giac {
step_infolevel(contextptr)=savestep;
gprintf(step_extrema1,gettext("Derivative of %gen with respect to %gen is %gen\nSolving %gen with respect to %gen answer %gen"),makevecteur(arg,var,d,deq,var,s.type==_VECT?change_subtype(s,_SEQ__VECT):s),contextptr);
calc_mode(c,contextptr);
if (c==1 && s.type==_VECT)
s.subtype=0;
vecteur ls=lidnt(s);
for (int i=0;i<int(ls.size());++i){
if (ls[i]==var || (var.type==_VECT && equalposcomp(*var._VECTptr,ls[i])))
Expand Down Expand Up @@ -1110,10 +1112,30 @@ namespace giac {
tmp.insert(tmp.begin(),symbolic(at_ou,gen(res,_SEQ__VECT)));
return symbolic(at_and,gen(tmp,_SEQ__VECT));
}
void domain_auto_assume(const gen & f,const gen & x,GIAC_CONTEXT){
vecteur range;
find_range(x,range,contextptr);
if (range.size()>=1 && range.front().type==_VECT){
range=*range.front()._VECTptr;
if (range.size()==2 && range[0]==minus_inf && range[1]==plus_inf){
gen periode;
if (is_periodic(f,x,periode,contextptr)){
gen hyp=symb_and(symbolic(at_superieur_egal,makesequence(x,0)),symbolic(at_inferieur_egal,makesequence(x,periode)));
*logptr(contextptr) << "Periodic function. Auto assume" << hyp << "\n";
giac_assume(hyp,contextptr);
}
}
}
}
gen _domain(const gen & args,GIAC_CONTEXT){
if (is_undef(args)) return args;
if (args.type!=_VECT || args.subtype!=_SEQ__VECT)
return domain(args,vx_var,0,contextptr);
if (args.type!=_VECT || args.subtype!=_SEQ__VECT){
gen xval=assumeeval(vx_var,contextptr);
domain_auto_assume(args,vx_var,contextptr);
gen res=domain(args,vx_var,0,contextptr);
restorepurge(xval,vx_var,contextptr);
return res;
}
vecteur v=*args._VECTptr;
if (v.size()<2)
return gensizeerr(contextptr);
Expand All @@ -1123,7 +1145,11 @@ namespace giac {
v.push_back(0);
if (v[2].type!=_INT_)
return gensizeerr(contextptr);
return domain(v[0],v[1],v[2].val,contextptr);
gen xval=assumeeval(vx_var,contextptr);
domain_auto_assume(v[0],v[1],contextptr);
gen res=domain(v[0],v[1],v[2].val,contextptr);
restorepurge(xval,vx_var,contextptr);
return res;
}
static const char _domain_s []="domain";
static define_unary_function_eval (__domain,&_domain,_domain_s);
Expand Down
27 changes: 21 additions & 6 deletions apps/KhiCAS/src/giac-1.6.0/src/dispatch.h
Original file line number Diff line number Diff line change
Expand Up @@ -476,10 +476,10 @@ namespace giac {
};

enum color_values {
#ifdef KHICAS
#if defined KHICAS || defined GIAC_HAS_STO_38
_BLACK=0,
_RED=0xf800,
_GREEN=0x0400,
_GREEN=0x07e0,
_YELLOW=0xffe0,
_BLUE=0x001f,
_MAGENTA=0xf81f,
Expand All @@ -488,18 +488,21 @@ namespace giac {
#else // KHICAS
#ifdef GIAC_HAS_STO_38
_WHITE=0,
_RED=0xff0000,
_GREEN=0xff00,
_YELLOW=0xffff00,
_BLUE=0xff,
_MAGENTA=0xff00ff,
_CYAN=0xffff,
_BLACK=7,
#else
_BLACK=0,
#endif
_RED=1,
_GREEN=2,
_YELLOW=3,
_BLUE=4,
_MAGENTA=5,
_CYAN=6,
#ifdef GIAC_HAS_STO_38
_BLACK=7,
#else
_WHITE=7,
#endif
#endif // KHICAS
Expand Down Expand Up @@ -618,6 +621,18 @@ namespace giac {
_GT_ACYCLIC = 159, // acyclic
_KDE_BANDWIDTH = 160, // bandwidth
_KDE_BINS = 161, // bins
_NLP_METHOD = 162,
_NLP_TOLERANCE = 163,
_NLP_VERBOSE = 164,
_ANN_HALF_MSE = 165, // MSE
_ANN_CROSS_ENTROPY = 166, // cross_entropy
_ANN_LOG_LOSS = 167, // log_loss
_ANN_BLOCK_SIZE = 168, // block_size
_ANN_MOMENTUM = 169, // momentum
_ANN_TOPOLOGY = 170, // topology
_ANN_LEARNING_RATE = 171, // learning_rate
_ANN_WEIGHT_DECAY = 172, // weight_decay
_ANN_RELU = 173, // ReLU
};

enum mupad_operator {
Expand Down
Loading