# ILinearModel Interface

**Solver Foundation 3.0**

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Encapsulates a linear optimization model that consists of decision variables, constraints, and goals.

**Namespace:**Microsoft.SolverFoundation.Services

**Assembly:**Microsoft.Solver.Foundation (in Microsoft.Solver.Foundation.dll)

The ILinearModel type exposes the following members.

Name | Description | |
---|---|---|

CoefficientCount | Gets the number of nonzero coefficients in a linear model. | |

GoalCount | Gets the number of goals in a linear model. | |

Goals | Gets the goal collection of a linear model. | |

Indices | Gets the variable index collection of a linear model, inclusive of rows. | |

IntegerIndexCount | Gets the number of integer variables in a linear model. | |

IsQuadraticModel | Gets a value that indicates whether a model has a quadratic term on the objective function. | |

IsSpecialOrderedSet | Gets a value that indicates whether a linear model is a special ordered set. | |

KeyComparer | Gets the key that is used to compare rows or variables. | |

KeyCount | Gets the number of keys in a linear model, inclusive of rows and variables. | |

Keys | Gets the variable and row key collection of a linear model. | |

RowCount | Gets the number of rows in a linear model. | |

RowIndices | Gets the collection of row indexes for a linear model. | |

RowKeys | Gets the collection of row keys for a linear model. | |

VariableCount | Gets the number of variables in a linear model. | |

VariableIndices | Gets the collection of variable indexes for a linear model. | |

VariableKeys | Gets the collection of variable keys for linear model. |

Name | Description | |
---|---|---|

AddGoal | Creates an ILinearGoal object and adds it to the goal list in a model. | |

AddRow(Object, Int32%) | Attempts to add a row to the models and returns a value that indicates whether a row is added to a model. | |

AddRow(Object, SpecialOrderedSetType, Int32%) | Attempts to add a row to the model and returns a value that indicates whether a reference row for a special ordered set is added to a model. | |

AddVariable | Returns a value that indicates whether a user variable is added to a model. | |

ClearGoals | Clears all the goals in a model. | |

GetBasic | Returns a value that indicates whether a variable is a basic variable. | |

GetBounds | Returns the bounds for a variable. | |

GetCoefficient(Int32, Int32) | Returns the coefficient of the A matrix in a linear model. | |

GetCoefficient(Int32, Int32, Int32) | Returns the coefficient of the Q matrix on the objective row. | |

GetGoalFromIndex | Returns the goal entry if the row identifier is associated with a goal. | |

GetIgnoreBounds | Returns a value that indicates whether the bounds of a variable are ignored. | |

GetIndexFromKey | Returns an index that corresponds to the specified key. | |

GetIntegrality | Returns a value that indicates whether a variable is an integer variable. | |

GetKeyFromIndex | Returns the key that is associated with a variable index. | |

GetRowEntries | Returns the collection of nonzero variable entries. | |

GetRowEntryCount | Returns the number of nonzero coefficients for the specified row index. | |

GetRowQuadraticEntries | Returns a collection of nonzero variable entries on a quadratic row. | |

GetSpecialOrderedSetTypeRowIndexes | Returns a list of rows for a special ordered set. | |

GetValue | Returns the value that is associated with a variable index. | |

GetValueState | Gets the value state for the variable. | |

GetVariableEntries | Gets a collection of non-zero column entries for the specified column variable index. | |

GetVariableEntryCount | Returns the number of nonzero coefficients for the specified column variable index. | |

IsGoal(Int32) | Returns a value that indicates whether a row identifier is associated with a goal row. | |

IsGoal(Int32, ILinearGoal%) | Returns a value that indicates whether a row identifier is associated with a goal row. | |

IsQuadraticVariable | Returns a value that indicates whether a variable is in any quadratic row. | |

IsRow | Returns a value that indicates whether a variable index is associated with a row. | |

RemoveGoal | Attempts to remove a goal row and returns a value that indicates whether the row is removed successfully. | |

SetBasic | Sets the basic status for a variable. | |

SetBounds | Sets the bounds for a variable. | |

SetCoefficient(Int32, Int32, Rational) | Sets the coefficient of the A matrix in a linear model. | |

SetCoefficient(Int32, Rational, Int32, Int32) | Sets the coefficient of the Q matrix on the objective row. | |

SetIgnoreBounds | Sets a value that specifies whether to ignore or respect the bounds of a variable during a solve process. | |

SetIntegrality | Sets a value that indicates whether a variable is an integer. | |

SetLowerBound | Sets the lower bound of a variable. | |

SetUpperBound | Sets the upper bound of a variable. | |

SetValue | Sets the value of a linear model. | |

TryGetIndexFromKey | Returns a value that indicates whether a variable index exists for the specified key. |

Show: