WIP: Add TypeScript definitions#98
Merged
Merged
Conversation
CXuesong
commented
Nov 6, 2019
| * @example | ||
| * ``` | ||
| * { | ||
| * x: { x1: 10, x2: 5, x3: 2, x: 1 } // x = 10 x1 + 5 x2 + 2 x3 |
Contributor
Author
There was a problem hiding this comment.
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 },
}
Owner
There was a problem hiding this comment.
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.
Contributor
Author
There was a problem hiding this comment.
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...
Comment on lines
+152
to
+289
| export class Constraint { | ||
| constructor(rhs: any, isUpperBound: any, index: any, model: any); | ||
|
|
||
| addTerm(coefficient: any, variable: any): any; | ||
|
|
||
| relax(weight: any, priority: any): void; | ||
|
|
||
| removeTerm(term: any): any; | ||
|
|
||
| setRightHandSide(newRhs: any): any; | ||
|
|
||
| setVariableCoefficient(newCoefficient: any, variable: any): any; | ||
| } | ||
|
|
||
| export class Model { | ||
| constructor(precision: any, name: any); | ||
|
|
||
| activateMIRCuts(useMIRCuts: any): void; | ||
|
|
||
| addVariable(cost: any, id: any, isInteger: any, isUnrestricted: any, priority: any): any; | ||
|
|
||
| debug(debugCheckForCycles: any): void; | ||
|
|
||
| equal(rhs: any): any; | ||
|
|
||
| getNumberOfIntegerVariables(): any; | ||
|
|
||
| greaterThan(rhs: any): any; | ||
|
|
||
| isFeasible(): any; | ||
|
|
||
| loadJson(jsonModel: any): any; | ||
|
|
||
| log(message: any): any; | ||
|
|
||
| maximize(): any; | ||
|
|
||
| minimize(): any; | ||
|
|
||
| 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: { | ||
| }; |
Contributor
Author
There was a problem hiding this comment.
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
3 tasks
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #95
I still have some questions and will post them as comments below.