change folder

This commit is contained in:
moebiusl
2024-09-19 10:54:04 +02:00
parent eca347ae09
commit 11cc202ba3
2 changed files with 0 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
type VariableLP = { name: string; coef: number };
type ConstraintLP = {
name: string;
vars: VariableLP[];
bnds: { ub: number; lb: number };
};
interface ProblemLP {
objective: {
vars: VariableLP[];
};
constraints: ConstraintLP[];
}
function createProblemLP(
objectiveVars: VariableLP[],
constraints: { name: string; vars: VariableLP[]; ub: number; lb: number }[]
): ProblemLP {
const constraintsFormatted: ConstraintLP[] = constraints.map((constraint) => ({
name: constraint.name,
vars: constraint.vars,
bnds: {
ub: constraint.ub,
lb: constraint.lb
}
}));
const problem: ProblemLP = {
objective: {
vars: objectiveVars
},
constraints: constraintsFormatted
};
return problem;
}