|
D.4.4.3 oneDimBelongSemigroup
Procedure from library cisimplicial.lib (see cisimplicial_lib).
- Usage:
- oneDimBelongSemigroup(n,v[,m]); v is an integral vector,
n is a positive integer[, m is a positive integer].
- Return:
- counters, a vector with nonnegative entries such that
v*counters = n. If it does not exist such a vector, it returns 0.
If a third parameter m is introduced, it will only consider the
first m entries of v.
- Assume:
- v is an integral vector with positive entries.
Example:
| LIB "cisimplicial.lib";
int a = 95;
intvec v = 18,51,13;
oneDimBelongSemigroup(a,v);
==> 1,1,2
"// 95 = 1*18 + 1*25 + 2*13";
==> // 95 = 1*18 + 1*25 + 2*13
oneDimBelongSemigroup(a,v,2);
==> 0
"// 95 is not a combination of 18 and 52;";
==> // 95 is not a combination of 18 and 52;
|
|