Frage

I'm fairly new to using Visual C++ 2010 Express but I'm not new to the basics and I'm trying to figure out how to use an external library to perform boundary constrained least squares optimisation.

To put the problem simply, I want to use linear least squares to find the matrix W from:

X * W = T

where

X is a matrix with 50 columns and 3 rows (50 x 3),

W is a column matrix with 50 elements (1 x 50) and

T is a column matrix with 3 element (1 x 50)

The constraints are on the values of the elements of W - let's call the elements 'w'.

0 <= w <= 1

Doing this in MATLAB is fairly simple but I need to implement this in C++. I've implemented the initial bit of my code for the formulation of the matrices X and T.

Is there any library/function I can use in Visual C++ 2010 Express to accomplish boundary constrained least squares optimisation? I've tried using ALGLIB, LEVMAR and NLOPT.

ALGLIB needs the arrays to be defined in a data type of its own.

LEVMAR has very little info on installation and what function I need to use.

NLOPT doesn't seem to have a function for this. Also, I can't seem to get it to work, even after I've generated a lib file using the instructions given here and linked the lib and source files in VC++.

Can anyone help me out with any suggestions? This is really easy to implement in MATLAB but I'm afraid I need to use C++.

Keine korrekte Lösung

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top