0
我有問題。 我有一個C++代碼。我必須在目標c中使用。C++ Objecive AlgLib
double[,] x = new double[,]{{-1},{-0.8},{-0.6},{-0.4},{-0.2},{0},{0.2},{0.4},{0.6},{0.8},{1.0}};
double[] y = new double[]{0.223130,0.382893,0.582748,0.786628,0.941765,1.000000,0.941765,0.786628,0.582748,0.382893,0.223130};
double[] c = new double[]{0.3};
double epsf = 0;
double epsx = 0.000001;
int maxits = 0;
int info;
alglib::lsfitstate state;
alglib::lsfitreport rep;
double diffstep = 0.0001;
//
// Fitting with weights
// (you can change weights and see how it changes result)
//
double[] w = new double[]{1,1,1,1,1,1,1,1,1,1,1};
alglib::lsfitcreatewf(x, y, w, c, diffstep, out state);
alglib::lsfitsetcond(state, epsf, epsx, maxits);
alglib::lsfitfit(state, function_cx_1_func, null, null);
alglib::lsfitresults(state, out info, out c, out rep);
我已經打電話給我的目標文件,在與.mm
結束,但我得到的差異錯誤。 (第一行 - 當我啓動我的變數時的預期表達式)。我不能c++。但我只需要這一個功能。
我希望這是這個問題的解決方案。 https://gis.stackexchange.com/questions/74567/math-algorithm-for-n-amount-points-in-objective-c
如果有人能幫助我,那將會很棒。
由於 阿曼
嘿,謝謝。嗯,現在我明白了這個問題。這個例子是在C#中。我在C++中尋找一個例子。你知道你有沒有使用過這個函數的例子(Lib)? –
不,我沒有。但是你會在我鏈接的頁面上找到例子。我延長了我的回答。 – Albert
好的,謝謝! –