Hi, everyone! I'm new to Alglib. I'm trying to solve a non-negative linear least square problem:
The aim is to solve: A*X = B. (A is an n*n matrix, B is a vector with n elements, X stores the solutions). subject to (1) 0<= X(i) <= 1 (2) Sum X(i) = 1; ( X(i) is the i-th element in X).
I'm trying to use the function lsfitlinearc(real_1d_array y,real_2d_array fmatrix, real_2d_array cmatrix,ae_int_t& info,real_1d_array& c,lsfitreport& rep); But I have some questions about it. (1) Could anyone tell me the correspondance between fmatrix and my matrix A? I mean, the required input fmatrix and my matrix A in A*X=B. Because I don't quite understand the examples given on the webpage about the function. (2) In lsfitlinearc(), there's no constraint about boundaries. So can I use lsfitsetbc() to set the boundaires before I call lsfitlinearc()? I tried adding lsfitsetbc() in the example code for lsfitlinearc(), but the results didn't change with boundary constraints. I guess the two functions are independent of each other. Right?
Thanks a lot for your answers!!
|