Macaulay2 Engine
Loading...
Searching...
No Matches

◆ rawSchurFromPartition()

const RingElement * rawSchurFromPartition ( const Ring * R,
M2_arrayint part )

Definition at line 988 of file ringelement.cpp.

990{
991 // R should be a SchurRing2
992 // part should be a partition: a weakly descending list of integers (for now,
993 // non-negative)
994 // if R has a limit on the size of partitions, then
995 try
996 {
997 const SchurRing2 *S = R->cast_to_SchurRing2();
998 if (S == nullptr)
999 {
1000 ERROR("expected a Schur ring");
1001 return nullptr;
1002 }
1003 // Check that part is a partition, and that the number of parts is <=
1004 // number allowed
1005 if (!S->is_valid_partition(part)) return nullptr;
1006 ring_elem result = S->from_partition(part);
1007 return RingElement::make_raw(S, result);
1008 } catch (const exc::engine_error& e)
1009 {
1010 ERROR(e.what());
1011 return nullptr;
1012 }
1013}
virtual const SchurRing2 * cast_to_SchurRing2() const
Definition ring.hpp:277
static RingElement * make_raw(const Ring *R, ring_elem f)
Definition relem.cpp:20
bool is_valid_partition(M2_arrayint part, bool set_error=true) const
Definition schur2.cpp:157
ring_elem from_partition(M2_arrayint part) const
Definition schur2.cpp:184
Refactored Schur (symmetric-function) ring whose elements are schur_poly sums of partitions over a co...
Definition schur2.hpp:152
const int ERROR
Definition m2-mem.cpp:55
VALGRIND_MAKE_MEM_DEFINED & result(result)

References Ring::cast_to_SchurRing2(), ERROR, SchurRing2::from_partition(), SchurRing2::is_valid_partition(), RingElement::make_raw(), and result().