Skip to content

Commit 75136be

Browse files
authored
Merge pull request #420 from MethodicalAcceleratorDesign/dev
Sync master with dev for release 0.9.8
2 parents a06df86 + 97e63e7 commit 75136be

24 files changed

+382
-238
lines changed

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@ Methodical Accelerator Design
55
===
66

77
____ __ ______ ______ | Methodical Accelerator Design
8-
/ \/ \ / _ \ / _ \ | release: 0.9.6 (OSX 64)
8+
/ \/ \ / _ \ / _ \ | release: 0.9.8_P (Linux 64)
99
/ __ / / /_/ / / /_/ / | support: http://cern.ch/mad
1010
/__/ /_/ /__/ /_/ /_____ / | licence: GPL3 (C) CERN 2016+
11-
| started: 2021-11-12 18:51:12
11+
| started: 2023-12-04 18:51:12
1212

1313
The successor of MAD-X.
14+
15+
16+
17+
<a href="https://zenodo.org/doi/10.5281/zenodo.7428893"><img src="https://zenodo.org/badge/37848936.svg" alt="DOI"></a>

src/mad_ctpsa.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ ord_t mad_ctpsa_ordn (ssz_t n, const ctpsa_t *t[]); // max order of all
6464

6565
// initialization
6666
void mad_ctpsa_copy (const ctpsa_t *t, ctpsa_t *r);
67-
void mad_ctpsa_sclord (const ctpsa_t *t, ctpsa_t *r, log_t inv); // t[i]*o[i]
67+
void mad_ctpsa_sclord (const ctpsa_t *t, ctpsa_t *r, log_t inv, log_t prm); // t[i]*o[i]
6868
void mad_ctpsa_getord (const ctpsa_t *t, ctpsa_t *r, ord_t ord);
6969
void mad_ctpsa_cutord (const ctpsa_t *t, ctpsa_t *r, int ord); // ord..mo = 0 or 0..-ord=0
7070
idx_t mad_ctpsa_maxord (const ctpsa_t *t, ssz_t n, idx_t idx_[]);
@@ -86,7 +86,7 @@ void mad_ctpsa_rect (const ctpsa_t *t, ctpsa_t *r);
8686
void mad_ctpsa_polar (const ctpsa_t *t, ctpsa_t *r);
8787

8888
// indexing / monomials (return idx_t = -1 if invalid)
89-
ord_t mad_ctpsa_mono (const ctpsa_t *t, idx_t i, ssz_t n, ord_t m_[]);
89+
ord_t mad_ctpsa_mono (const ctpsa_t *t, idx_t i, ssz_t n, ord_t m_[], ord_t *p_);
9090
idx_t mad_ctpsa_idxs (const ctpsa_t *t, ssz_t n, str_t s ); // string mono "[0-9]*"
9191
idx_t mad_ctpsa_idxm (const ctpsa_t *t, ssz_t n, const ord_t m []);
9292
idx_t mad_ctpsa_idxsm (const ctpsa_t *t, ssz_t n, const int m []); // sparse mono [(i,o)]

src/mad_ctpsa_conv.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,16 +149,17 @@ void mad_ctpsa_rect (const ctpsa_t *a, ctpsa_t *c)
149149
assert(a && c); DBGFUN(->); DBGTPSA(a); DBGTPSA(c);
150150
ensure(a->d == c->d, "incompatibles GTPSA (descriptors differ)");
151151

152-
tpsa_t *re = GET_TMPR(c), *im = GET_TMPR(c), *t = GET_TMPR(c);
152+
tpsa_t *re = GET_TMPR(c), *im = GET_TMPR(c),
153+
*st = GET_TMPR(c), *ct = GET_TMPR(c);
153154

154155
mad_ctpsa_real (a , re); // rho
155156
mad_ctpsa_imag (a , im); // arg
156-
mad_tpsa_sincos(im, im, t );
157-
mad_tpsa_mul (re, t , re); // re = rho * cos(arg)
158-
mad_tpsa_mul (re, im, im); // im = rho * sin(arg)
159-
mad_ctpsa_cplx (re, im, c );
157+
mad_tpsa_sincos(im, st, ct);
158+
mad_tpsa_mul (re, st, im); // im = rho * sin(arg)
159+
mad_tpsa_mul (re, ct, st); // re = rho * cos(arg)
160+
mad_ctpsa_cplx (st, im, c );
160161

161-
REL_TMPR(t); REL_TMPR(im); REL_TMPR(re);
162+
REL_TMPR(ct); REL_TMPR(st); REL_TMPR(im); REL_TMPR(re);
162163

163164
DBGTPSA(c); DBGFUN(<-);
164165
}

src/mad_desc.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,24 +298,29 @@ tbl_by_ord(D *d)
298298
d->tv2to = mad_malloc( d->nc * sizeof *d->tv2to );
299299
d->to2tv = mad_malloc( d->nc * sizeof *d->to2tv );
300300
d->ords = mad_malloc( d->nc * sizeof *d->ords );
301+
d->prms = mad_malloc( d->nc * sizeof *d->prms );
301302
d->ord2idx = mad_malloc((d->mo+2) * sizeof *d->ord2idx);
302303

303304
d->size += d->nc * sizeof *d->To;
304305
d->size += d->nc*2 * sizeof *d->tv2to; // tv2to + to2tv
305306
d->size += d->nc * sizeof *d->ords;
307+
d->size += d->nc * sizeof *d->prms;
306308
d->size += (d->mo+2) * sizeof *d->ord2idx;
307309

308310
cmp_d = d;
309311
for (idx_t i=0; i < d->nc; ++i) d->to2tv[i] = i;
310312
qsort(d->to2tv, d->nc, sizeof *d->to2tv, cmp_mono);
311313

312-
d->To[0] = d->monos, d->tv2to[0] = 0, d->ords[0] = 0, d->ord2idx[0] = 0;
314+
d->To[0] = d->monos;
315+
d->tv2to[0] = 0, d->ord2idx[0] = 0, d->ords[0] = d->prms[0] = 0;
313316

314317
for (idx_t i=1, j=0; i < d->nc; ++i) {
315318
d->tv2to[d->to2tv[i]] = i;
316319
d->To[i] = d->monos + d->to2tv[i]*d->nn;
317320
d->ords[i] = mad_mono_ord(d->nn, d->To[i]);
321+
d->prms[i] = mad_mono_ord(d->np, d->To[i]+d->nv);
318322
if (d->ords[i] > d->ords[i-1]) d->ord2idx[++j] = i;
323+
// printf("i=%d, o=%d, p=%d\n", i, d->ords[i], d->prms[i]);
319324
}
320325
d->ord2idx[d->mo+1] = d->nc;
321326

@@ -1115,12 +1120,13 @@ mad_desc_nxtbyord (const D *d, ssz_t n, ord_t m[n])
11151120
}
11161121

