Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Bizarre problem while building software with OGDF

14 views
Skip to first unread message

Bill Ford

unread,
Jun 15, 2022, 7:23:05 PM6/15/22
to ogdf
I have been using OGDF for a large discrete math package I have worked on for a number of years. I have never had any problems until now. I am using OGDF and the number theory software NTL in building of my software using CodeLite. I get error messages such as this:

/usr/local/include/ogdf/basic/Reverse.h:55:15: error: no type named 'const_reverse_iterator' in 'class NTL::GF2EX'
55 | using iterator = typename std::conditional<std::is_const<T>::value,
| ^~~~~~~~
/home/parallels/DiscreteMathCalculatorProject/src/DiscreteMathCalculatorMain.cpp: In member function 'void DiscreteMathCalculatorFrame::OnGF2EXReverseButtonPressed(wxCommandEvent&)':
/home/parallels/DiscreteMathCalculatorProject/src/DiscreteMathCalculatorMain.cpp:10063:44: error: no match for 'operator=' (operand types are 'NTL::GF2EX' and 'ogdf::Reverse<NTL::GF2EX>')
10063 | polyresult = reverse (polya);

NTL uses GF2EX that includes routines for modular polynomial arithmetic, modular composition, minimal and characteristic polynomials, and interpolation. OGDF uses neither NTL or GF2EX. I am stumped. Do have any idea what can cause an error like this?

Thanks.

Dagobert Smart

unread,
Jun 16, 2022, 6:10:29 AM6/16/22
to ogdf

Hello Bill,

you are using the OGDF function reverse() with polya as a parameter, where polya seems to have the type NTL::GF2EX.
The first question you should ask yourself is whether you wanted to use a non-OGDF function that is also called reverse().

If yes, make sure to use the correct namespace for reverse(), e.g. NTL::reverse or something similar. It’s also possible you actually wanted polya.reverse().

If no, be aware that ogdf::reverse() does not actually reverse a container. Instead, it is used to iterate over containers in reverse (and for that purpose the container needs to implement reverse_iterator or const_reverse_iterator depending on its const-ness).
The code looks like you want to reverse the container, so ogdf::reverse() is probably not what you want.

Best regards,
Dagobert

Reply all
Reply to author
Forward
0 new messages