Macaulay2 Engine
Loading...
Searching...
No Matches
VectorArithmetic Class Reference

Runtime dispatcher that hides the concrete coefficient ring behind a std::variant of ConcreteVectorArithmetic<Ring>* pointers. More...

#include <VectorArithmetic.hpp>

Public Member Functions

 VectorArithmetic (const Ring *R)
 ~VectorArithmetic ()
const Ringring () const
size_t size (const ElementArray &coeffs) const
ElementArray allocateElementArray (ComponentIndex nelems) const
 Create a coefficient vector with room for nelems coefficients.
ElementArray allocateElementArray () const
ElementArray copyElementArray (const ElementArray &sparse) const
void deallocateElementArray (ElementArray &coeffs) const
 Deallocate all the coefficients, and the array itself.
void fillDenseArray (ElementArray &dense, const ElementArray &coeffs, const Range< const int > &comps) const
 Linear Algebra /////.
void denseCancelFromSparse (ElementArray &dense, const ElementArray &coeffs, const Range< const int > &comps) const
void denseCancelFromSparse (ElementArray &dense, const ElementArray &coeffs, const Range< const int > &comps, ElementArray &result_multipler) const
int denseNextNonzero (ElementArray &dense, int first, int last) const
void denseToSparse (ElementArray &dense, ElementArray &coeffs, Range< int > &comps, int first, int last, MemoryBlock &monomialSpace) const
void denseToSparse (ElementArray &dense, ElementArray &coeffs, int *&comps, int first, int last) const
template<typename LockType>
void safeDenseToSparse (ElementArray &dense, ElementArray &coeffs, Range< int > &comps, int first, int last, MemoryBlock &monomialSpace, LockType &lock) const
void setZeroInRange (ElementArray &dense, int first, int last) const
void makeMonic (ElementArray &coeffs) const
template<class Container>
void appendToContainer (const ElementArray &coeffs, Container &c) const
 Translation //////////.
template<class Container>
ElementArray elementArrayFromContainer (const Container &c) const
template<class Container>
ElementArray elementArrayFromContainerOfLongs (const Container &c) const
template<class Container>
ElementArray elementArrayFromContainerOf_mpz_class (const Container &c) const
ring_elem ringElemFromElementArray (const ElementArray &coeffs, int index) const
std::ostream & displayElement (std::ostream &o, const ElementArray &v, int index) const
 (Debugging) Display /////
std::ostream & displayElementArray (std::ostream &o, const ElementArray &v) const
std::ostream & displayAsDenseArray (std::ostream &o, size_t len, const ElementArray &v, const Range< const int > &comps) const
long getNumAdditions () const
long to_modp_long (const ElementArray &coeffs, size_t loc) const
void pushBackOne (ElementArray &coeffs) const
 Append support /////.
void pushBackMinusOne (ElementArray &coeffs) const
void pushBackElement (ElementArray &coeffs, const ElementArray &take_from_here, size_t loc) const
void pushBackNegatedElement (ElementArray &coeffs, const ElementArray &take_from_here, size_t loc) const
void from_ring_elem (ElementArray &coeffs, ring_elem numer, ring_elem denom_not_used_except_QQ) const
const VectorArithmeticStatsstats () const

Private Types

using CVA_Type

Private Attributes

CVA_Type mConcreteVector

Detailed Description

Runtime dispatcher that hides the concrete coefficient ring behind a std::variant of ConcreteVectorArithmetic<Ring>* pointers.

Note
AI-generated documentation. Verify against the source before relying on it.

Constructed from a const Ring*: the ringID() switch picks the matching ConcreteVectorArithmetic<Ring> and stores it in the variant mConcreteVector. Every arithmetic call (pushBackOne, add, subtract, denseRowReduceByThis, ...) goes through std::visit, so callers get one polymorphic interface that is still resolved with a tight switch instead of a virtual call. The list of supported rings is exactly the variant alternatives below — adding a new coefficient ring means extending both the variant and the constructor switch.

Definition at line 665 of file VectorArithmetic.hpp.


The documentation for this class was generated from the following file: