本文整理汇总了C++中FreeModule::append方法的典型用法代码示例。如果您正苦于以下问题:C++ FreeModule::append方法的具体用法?C++ FreeModule::append怎么用?C++ FreeModule::append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FreeModule
的用法示例。
在下文中一共展示了FreeModule::append方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ERROR
FreeModule *FreeModule::make_schreyer(const GBMatrix *m)
{
const FreeModule *F = m->get_free_module();
const PolynomialRing *R = F->get_ring()->cast_to_PolynomialRing();
if (R == 0)
{
ERROR("expected a polynomial ring");
return nullptr;
}
FreeModule *G = R->make_FreeModule();
int rk = INTSIZE(m->elems);
if (rk == 0) return G;
for (int i=0; i<rk; i++)
{
int *deg = R->degree_monoid()->make_one();
gbvector * v = m->elems[i];
if (v != 0)
R->get_gb_ring()->gbvector_multidegree(F, v, deg);
G->append(deg);
}
G->schreyer = SchreyerOrder::create(m);
return G;
}
示例2: get_ring
FreeModule *FreeModule::exterior(int pp) const
// p th exterior power
{
FreeModule *result;
if (pp == 0)
return get_ring()->make_FreeModule(1);
else
result = new_free();
int rk = rank();
if (pp > rk || pp < 0) return result;
size_t p = static_cast<size_t>(pp);
Subset a(p, 0);
for (size_t i=0; i<p; i++) a[i] = i;
int *deg = degree_monoid()->make_one();
do
{
degree_monoid()->one(deg);
for (size_t r=0; r<p; r++)
degree_monoid()->mult(deg, degree(static_cast<int>(a[r])), deg);
result->append(deg);
}
while (Subsets::increment(rk, a));
degree_monoid()->remove(deg);
if (schreyer != NULL)
result->schreyer = schreyer->exterior(pp);
return result;
}
示例3:
FreeModule *FreeModule::transpose() const
{
FreeModule *result = new_free();
int *deg = degree_monoid()->make_one();
for (int i=0; i<rank(); i++)
{
degree_monoid()->power(degree(i), -1, deg);
result->append(deg);
}
// result has no schreyer order
degree_monoid()->remove(deg);
return result;
}
示例4:
FreeModule *FreeModule::make_schreyer(const Matrix *m)
{
int i;
const Ring *R = m->get_ring();
FreeModule *F = R->make_FreeModule();
int rk = m->n_cols();
if (rk == 0) return F;
for (i=0; i<rk; i++)
F->append(m->cols()->degree(i));
F->schreyer = SchreyerOrder::create(m);
return F;
}
示例5: get_ring
FreeModule *FreeModule::exterior(int p) const
// p th exterior power
{
FreeModule *result;
int rk = rank();
if (p == 0)
return get_ring()->make_FreeModule(1);
else
result = new_free();
if (p > rk || p < 0) return result;
int *a = newarray_atomic(int,p);
for (int i=0; i<p; i++)
a[i] = i;
int *deg = degree_monoid()->make_one();
do
{
degree_monoid()->one(deg);
for (int r=0; r<p; r++)
degree_monoid()->mult(deg, degree(a[r]), deg);
result->append(deg);
}
while (comb::increment(p, rk, a));
degree_monoid()->remove(deg);
deletearray(a);
if (schreyer != NULL)
result->schreyer = schreyer->exterior(p);
return result;
}