Boost logo

Boost Users :

Subject: Re: [Boost-users] Multiprecision vector pass to function by reference
From: Edward Diener (eldiener_at_[hidden])
Date: 2016-05-02 09:00:47


On 5/2/2016 8:46 AM, Cooper, Bridgette R D wrote:
> Hi,
>
>
> I am having some difficulties passing a vector of type
> std::vector<float128> to a function. I'm getting multiple errors out.
> The first few of which are:
>
>
> *tql2.cpp:13:50:* *error: *‘*float128*’ was not declared in this scope
>
> void tql2(const int nm, int n, const std::vector<float128> & d, const
> std::vector<float128> & e, const std::vector< std::vector<float128> > &
> z, int ierr)
>
> * ^*
>
> *tql2.cpp:13:50:* *note: *suggested alternative:
>
> In file included from *tql2.cpp:1:0*:
>
> */home/bcooper/Tarballs/boost_1_57_0/boost/multiprecision/float128.hpp:124:42:*
> *note: * ‘*boost::multiprecision::float128*’
>
> typedef number<float128_backend, et_off> float128;
>
> * ^*
>
> *tql2.cpp:13:58:* *error: *template argument 1 is invalid
>
> void tql2(const int nm, int n, const std::vector<float128> & d, const
> std::vector<float128> & e, const std::vector< std::vector<float128> > &
> z, int ierr)
>
> * ^*
>
> *tql2.cpp:13:58:* *error: *template argument 2 is invalid
>
> *tql2.cpp:13:83:* *error: *‘*float128*’ was not declared in this scope
>
> void tql2(const int nm, int n, const std::vector<float128> & d, const
> std::vector<float128> & e, const std::vector< std::vector<float128> > &
> z, int ierr)
>
> *
> ^*
>
> *tql2.cpp:13:83:* *note: *suggested alternative:
>
> In file included from *tql2.cpp:1:0*:
>
> */home/bcooper/Tarballs/boost_1_57_0/boost/multiprecision/float128.hpp:124:42:*
> *note: * ‘*boost::multiprecision::float128*’
>
> typedef number<float128_backend, et_off> float128;
>
> * ^*
>
> *
> *
>
>
>
> The first few lines of my code are:
>
>
> #include <boost/multiprecision/float128.hpp>
>
> #include <boost/math/cstdfloat/cstdfloat_types.hpp>
>
> #include <boost/math/cstdfloat/cstdfloat_limits.hpp>
>
> #include <boost/math/cstdfloat/cstdfloat_cmath.hpp>
>
> #include <boost/math/cstdfloat/cstdfloat_iostream.hpp>
>
> extern"C"{
>
> #include <quadmath.h>
>
> }
>
> #include <iostream>
>
> #include <vector>
>
> #include <iterator>
>
>
> voidtql2(constintnm, intn, conststd::vector<float128> & d,
> conststd::vector<float128> & e, conststd::vector< std::vector<float128>
>> & z, intierr)
>
> {
>
> using namespace boost::multiprecision;
>
>
> ...
>
> }
>
>
> Not sure where I am going wrong? Any advice?

Try moving the 'using namespace' line just after your header file includes.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net