answer.code:11:8: error: ‘std::valarray<double> y0’ redeclared as different kind of entity
11 | va<db> y0;
| ^~
In file included from /usr/include/features.h:461,
from /usr/include/x86_64-linux-gnu/c++/11/bits/os_defines.h:39,
from /usr/include/x86_64-linux-gnu/c++/11/bits/c++config.h:586,
from /usr/include/c++/11/cassert:43,
from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:33,
from answer.code:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:220:1: note: previous declaration ‘double y0(double)’
220 | __MATHCALL (y0,, (_Mdouble_));
| ^~~~~~~~~~
answer.code: In function ‘void ins(std::vector<std::pair<std::__cxx11::basic_string<char>, std::valarray<double> > >&, const string&, const std::valarray<double>&)’:
answer.code:14:14: error: no match for ‘operator-’ (operand types are ‘const std::valarray<double>’ and ‘double(double) noexcept’)
14 | if(abs(y - y0).max() <= 1e-3){
| ~ ^ ~~
| | |
| | double(double) noexcept
| const std::valarray<double>
In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:95,
from answer.code:1:
/usr/include/c++/11/valarray:1091:5: note: candidate: ‘typename std::valarray<_Tp>::_UnaryOp<std::__negate>::_Rt std::valarray<_Tp>::operator-() const [with _Tp = double; typename std::valarray<_Tp>::_UnaryOp<std::__negate>::_Rt = std::valarray<double>::_UnaryOp<std::__negate>::_Rt]’
1091 | _DEFINE_VALARRAY_UNARY_OPERATOR(-, __negate)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/11/valarray:1091:5: note: candidate expects 0 arguments, 1 provided
In file included from /usr/include/c++/11/bits/stl_algobase.h:67,
from /usr/include/c++/11/bits/specfun.h:45,
from /usr/include/c++/11/cmath:1935,
from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:41,
from answer.code:1:
/usr/include/c++/11/bits/stl_iterator.h:577:5: note: candidate: ‘template<class _IteratorL, class _IteratorR> constexpr decltype ((__y.base() - __x.base())) std::operator-(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_IteratorR>&)’
577 | operator-(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/11/bits/stl_iterator.h:577:5: note: template argument deduction/substitution failed:
answer.code:14:16: note: ‘const std::valarray<double>’ is not derived from ‘const std::reverse_iterator<_Iterator>’
14 | if(abs(y - y0).max() <= 1e-3){
| ^~
In file included from /usr/include/c++/11/bits/stl_algobase.h:67,
from /usr/include/c++/11/bits/specfun.h:45,
from /usr/include/c++/11/cmath:1935,
from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:41,
from answer.code:1:
/usr/include/c++/11/bits/stl_iterator.h:1693:5: note: candidate: ‘template<class _IteratorL, class _IteratorR> constexpr decltype ((__x.base() - __y.base())) std::operator-(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorR>&)’
1693 | operator-(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/11/bits/stl_iterator.h:1693:5: note: template argument deduction/substitution failed:
answer.code:14:16: note: ‘const std::valarray<double>’ is not derived from ‘const std::move_iterator<_IteratorL>’
14 | if(abs(y - y0).max() <= 1e-3){
| ^~
In file included from /usr/include/c++/11/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:54,
from answer.code:1:
/usr/include/c++/11/complex:362:5: note: candidate: ‘template<class _Tp> std::complex<_Tp> std::operator-(const std::complex<_Tp>&, const std::complex<_Tp>&)’
362 | operator-(const complex<_Tp>& __x, const complex<_Tp>& __y)
| ^~~~~~~~
/usr/include/c++/11/complex:362:5: note: template argument deduction/substitution failed:
answer.code:14:16: note: ‘const std::valarray<double>’ is not derived from ‘const std::complex<_Tp>’
14 | if(abs(y - y0).max() <= 1e-3){
| ^~
In file included from /usr/include/c++/11/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:54,
from answer.code:1:
/usr/include/c++/11/complex:371:5: note: candidate: ‘template<class _Tp> std::complex<_Tp> std::operator-(const std::complex<_Tp>&, const _Tp&)’
371 | operator-(const complex<_Tp>& __x, const _Tp& __y)
| ^~~~~~~~
/usr/include/c++/11/complex:371:5: note: template argument deduction/substitution failed:
answer.code:14:16: note: ‘const std::valarray<double>’ is not derived from ‘const std::complex<_Tp>’
14 | if(abs(y - y0).max() <= 1e-3){
| ^~
In file included from /usr/include/c++/11/ccomplex:39,
...