-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmaple.h
139 lines (129 loc) · 6.21 KB
/
maple.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
// -*- mode:C++ ; compile-command: "g++ -I.. -g -c maple.cc" -*-
/*
* Copyright (C) 2000,2014 B. Parisse, Institut Fourier, 38402 St Martin d'Heres
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _GIAC_MAPLE_H
#define _GIAC_MAPLE_H
#include "first.h"
#ifndef NO_NAMESPACE_GIAC
namespace giac {
#endif // ndef NO_NAMESPACE_GIAC
class gen;
struct cpureal_t {
double cpu;
double real;
};
inline std::ostream & operator << (std::ostream & os,const cpureal_t & cr){ return os << "[" << cr.cpu << "," << cr.real << "]"; }
inline cpureal_t operator -(const cpureal_t & t1,const cpureal_t & t2){ cpureal_t ans={std::floor(1e6*(t1.cpu-t2.cpu)+.5)*1e-6,std::floor(1e6*(t1.real-t2.real)+.5)*1e-6}; return ans;}
double realtime(); // since 2021
cpureal_t clock_realtime();
gen _about(const gen & g,GIAC_CONTEXT);
gen _zip(const gen & args,GIAC_CONTEXT);
extern const unary_function_ptr * const at_zip ;
gen _accumulate_head_tail(const gen & args,GIAC_CONTEXT);
gen _divide(const gen & g,GIAC_CONTEXT);
gen _ratnormal(const gen & g,GIAC_CONTEXT);
gen _about(const gen & g,GIAC_CONTEXT);
gen _inverse(const gen & a_orig,GIAC_CONTEXT);
gen _Inverse(const gen & g,GIAC_CONTEXT);
gen _igcdex(const gen & a_orig,GIAC_CONTEXT);
gen _gcdex(const gen & a_orig,GIAC_CONTEXT);
extern const unary_function_ptr * const at_revlist ;
extern const unary_function_ptr * const at_reverse ;
gen _revlist(const gen & a,GIAC_CONTEXT);
gen _restart(const gen & args,GIAC_CONTEXT);
gen _restart_modes(const gen & args,GIAC_CONTEXT);
gen _time(const gen & a,GIAC_CONTEXT);
gen _cat(const gen & a_orig,GIAC_CONTEXT);
gen _pivot(const gen & a_orig,GIAC_CONTEXT);
gen _rowspace(const gen & g,GIAC_CONTEXT);
gen _colspace(const gen & g,GIAC_CONTEXT);
gen _copy(const gen & g,GIAC_CONTEXT);
gen _row(const gen & g,GIAC_CONTEXT);
extern const unary_function_ptr * const at_row ;
gen _col(const gen & g,GIAC_CONTEXT);
extern const unary_function_ptr * const at_col ;
gen _count(const gen & args,const context * contextptr);
gen _count_eq(const gen & args,const context * contextptr);
gen _count_sup(const gen & args,GIAC_CONTEXT);
gen _count_inf(const gen & args,GIAC_CONTEXT);
gen _trunc(const gen & args,GIAC_CONTEXT);
gen _evalc(const gen & g,GIAC_CONTEXT);
gen _open(const gen & g,GIAC_CONTEXT);
gen _fopen(const gen & g,GIAC_CONTEXT);
gen _fprint(const gen & g,GIAC_CONTEXT);
gen _close(const gen & g,GIAC_CONTEXT);
gen _blockmatrix(const gen & g,GIAC_CONTEXT);
gen _delcols(const gen & g,GIAC_CONTEXT);
gen _delrows(const gen & g,GIAC_CONTEXT);
gen _JordanBlock(const gen & g,GIAC_CONTEXT);
gen _companion(const gen & g,GIAC_CONTEXT);
gen _border(const gen & g,GIAC_CONTEXT);
gen _pade(const gen & g,GIAC_CONTEXT);
gen _lhs(const gen & g,GIAC_CONTEXT);
gen _rhs(const gen & g,GIAC_CONTEXT);
gen _reverse_rsolve(const gen & g,GIAC_CONTEXT);
gen fft(const gen & g_orig,int direct,GIAC_CONTEXT);
gen _fft(const gen & g,GIAC_CONTEXT);
gen _ifft(const gen & g,GIAC_CONTEXT);
gen _Resultant(const gen & g,GIAC_CONTEXT);
gen _Nullspace(const gen & g,GIAC_CONTEXT);
gen _assign(const gen & g,GIAC_CONTEXT);
gen _implicitplot3d(const gen & g,GIAC_CONTEXT);
//gen _readwav(const gen & g,GIAC_CONTEXT);
//gen _writewav(const gen & g,GIAC_CONTEXT);
gen _animate(const gen & g,GIAC_CONTEXT);
gen _animate3d(const gen & g,GIAC_CONTEXT);
gen _even(const gen & g,GIAC_CONTEXT);
gen _odd(const gen & g,GIAC_CONTEXT);
gen _writergb(const gen & g,GIAC_CONTEXT);
gen _readrgb(const gen & g,GIAC_CONTEXT);
gen _interp(const gen &g,GIAC_CONTEXT); // addition by L.Marohnić
int write_png(const char *file_name, void *rows, int w, int h, int colortype, int bitdepth);
extern bool (* readrgb_ptr)(const std::string & s,int W,int H,gen & res);
gen linear_apply(const gen & e,const gen & x,const gen & l,gen & remains, GIAC_CONTEXT, gen (* f)(const gen &,const gen &,const gen &,gen &,const context *));
// product(P,n=a..b) where the first variable in v is n
gen product(const polynome & P,const vecteur & v,const gen & n,const gen & a,const gen & b,GIAC_CONTEXT);
// discrete product primitive of a polynomial P
gen product(const polynome & P,const vecteur & v,const gen & n,gen & remains,GIAC_CONTEXT);
gen _seqsolve(const gen & args,GIAC_CONTEXT);
gen _rsolve(const gen & args,GIAC_CONTEXT);
gen _array(const gen & g,GIAC_CONTEXT);
gen _makemod(const gen & args,GIAC_CONTEXT);
gen _hexprint(const gen & g,GIAC_CONTEXT);
gen _octprint(const gen & g,GIAC_CONTEXT);
gen _binprint(const gen & g,GIAC_CONTEXT);
std::string cprint(const gen & args,const gen & name,GIAC_CONTEXT);
std::string cprint(const gen & args,GIAC_CONTEXT);
gen cpp_convert_0(const gen &g,GIAC_CONTEXT);
longlong cpp_convert_2(const gen & g,GIAC_CONTEXT);
double cpp_convert_1(const gen & g,GIAC_CONTEXT);
std::complex<double> cpp_convert_4(const gen & g,GIAC_CONTEXT);
vecteur cpp_convert_7(const gen & g,GIAC_CONTEXT);
std::string cpp_convert_12(const gen & g,GIAC_CONTEXT);
extern const unary_function_ptr * const at_accumulate_head_tail ;
extern const unary_function_ptr * const at_gcdex ;
extern const unary_function_ptr * const at_seqsolve ;
extern const unary_function_ptr * const at_array ;
extern const unary_function_ptr * const at_test_alias ;
extern const unary_function_ptr * const at_binprint ;
extern const unary_function_ptr * const at_count;
extern const unary_function_ptr * const at_time;
extern const unary_function_ptr * const at_interp; // addition by L.Marohnić
#ifndef NO_NAMESPACE_GIAC
} // namespace giac
#endif // ndef NO_NAMESPACE_GIAC
#endif // _GIAC_MAPLE_H