[Ipopt-tickets] [Ipopt] #83: Compiler error in IpTripletToCSRConverter.cpp using MinGW g++ 4.3.0
Ipopt
coin-trac at coin-or.org
Tue Oct 7 15:18:14 EDT 2008
#83: Compiler error in IpTripletToCSRConverter.cpp using MinGW g++ 4.3.0
------------------------------+---------------------------------------------
Reporter: guest | Owner: ipopt-team
Type: defect | Status: new
Priority: normal | Component: Ipopt
Version: 3.5 (C++ Version) | Severity: normal
Keywords: |
------------------------------+---------------------------------------------
When compiling IpTripletToCSRConverter.cpp in the
Algorithm/LinearSolvers directory, I get the following error message:
{{{
IpTripletToCSRConverter.cpp:63: instantiated from here
IpTripletToCSRConverter.hpp:105: error: 'void
Ipopt::TripletToCSRConverter::TripletEntry::operator=(const
Ipopt::TripletToCSRConverter::TripletEntry&)' is private
}}}
-----
This is the failing code line in IpTripletToCSRConverter.cpp:
{{{
std::list<TripletEntry> entry_list(nonzeros);
}}}
The TripletEntry assignment operator is declared private in
IpTripletToCSRConverter.hpp. I notice in the code there is a public
dummy copy constructor for the inner class TripletEntry, and I assume
that this copy constructor is defined to make the TripletEntry list
construction possible. But it seems like the std::list implementation in
GCC 4.3.0 uses the assignment operator, hence the compilation failure.
(I have not verified this, but it seems plausible to me.)
From what I can tell, the TripletEntry class is local to the
TripletToCSRConverter class, and the data members in TripletEntry are
simple integers (typedef int Index). Then, would it not be OK to let the
compiler implicitly define both the copy constructor and the assignment
operator? That is, remove the definition "TripletEntry(const
TripletEntry&)" and the declaration "void operator=(const
TripletEntry&)" from the TripletEntry class? With these modifications,
the code compiles flawlessly, and the optimizer seems to run as
intended.
/ Anders Gustafsson (anders dot 9ustafsson at gmail dot com)
--
Ticket URL: <https://projects.coin-or.org/Ipopt/ticket/83>
Ipopt <http://projects.coin-or.org/Ipopt>
Interior-point optimizer for nonlinear programs.
More information about the Ipopt-tickets
mailing list