Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::math_opt::LinearTerm Struct Reference

A term in an sum of variables multiplied by coefficients. More...

#include <variable_and_expressions.h>

Public Member Functions

 LinearTerm (Variable variable, double coefficient)
 
LinearTerm operator- () const
 
LinearTermoperator*= (double d)
 
LinearTermoperator/= (double d)
 

Public Attributes

Variable variable
 
double coefficient
 

Detailed Description

A term in an sum of variables multiplied by coefficients.

Definition at line 192 of file variable_and_expressions.h.

Constructor & Destructor Documentation

◆ LinearTerm()

operations_research::math_opt::LinearTerm::LinearTerm ( Variable variable,
double coefficient )
inline

Usually this constructor is never called explicitly by users. Instead it will be implicitly used when writing linear expression. For example x + / 2*y will automatically use this constructor to build a LinearTerm from x and the overload of the operator* will also automatically create the one from 2*y.

LinearTerm

Definition at line 1331 of file variable_and_expressions.h.

Member Function Documentation

◆ operator*=()

LinearTerm & operations_research::math_opt::LinearTerm::operator*= ( double d)
inline

Definition at line 1338 of file variable_and_expressions.h.

◆ operator-()

LinearTerm operations_research::math_opt::LinearTerm::operator- ( ) const
inline

Definition at line 1334 of file variable_and_expressions.h.

◆ operator/=()

LinearTerm & operations_research::math_opt::LinearTerm::operator/= ( double d)
inline

Definition at line 1343 of file variable_and_expressions.h.

Member Data Documentation

◆ coefficient

double operations_research::math_opt::LinearTerm::coefficient

Definition at line 203 of file variable_and_expressions.h.

◆ variable

Variable operations_research::math_opt::LinearTerm::variable

Definition at line 202 of file variable_and_expressions.h.


The documentation for this struct was generated from the following file: