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

model.cc: error: no matching function for call to 'max(long int, __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type)' #4

Open
barracuda156 opened this issue Jul 7, 2023 · 0 comments

Comments

@barracuda156
Copy link

/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_ipx/ipx/work/compwrap/cxx/opt/local/bin/g++-mp-12 -std=c++11 -Wall -Wextra -Wno-sign-compare -I/opt/local/include  -O2 -fPIC -Iinclude -Isrc -Ithird_party -I/opt/local/include/basiclu -c src/sparse_matrix.cc -o build/sparse_matrix.o
src/model.cc: In member function 'void ipx::Model::FindDenseColumns()':
src/model.cc:44:35: error: no matching function for call to 'max(long int, __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type)'
   44 |         if (colcount[j] > std::max(40l, 10l*colcount[j-1])) {
      |                           ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /opt/local/include/gcc12/c++/vector:60,
                 from src/model.h:6,
                 from src/model.cc:3:
/opt/local/include/gcc12/c++/bits/stl_algobase.h:254:5: note: candidate: 'template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)'
  254 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/opt/local/include/gcc12/c++/bits/stl_algobase.h:254:5: note:   template argument deduction/substitution failed:
src/model.cc:44:35: note:   deduced conflicting types for parameter 'const _Tp' ('long int' and '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'})
   44 |         if (colcount[j] > std::max(40l, 10l*colcount[j-1])) {
      |                           ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/include/gcc12/c++/bits/stl_algobase.h:300:5: note: candidate: 'template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  300 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/opt/local/include/gcc12/c++/bits/stl_algobase.h:300:5: note:   template argument deduction/substitution failed:
src/model.cc:44:35: note:   deduced conflicting types for parameter 'const _Tp' ('long int' and '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'})
   44 |         if (colcount[j] > std::max(40l, 10l*colcount[j-1])) {
      |                           ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /opt/local/include/gcc12/c++/algorithm:61,
                 from /opt/local/include/gcc12/c++/valarray:38,
                 from src/ipx_internal.h:10,
                 from src/control.h:10,
                 from src/model.h:7:
/opt/local/include/gcc12/c++/bits/stl_algo.h:5746:5: note: candidate: 'template<class _Tp> _Tp std::max(initializer_list<_Tp>)'
 5746 |     max(initializer_list<_Tp> __l)
      |     ^~~
/opt/local/include/gcc12/c++/bits/stl_algo.h:5746:5: note:   template argument deduction/substitution failed:
src/model.cc:44:35: note:   mismatched types 'std::initializer_list<_Tp>' and 'long int'
   44 |         if (colcount[j] > std::max(40l, 10l*colcount[j-1])) {
      |                           ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/include/gcc12/c++/bits/stl_algo.h:5756:5: note: candidate: 'template<class _Tp, class _Compare> _Tp std::max(initializer_list<_Tp>, _Compare)'
 5756 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/opt/local/include/gcc12/c++/bits/stl_algo.h:5756:5: note:   template argument deduction/substitution failed:
src/model.cc:44:35: note:   mismatched types 'std::initializer_list<_Tp>' and 'long int'
   44 |         if (colcount[j] > std::max(40l, 10l*colcount[j-1])) {
      |                           ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
make: *** [build/model.o] Error 1
make: *** Waiting for unfinished jobs....
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

No branches or pull requests

1 participant