R CVXR linear programming
Here is the example that works:
Original source not working: http://rtutorial.altervista.org/lp_solvers.html
Thanks to Mark Neal for debugging: https://stackoverflow.com/questions/60909930/r-cvxr-matrix-multiplicatio...
#create Variable objects that can be manipulated by the solver.
#coefficients for objective function
C <- matrix(c(2,4,3), nrow = 1)
#the Maximize function does not find a maximum for this function. It is creating an objective function object that the solver will be able to use.
objective<-Maximize(C %*% x)
#make a list of constraints. x[i] is the ith x variable
#now we formulate the problem using the Problem function. this will create a "Problem" object for the solver
#now we can get the solution by calling solve. Now we can print out all the information we want.
#show optimum value
#show values for variables