Feature #1470
Get indexed indets from a polyring
Description
Make a class so that indexed indets from a polyring can be used with their "natural" indexes (rather than, say, c++ vector indexes).
PolyRing P = NewPolyRing(RingQQ(), SymbolRange("x",1,4)); IndexedIndet x(P,"x"); cout << x(3) << endl; // prints x[3]
Note that square brackets can be overloaded, but only with a single arg.
Round brackets can be overloaded with several args -- I suggest overloads for 1,2,3 long
and vector<long>
Related issues
History
#1 Updated by John Abbott about 4 years ago
- Related to Feature #1469: Get indexed indets from a polyring added
#2 Updated by John Abbott about 4 years ago
- Description updated (diff)
As usual, indexes should be of type long
(no need for BigInt
).
It seems reasonable to allow a "short-cut" for up to 3 indexes; certainly 1 and 2, but why not 3 as well?
Probably not worth overloading operator[]
; it might be confusing to a C++ reader (who would think of a vector),
and it works only for 1 index, while operator()
can be made more flexible.
#3 Updated by John Abbott 4 months ago
- Target version changed from CoCoALib-0.99850 to CoCoALib-0.99900