Boost logo

Boost Users :

Subject: [Boost-users] [boost::accumulators::impl::immediate_mean_impl<Sample, Tag>::operator()<Args>] c++/cli
From: It neophyte (phdlux85_at_[hidden])
Date: 2014-11-26 18:39:10


Hi

While computing a variance on my dataset, I end up with: error C2677:
binary '+' : no global operator found which takes type 'System::Object
^const ' (or there is no acceptable conversion)

The error message point to the line 65 of mean.hpp (see below piece of
code). Can someone explain what's going wrong? Thanks

template<typename Args> // line 59
    void operator ()(Args const &args) //line 60
    { // line 61
        std::size_t cnt = count(args); // line 62
        this->mean = numeric::fdiv( // line 63
            (this->mean * (cnt - 1)) +
args[parameter::keyword<Tag>::get()] // line 64
          , cnt // line 65
        ); // line 66
    } // line 67
my code:
#pragma once#include "stdAfx.h"#include "math.h"#include
<boost/accumulators/accumulators.hpp>#include
<boost/accumulators/statistics/stats.hpp>#include
<boost/accumulators/statistics/variance.hpp>

.....

accumulator_set< double, stats<tag::variance> > acc_variance;
                  DataRow^i;

                 for (int i=1;i-1<dbdataset->Rows->Count-1;i++){

dbdataset->Rows[i-1]["DataRet"]=log(System::Convert::ToDouble(dbdataset-
>Rows[i-1]["Pop"])/System::Convert::ToDouble(dbdataset->Rows[i]["Pop"]));
                     acc_variance(dbdataset->Rows[i-1]["DataRet"]);
                     lblvol->Text =
Convert::ToString(sqrt(variance(acc_variance)));
                 }



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