Thanks to visit codestin.com
Credit goes to github.com

Skip to content

TypeError converting CLP format to LMI standard form in python 3.11 #6

@lankef

Description

@lankef

Hello, I ran into the following TypeError when running SDPA in python 3.11.

File ~/miniconda3/envs/******/lib/python3.11/site-packages/sdpap/convert.py:80, in clp_toLMI(A, b, c, K, J)
75 # ----------------------------------------
76 # Make converted K.s part
77 # ----------------------------------------
78 if len(K.s) > 0:
79 # Make index mapping from converted index to original index
---> 80 map_sdpIndex = [0] * sum([k * (k + 1) / 2 for k in K.s])
81 offset = 0
82 for k in K.s:

TypeError: can't multiply sequence by non-int of type 'float'

It appears to be a simple typing error? k * (k + 1) / 2 is a float for integer k. k * (k + 1) // 2 will cast the type to int.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions