Skip to content

Document ARing headers and implementation guide#61

Draft
andrew-tawfeek wants to merge 6 commits into
MichaelABurr:aringsfrom
andrew-tawfeek:aring-documentation
Draft

Document ARing headers and implementation guide#61
andrew-tawfeek wants to merge 6 commits into
MichaelABurr:aringsfrom
andrew-tawfeek:aring-documentation

Conversation

@andrew-tawfeek

Copy link
Copy Markdown
Collaborator

Summary

  • Add top-of-file documentation to ARing headers in basic-rings.
  • Add basic-rings/arings.md with guidance for implementing new ARing types.

Validation

  • git diff --check origin/arings..HEAD

Notes

  • Documentation-only changes.

Comment thread M2/Macaulay2/e/basic-rings/aring.hpp
@MichaelABurr

Copy link
Copy Markdown
Owner

I'm not sure that the header AI summaries correctly describe the big picture (i.e., how these elements are used). There's a lot of discussion of how these relate to concrete rings, but this connection doesn't seem to be as strong as promised by the AI.

@MichaelABurr

Copy link
Copy Markdown
Owner

The headers are not uniform in how they interpret these files (even though they all act in nearly the same way). Perhaps the best headers can be cherry-picked from this collection.

M2_arrayint getModPolynomialCoeffs() const;
M2_arrayint getGeneratorCoeffs() const;
M2_arrayint fieldElementToM2Array(ElementType a) const;
```

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this list important? What is the theme between these elements.?

@andrew-tawfeek

Copy link
Copy Markdown
Collaborator Author

Thanks, Michael. I pushed 98345765fc to address these comments.

I revised the ARing header summaries to use a more uniform structure: what storage/backend the ARing owns, what lifetime contract it follows, what aring-glue.hpp forwards through ConcreteRing, and where aring-translate.hpp or other integration code uses specialized hooks.

I also updated arings.md around the finite-field/extension-field hook list to explain the theme of that list: field presentation and representation, such as distinguished generators, discrete logs, quotient-ring lifts, and integer representatives, rather than just arithmetic.

This is still documentation-only. Validation: git diff --check origin/arings -- M2/Macaulay2/e/basic-rings.

Comment thread M2/Macaulay2/e/basic-rings/aring-CC.hpp
/// fields. Elements are compact integers interpreted through logarithm and
/// exponent tables for a primitive element, and the class follows the
/// `SimpleARing` contract for lifetime and arithmetic over that storage.
///

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The point is that there is a contract that does involve lifetime. If this is mentioned elsewhere, there should be a pointer directly to it.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Function names changed due to recent push by Doug
  • Add commments in the code chunks
  • Add examples under the quick checklist

results, construction from ZZ/QQ, predicates, comparison, hashing, core
arithmetic, printing, random elements, and evaluation.

Wire the ring into build files and factory code.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specify what "factory code" refers too -- be more precise rather than sweeping generalizations

`ConcreteRing` is the adapter for the usual ARing path. It receives a
`ring_elem` from the rest of the engine, asks the ARing to unpack it into the
ARing's `ElementType`, calls the ARing operation, and asks the ARing to pack the
result back into a `ring_elem`. Some hooks are used by factory, translation,

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Be more precise on this "factory"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants