Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various naming convention changes in the engine #2769

Merged
merged 6 commits into from
Feb 10, 2023

Conversation

mahrud
Copy link
Member

@mahrud mahrud commented Feb 7, 2023

This PR is mostly just renames throughout the code, which unfortunately touch a lot of files:

  • replaced (int *) with monomial, exponents_t, or const_varpower
  • combined to/from_ntuple, to/from_expvector, and to/from_exponent_vector
  • renamed ntuple:: to exponents::
  • renamed Monomial to EngineMonomial

I decided to keep this PR small, so the new gc_vector<T> type and the templated ExponentList<T> type will be in the next PR, hopefully by then we have a better name for it.

@mahrud mahrud changed the title Combine varpower types with templated ExponentList type Replaced intarray with gc_vector<int> + various renames Feb 7, 2023
@mahrud mahrud changed the title Replaced intarray with gc_vector<int> + various renames Replace intarray with gc_vector<int>, combine varpower types + various renames Feb 7, 2023
@mahrud mahrud changed the title Replace intarray with gc_vector<int>, combine varpower types + various renames Various naming convention changes in the engine Feb 7, 2023
Copy link
Member

@mikestillman mikestillman left a comment

Choose a reason for hiding this comment

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

@mahrud Thanks for teasing out the different kinds of monomials! I left a few comments, but will plan on merging this pull request after you take a look.

M2/Macaulay2/e/ExponentVector.hpp Outdated Show resolved Hide resolved
M2/Macaulay2/e/gbweight.hpp Outdated Show resolved Hide resolved
M2/Macaulay2/e/matrix.cpp Outdated Show resolved Hide resolved
const FreeModule *F,
vec &vmonom) const;
int moneq(const int *exp, int *m, const int *vars, int *exp2) const;
// vec strip_vector(vec &f,
Copy link
Member

Choose a reason for hiding this comment

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

I guess this means these 2 functions are not used any more...

Copy link
Member Author

Choose a reason for hiding this comment

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

I somehow have no recollection of commenting this out, but yes you're right.

M2/Macaulay2/e/matrix.hpp Show resolved Hide resolved

int * ints() { return val.raw(); }
const int * ints() const { return val.raw(); }
Copy link
Member

Choose a reason for hiding this comment

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

I think the underlying representation is a const_varpower inside a std::vector?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't want to touch this line here because the next PR changes it, but yes, I think you're right.

@@ -427,7 +427,8 @@ MutableMatrix* ResF4toM2Interface::to_M2_MutableMatrix(SchreyerFrame& C,
Nterm** comps = newarray(Nterm*, nrows);
Nterm** last = newarray(Nterm*, nrows);

int* m1 = M->make_one();
monomial m1 = M->make_one();
// FIXME: is exp a monomial or exponent vector?
Copy link
Member

Choose a reason for hiding this comment

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

It appears to be an exponent vector. I'm not sure why the length is nvars + 1... Probably it doesn't need to be larger than nvars.

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree, but maybe I'll leave this for you and Frank to resolve because a few lines down the to_expvector function

C.ring().monoid().to_expvector(w, exp, comp);

Calls a method of ResMonoidDense in schreyer-resolution/res-moninfo-dense.hpp.

M2/Macaulay2/packages/Normaliz.m2 Show resolved Hide resolved
M2/Macaulay2/packages/Normaliz.m2 Show resolved Hide resolved
@@ -15,51 +15,6 @@ typedef ntuple_monomials::Exponent ntuple_word;
typedef ntuple_word *ntuple_monomial;
typedef const ntuple_word *const_ntuple_monomial;

template <>
Copy link
Member

Choose a reason for hiding this comment

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

I take it the code in this file was removed as it was not used, or is no longer used?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure if it was used (I suspect not), but they are all still covered by the template specialization, so you can still use them just as before.

@mikestillman
Copy link
Member

@mahrud After you make the changes you mention, I'll merge it. Let me know when it is ready.

@mahrud
Copy link
Member Author

mahrud commented Feb 9, 2023

@mahrud After you make the changes you mention, I'll merge it. Let me know when it is ready.

Once the tests pass I believe this is ready. For merging, try switching to "Rebase and merge".

@mikestillman mikestillman merged commit 8dce741 into Macaulay2:development Feb 10, 2023
@mahrud mahrud deleted the refactor/engine branch February 10, 2023 14:43
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