This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%===================================================================== | |
% hw.cls | |
% Provide hw.cls class | |
%===================================================================== | |
%===================================================================== | |
% Identification | |
%===================================================================== | |
\NeedsTeXFormat{LaTeX2e} | |
\ProvidesClass{hw}[2013/1/28 Based on Justin Wilson's Homework Class] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.util.parsing.combinator.RegexParsers | |
/** | |
* Simple parser for a key value string like: | |
* key01 = Value01 key02=value02 key03 =value03 key04= value04 | |
* | |
* The parser does not support whitespace in key or values. | |
*/ | |
object KeyValueParser extends RegexParsers { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public Tableau makeArtificial() { | |
Matrix tmp = getA().mergeRight(Matrix.identity(constraints)).mergeRight(getRHS()); //insert identity | |
tmp = tmp.mergeDown(new Matrix(1,vars).extend(0,constraints,1d).extend(0,1)); //add new cost row | |
return new Tableau(tmp); | |
} | |
vs | |
public Tableau makeArtificial() { | |
Double[][] tmp = new Double[height][width+height-1]; |