ROOC
    Preparing search index...

    Function sos2

    • A type 2 special ordered set: at most two of its members are nonzero, and they are adjacent in the order of the set.

      The members are variables, ordered as given, or [variable, weight] pairs whose weights give the order. A set is either all variables or all pairs, and the weights of a type 2 set must be distinct.

      Parameters

      Returns SpecialOrderedSet

      // the points of a piecewise-linear function at x = 0, 2.5 and 4
      model.with(sos2([[l[0], 0], [l[1], 2.5], [l[2], 4]]).named("pw"))
    • A type 2 special ordered set: at most two of its members are nonzero, and they are adjacent in the order of the set.

      The members are variables, ordered as given, or [variable, weight] pairs whose weights give the order. A set is either all variables or all pairs, and the weights of a type 2 set must be distinct.

      Parameters

      Returns SpecialOrderedSet

      // the points of a piecewise-linear function at x = 0, 2.5 and 4
      model.with(sos2([[l[0], 0], [l[1], 2.5], [l[2], 4]]).named("pw"))