%
% RestrictedSolver.m
% Creates Data Structer for Restricted solution
%

function [TmpProb] = RestrictedSolver(Prob, prescription, Angles)

NumAngles = length(Angles);
[m,n] = size(Prob.DoseMatrix);
A = zeros(m,sum(Prob.NumPencils(Angles)));
ColInd1  = 1;
for a = 1:length(Angles)
   ColInd2 = sum(Prob.NumPencils(1:Angles(a)-1)) + 1;
   A(:, ColInd1 : ColInd1 + Prob.NumPencils(Angles(a)) - 1) = ...
      Prob.DoseMatrix(:, ColInd2 : sum(Prob.NumPencils(1:Angles(a))) );
   ColInd1  = ColInd1 + Prob.NumPencils(Angles(a));
end

TmpProb = RestrictedParse(A, prescription, NumAngles,Prob.NumPencils(Angles));
TmpProb = Solver(TmpProb, 'cplex');

return
