-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Add TypeScript definitions #98
Conversation
* @example | ||
* ``` | ||
* { | ||
* x: { x1: 10, x2: 5, x3: 2, x: 1 } // x = 10 x1 + 5 x2 + 2 x3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the x: 1
here mandatory? What will happen if I use something like
{
x: { x1: 10, x2: 5 },
// -- OR --
x: { x1: 10, x2: 5, x: 10 },
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, been out to lunch on this one.
the x: 1
isn't necessary, but I like to include it.
For me, its helpful; since it lets me easily put a constraint on the variable itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. What if user input something like x: 10
instead? Is this case invalid? If so, I may need to add more type constraint on this...
|
||
removeConstraint(constraint: any): any; | ||
|
||
removeVariable(variable: any): any; | ||
|
||
restore(): any; | ||
|
||
save(): any; | ||
|
||
setCost(cost: any, variable: any): any; | ||
|
||
smallerThan(rhs: any): any; | ||
|
||
solve(): any; | ||
|
||
updateConstraintCoefficient(constraint: any, variable: any, difference: any): any; | ||
|
||
updateRightHandSide(constraint: any, difference: any): any; | ||
} | ||
|
||
export class Tableau { | ||
constructor(precision: any); | ||
|
||
addConstraint(constraint: any): void; | ||
|
||
addCutConstraints(cutConstraints: any): void; | ||
|
||
addVariable(variable: any): void; | ||
|
||
applyCuts(branchingCuts: any): void; | ||
|
||
applyMIRCuts(): void; | ||
|
||
branchAndCut(): void; | ||
|
||
checkForCycles(varIndexes: any): any; | ||
|
||
computeFractionalVolume(ignoreIntegerValues: any): any; | ||
|
||
copy(): any; | ||
|
||
countIntegerValues(): any; | ||
|
||
density(): any; | ||
|
||
getFractionalVarWithLowestCost(): any; | ||
|
||
getMostFractionalVar(): any; | ||
|
||
getNewElementIndex(): any; | ||
|
||
getSolution(): any; | ||
|
||
initialize(width: any, height: any, variables: any, unrestrictedVars: any): void; | ||
|
||
isIntegral(): any; | ||
|
||
log(message: any, force: any): any; | ||
|
||
phase1(): any; | ||
|
||
phase2(): any; | ||
|
||
pivot(pivotRowIndex: any, pivotColumnIndex: any): void; | ||
|
||
removeConstraint(constraint: any): void; | ||
|
||
removeVariable(variable: any): void; | ||
|
||
restore(): void; | ||
|
||
save(): void; | ||
|
||
setEvaluation(): void; | ||
|
||
setModel(model: any): any; | ||
|
||
setOptionalObjective(priority: any, column: any, cost: any): any; | ||
|
||
simplex(): any; | ||
|
||
solve(): any; | ||
|
||
updateConstraintCoefficient(constraint: any, variable: any, difference: any): void; | ||
|
||
updateCost(variable: any, difference: any): void; | ||
|
||
updateRightHandSide(constraint: any, difference: any): void; | ||
|
||
updateVariableValues(): void; | ||
|
||
} | ||
|
||
export const External: { | ||
}; | ||
|
||
export const Numeral: any; | ||
|
||
export const branchAndCut: { | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These look like exported modules from main.js
. Are they all intended to be used by the outside world?
Lines 36 to 43 in 18942b7
this.Model = Model; | |
this.branchAndCut = branchAndCut; | |
this.Constraint = Constraint; | |
this.Variable = Variable; | |
this.Numeral = Numeral; | |
this.Term = Term; | |
this.Tableau = Tableau; | |
this.lastSolvedModel = null; |
Resolves #95
I still have some questions and will post them as comments below.