11171122
ord_t
1118-
mad_desc_mono (const D *d, idx_t i, ssz_t n, ord_t m_[n])
1123+
mad_desc_mono (const D *d, idx_t i, ssz_t n, ord_t m_[n], ord_t *p_)
11191124
{
11201125
DBGFUN(->);
11211126
assert(d);
11221127
ensure(0 <= i && i < d->nc, "index out of bounds");
11231128
if (m_ && n > 0) mad_mono_copy(MIN(n,d->nn), d->To[i], m_);
1129+
if (p_) *p_ = d->prms[i];
11241130
ord_t ret = d->ords[i];
11251131
DBGFUN(<-);
11261132
return ret;
@@ -1324,6 +1330,7 @@ mad_desc_del (const D *d_)
13241330
mad_free((void*)d->no);
13251331
mad_free(d->monos);
13261332
mad_free(d->ords);
1333+
mad_free(d->prms);
13271334
mad_free(d->To);
13281335
mad_free(d->Tv);
13291336
mad_free(d->ord2idx);

src/mad_desc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ idx_t mad_desc_idxm (const desc_t *d, ssz_t n, const ord_t m []);
7676
idx_t mad_desc_idxsm (const desc_t *d, ssz_t n, const idx_t m []); // sparse mono
7777
idx_t mad_desc_nxtbyvar (const desc_t *d, ssz_t n, ord_t m []);
7878
idx_t mad_desc_nxtbyord (const desc_t *d, ssz_t n, ord_t m []);
79-
ord_t mad_desc_mono (const desc_t *d, idx_t i, ssz_t n, ord_t m_[]);
79+
ord_t mad_desc_mono (const desc_t *d, idx_t i, ssz_t n, ord_t m_[], ord_t *p_);
8080

8181
// for debugging
8282
void mad_desc_info (const desc_t *d, FILE *fp_);

src/mad_desc_impl.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ struct desc_ { // warning: must be identical to LuaJIT def (see mad_gtpsa.mad)
5252

5353
ord_t *monos, // 'matrix' storing the monomials (sorted by var)
5454
*ords, // order of each mono of To
55+
*prms, // order of parameters in each mono of To (zero = no prms)
5556
**To, // Table by orders -- pointers to monos, sorted by order
5657
**Tv, // Table by vars -- pointers to monos, sorted by vars
5758
**ocs; // ocs[t,i] -> o; in mul, compute o on thread t; 3 <= o <= mo; terminated with 0

src/mad_mat.c

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -34,24 +34,18 @@
3434
#if 0
3535
#include <stdio.h>
3636

37-
static void __attribute__((unused))
37+
static inline void __attribute__((unused))
3838
mprint(str_t name, const num_t a[], ssz_t m, ssz_t n)
3939
{
4040
printf("%s[%dx%d]=\n", name, m, n);
41-
FOR(i,m) {
42-
FOR(j,n) printf("% -10.5f ", a[i*n+j]);
43-
printf("\n");
44-
}
41+
FOR(i,m) { FOR(j,n) printf("% -.5e ", a[i*n+j]); printf("\n"); }
4542
}
4643

47-
static void __attribute__((unused))
44+
static inline void __attribute__((unused))
4845
iprint(str_t name, const idx_t a[], ssz_t m, ssz_t n)
4946
{
5047
printf("%s[%dx%d]=\n", name, m, n);
51-
FOR(i,m) {
52-
FOR(j,n) printf("% 3d ", a[i*n+j]);
53-
printf("\n");
54-
}
48+
FOR(i,m) { FOR(j,n) printf("% 3d ", a[i*n+j]); printf("\n"); }
5549
}
5650
#endif
5751

@@ -1159,7 +1153,7 @@ mad_mat_pinvn (const num_t y[], num_t x, num_t r[], ssz_t m, ssz_t n, num_t rcon
11591153
mad_alloc_tmp(num_t, V, n*n);
11601154
mad_alloc_tmp(num_t, S, n*m); mad_vec_fill(0, S, n*m);
11611155

1162-
int rnk = 0;
1156+
int rank = 0;
11631157
int info = mad_mat_svd(y, U, s, V, m, n);
11641158
if (info != 0) goto finalize;
11651159

@@ -1172,7 +1166,7 @@ mad_mat_pinvn (const num_t y[], num_t x, num_t r[], ssz_t m, ssz_t n, num_t rcon
11721166

11731167
// Keep relevant singular values and reject ncond (smallest) singular values
11741168
FOR(i,k,mn)
1175-
if (mn-i >= ncond && s[i] >= rcond*s[k]) S[i*m+i] = (++rnk, 1/s[i]);
1169+
if (mn-i >= ncond && s[i] >= rcond*s[k]) S[i*m+i] = (++rank, 1/s[i]);
11761170
else break;
11771171

11781172
mad_mat_muld(V, S, r, n, m, n);
@@ -1186,7 +1180,7 @@ mad_mat_pinvn (const num_t y[], num_t x, num_t r[], ssz_t m, ssz_t n, num_t rcon
11861180
mad_free_tmp(V);
11871181
mad_free_tmp(S);
11881182

1189-
return rnk;
1183+
return rank;
11901184
}
11911185

11921186
int // without complex-by-value version
@@ -1198,10 +1192,10 @@ mad_mat_pinvc (const num_t y[], cpx_t x, cpx_t r[], ssz_t m, ssz_t n, num_t rcon
11981192
{
11991193
CHKYR; // compute x/Y[m x n]
12001194
mad_alloc_tmp(num_t, rr, m*n);
1201-
int info = mad_mat_pinvn(y, 1, rr, m, n, rcond, ncond);
1202-
if (!info) mad_vec_mulc(rr, x, r, m*n);
1195+
int rank = mad_mat_pinvn(y, 1, rr, m, n, rcond, ncond);
1196+
mad_vec_mulc(rr, x, r, m*n);
12031197
mad_free_tmp(rr);
1204-
return info;
1198+
return rank;
12051199
}
12061200

12071201
int
@@ -1222,7 +1216,7 @@ mad_cmat_pinvc (const cpx_t y[], cpx_t x, cpx_t r[], ssz_t m, ssz_t n, num_t rco
12221216
mad_alloc_tmp(cpx_t, V, n*n);
12231217
mad_alloc_tmp(num_t, S, n*m); mad_vec_fill(0, S, n*m);
12241218

1225-
int rnk = 0;
1219+
int rank = 0;
12261220
int info = mad_cmat_svd(y, U, s, V, m, n);
12271221
if (info != 0) goto finalize;
12281222

@@ -1235,7 +1229,7 @@ mad_cmat_pinvc (const cpx_t y[], cpx_t x, cpx_t r[], ssz_t m, ssz_t n, num_t rco
12351229

12361230
// Keep relevant singular values and reject ncond (smallest) singular values
12371231
FOR(i,k,mn)
1238-
if (mn-i >= ncond && s[i] >= rcond*s[k]) S[i*m+i] = (++rnk, 1/s[i]);
1232+
if (mn-i >= ncond && s[i] >= rcond*s[k]) S[i*m+i] = (++rank, 1/s[i]);
12391233
else break;
12401234

12411235
mad_cmat_muldm(V, S, r, n, m, n);
@@ -1249,7 +1243,7 @@ mad_cmat_pinvc (const cpx_t y[], cpx_t x, cpx_t r[], ssz_t m, ssz_t n, num_t rco
12491243
mad_free_tmp(V);
12501244
mad_free_tmp(S);
12511245

1252-
return rnk;
1246+
return rank;
12531247
}
12541248

12551249
// -- divide ------------------------------------------------------------------o
@@ -1534,12 +1528,20 @@ mad_cmat_solve (const cpx_t a[], const cpx_t b[], cpx_t x[], ssz_t m, ssz_t n, s
15341528
}
15351529

15361530
int
1537-
mad_mat_ssolve (const num_t a[], const num_t b[], num_t x[], ssz_t m, ssz_t n, ssz_t p, num_t rcond, num_t s_[])
1531+
mad_mat_ssolve (const num_t a[], const num_t b[], num_t x[], ssz_t m, ssz_t n, ssz_t p, num_t rcond, int ncond, num_t s_[])
15381532
{
15391533
assert( a && b && x );
15401534
int info=0;
15411535
const int nm=m, nn=n, np=p, mn=MAX(m,n);
15421536

1537+
if (ncond) {
1538+
mad_alloc_tmp(num_t, ai, m*n);
1539+
int rank = mad_mat_pinvn(a, 1, ai, m, n, rcond, ncond);
1540+
mad_mat_mul(ai, b, x, n, p, m);
1541+
mad_free_tmp(ai);
1542+
return rank;
1543+
}
1544+
15431545
num_t sz;
15441546
int lwork=-1, rank, isz;
15451547
mad_alloc_tmp(num_t, ta, m *n);
@@ -1569,12 +1571,20 @@ mad_mat_ssolve (const num_t a[], const num_t b[], num_t x[], ssz_t m, ssz_t n, s
15691571
}
15701572

15711573
int
1572-
mad_cmat_ssolve (const cpx_t a[], const cpx_t b[], cpx_t x[], ssz_t m, ssz_t n, ssz_t p, num_t rcond, num_t s_[])
1574+
mad_cmat_ssolve (const cpx_t a[], const cpx_t b[], cpx_t x[], ssz_t m, ssz_t n, ssz_t p, num_t rcond, int ncond, num_t s_[])
15731575
{
15741576
assert( a && b && x );
15751577
int info=0;
15761578
const int nm=m, nn=n, np=p, mn=MAX(m,n);
15771579

1580+
if (ncond) {
1581+
mad_alloc_tmp(cpx_t, ai, m*n);
1582+
int rank = mad_cmat_pinvc(a, 1, ai, m, n, rcond, ncond);
1583+
mad_cmat_mul(ai, b, x, n, p, m);
1584+
mad_free_tmp(ai);
1585+
return rank;
1586+
}
1587+
15781588
num_t rsz;
15791589
cpx_t sz;
15801590
int lwork=-1, rank, isz;

src/mad_mat.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ int mad_mat_div (const num_t x[], const num_t y[], num_t r[], ssz_t
5656
int mad_mat_divm (const num_t x[], const cpx_t y[], cpx_t r[], ssz_t m, ssz_t n, ssz_t p, num_t rcond); // mat / cmat
5757
int mad_mat_solve (const num_t a[], const num_t b[], num_t x[], ssz_t m, ssz_t n, ssz_t p, num_t rcond); // min|b-ax| (QR)
5858
int mad_mat_nsolve (const num_t a[], const num_t b[], num_t x[], ssz_t m, ssz_t n, ssz_t N, num_t rcond, num_t r_[]); // min|b-ax| (MICADO)
59-
int mad_mat_ssolve (const num_t a[], const num_t b[], num_t x[], ssz_t m, ssz_t n, ssz_t p, num_t rcond, num_t s_[]); // min|b-ax| (SVD)
59+
int mad_mat_ssolve (const num_t a[], const num_t b[], num_t x[], ssz_t m, ssz_t n, ssz_t p, num_t rcond, int ncond, num_t s_[]); // min|b-ax| (SVD)
6060
int mad_mat_gsolve (const num_t a[], const num_t b[], const num_t c[], const num_t d[],
6161
num_t x[], ssz_t m, ssz_t n, ssz_t p, num_t *nrm_);
6262
int mad_mat_gmsolve (const num_t a[], const num_t b[], const num_t d[],
@@ -99,7 +99,7 @@ int mad_cmat_pinvc_r (const cpx_t y[], num_t x_re,num_t x_im, cpx_t r[], ssz_t
9999
int mad_cmat_div (const cpx_t x[], const cpx_t y[], cpx_t r[], ssz_t m, ssz_t n, ssz_t p, num_t rcond); // cmat / cmat
100100
int mad_cmat_divm (const cpx_t x[], const num_t y[], cpx_t r[], ssz_t m, ssz_t n, ssz_t p, num_t rcond); // cmat / mat
101101
int mad_cmat_solve (const cpx_t a[], const cpx_t b[], cpx_t x[], ssz_t m, ssz_t n, ssz_t p, num_t rcond); // min|b-ax| (QR)
102-
int mad_cmat_ssolve (const cpx_t a[], const cpx_t b[], cpx_t x[], ssz_t m, ssz_t n, ssz_t p, num_t rcond, num_t s_[]); // min|b-ax| (SVD)
102+
int mad_cmat_ssolve (const cpx_t a[], const cpx_t b[], cpx_t x[], ssz_t m, ssz_t n, ssz_t p, num_t rcond, int ncond, num_t s_[]); // min|b-ax| (SVD)
103103
int mad_cmat_gsolve (const cpx_t a[], const cpx_t b[], const cpx_t c[], const cpx_t d[],
104104
cpx_t x[], ssz_t m, ssz_t n, ssz_t p, num_t *nrm_);
105105
int mad_cmat_gmsolve (const cpx_t a[], const cpx_t b[], const cpx_t d[],

src/mad_mono.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ mad_mono_ordpf (ssz_t n, const ord_t a[n], idx_t stp)
107107
return p;
108108
}
109109

110-
111110
log_t
112111
mad_mono_eq (ssz_t n, const ord_t a[n], const ord_t b[n])
113112
{

src/mad_tpsa.c

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -360,24 +360,27 @@ FUN(copy) (const T *t, T *r)
360360
}
361361

362362
void
363-
FUN(sclord) (const T *t, T *r, log_t inv)
363+
FUN(sclord) (const T *t, T *r, log_t inv, log_t prm)
364364
{
365365
assert(t && r); DBGFUN(->); DBGTPSA(t);
366366

367367
FUN(copy)(t,r);
368368

369369
// scale coefs
370370
const idx_t *o2i = r->d->ord2idx;
371+
const ord_t *po = r->d->prms;
372+
const int np = !prm;
371373
if (inv) {
372374
for (ord_t o = MAX(r->lo,2); o <= r->hi; ++o)
373375
if (mad_bit_tst(r->nz,o))
374-
for (idx_t i = o2i[o]; i < o2i[o+1]; ++i)
375-
r->coef[i] /= o; // scale coefs by 1/order
376+
for (idx_t i = o2i[o]; i < o2i[o+1]; ++i) {
377+
r->coef[i] /= o - po[i] * np; // scale coefs by 1/order
378+
}
376379
} else {
377380
for (ord_t o = MAX(r->lo,2); o <= r->hi; ++o)
378381
if (mad_bit_tst(r->nz,o))
379382
for (idx_t i = o2i[o]; i < o2i[o+1]; ++i)
380-
r->coef[i] *= o; // scale coefs by order
383+
r->coef[i] *= o - po[i] * np; // scale coefs by order
381384
}
382385

383386
DBGTPSA(r); DBGFUN(<-);
@@ -504,7 +507,7 @@ FUN(convert) (const T *t, T *r_, ssz_t n, idx_t t2r_[n], int pb)
504507
ord_t t_hi = MIN(t->hi, r->mo, t->d->to);
505508
for (idx_t ti = o2i[t->lo]; ti < o2i[t_hi+1]; ++ti) {
506509
if (t->coef[ti] == 0) goto skip;
507-
mad_desc_mono(t->d, ti, tn, tm); // get tm mono at index ti
510+
mad_desc_mono(t->d, ti, tn, tm, NULL); // get tm mono at index ti
508511
mad_mono_fill(rn, rm, 0);
509512
int sgn = 0;
510513
for (idx_t i = 0; i < tn; ++i) { // set rm mono
@@ -530,10 +533,10 @@ FUN(convert) (const T *t, T *r_, ssz_t n, idx_t t2r_[n], int pb)
530533
// --- indexing / monomials ---------------------------------------------------o
531534

532535
ord_t
533-
FUN(mono) (const T *t, idx_t i, ssz_t n, ord_t m_[n])
536+
FUN(mono) (const T *t, idx_t i, ssz_t n, ord_t m_[n], ord_t *p_)
534537
{
535538
assert(t); DBGTPSA(t);
536-
ord_t ret = mad_desc_mono(t->d, i, n, m_);
539+
ord_t ret = mad_desc_mono(t->d, i, n, m_, p_);
537540
DBGFUN(<-); return ret;
538541
}
539542

src/mad_tpsa.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ ord_t mad_tpsa_ordn (ssz_t n, const tpsa_t *t[]); // max order of all
6464

6565
// initialization
6666
void mad_tpsa_copy (const tpsa_t *t, tpsa_t *r);
67-
void mad_tpsa_sclord (const tpsa_t *t, tpsa_t *r, log_t inv); // t[i]*o[i]
67+
void mad_tpsa_sclord (const tpsa_t *t, tpsa_t *r, log_t inv, log_t prm); // t[i]*o[i]
6868
void mad_tpsa_getord (const tpsa_t *t, tpsa_t *r, ord_t ord);
6969
void mad_tpsa_cutord (const tpsa_t *t, tpsa_t *r, int ord); // ord..mo = 0 or 0..-ord=0
7070
idx_t mad_tpsa_maxord (const tpsa_t *t, ssz_t n, idx_t idx_[]);
@@ -76,7 +76,7 @@ void mad_tpsa_clear ( tpsa_t *t);
7676
log_t mad_tpsa_isnul (const tpsa_t *t);
7777

7878
// indexing / monomials (return idx_t = -1 if invalid)
79-
ord_t mad_tpsa_mono (const tpsa_t *t, idx_t i, ssz_t n, ord_t m_[]);
79+
ord_t mad_tpsa_mono (const tpsa_t *t, idx_t i, ssz_t n, ord_t m_[], ord_t *p_);
8080
idx_t mad_tpsa_idxs (const tpsa_t *t, ssz_t n, str_t s ); // string mono "[0-9]*"
8181
idx_t mad_tpsa_idxm (const tpsa_t *t, ssz_t n, const ord_t m []);
8282
idx_t mad_tpsa_idxsm (const tpsa_t *t, ssz_t n, const int m []); // sparse mono [(i,o)]

0 commit comments

Comments
 (0)