Macaulay2 Engine
Loading...
Searching...
No Matches
BasicPolyList.hpp File Reference

Ring-agnostic polynomial-list transport type plus its streaming collector and emitter. More...

#include "exceptions.hpp"
#include <stdexcept>
#include <string>
#include <vector>
#include <iostream>
#include "BasicPoly.hpp"
#include "PolynomialStream.hpp"

Go to the source code of this file.

Classes

class  BasicPolyListStreamCollector
 Streaming consumer that builds a BasicPolyList from per-term callbacks, matching the mathicgb / mgb stream interface. More...

Typedefs

using BasicPolyList = std::vector<BasicPoly>

Functions

long bytesUsed (const BasicPolyList &F)
template<typename S>
void toStream (const BasicPolyList &Fs, S &str)
const MatrixtoMatrix (const FreeModule *target, const BasicPolyList &Fs)
auto basicPolyListFromString (std::vector< std::string > varNames, std::string polyPerLine) -> BasicPolyList
auto basicPolyListFromFile (std::vector< std::string > varNames, std::string fileName) -> BasicPolyList

Detailed Description

Ring-agnostic polynomial-list transport type plus its streaming collector and emitter.

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

BasicPolyList is a std::vector<BasicPoly> that acts as the hub format between M2-side Matrix values, the F4 Groebner-basis engine in gb-f4/, file-format readers (msolve, raw text), and the BasicPolyListParser. The type carries no ring reference, which keeps each conversion as a single BasicPolyList-to-other transcript rather than every pair needing its own translator. Coefficient support currently inherits BasicPoly's mpz_class-only restriction; GF(p^n), QQ, fraction fields, and recursive polynomial coefficients are flagged TODOs in the in-source comment.

Two helpers wire BasicPolyList into the stream protocol from PolynomialStream.hpp: BasicPolyListStreamCollector is the consumer — it builds a BasicPolyList from a sequence of idealBegin / appendPolynomialBegin / term events; the template toStream<S>(Fs, str) is the dual producer — it walks a BasicPolyList and emits the same event sequence into any S. toMatrix(FreeModule*, BasicPolyList) composes toStream with a MatrixStream (matrix-stream.hpp) to produce an M2 Matrix. The free bytesUsed, basicPolyListFromString, and basicPolyListFromFile helpers round out the API.

See also
BasicPoly.hpp
PolynomialStream.hpp
BasicPolyListParser.hpp
matrix-stream.hpp

Definition in file BasicPolyList.hpp.