<commit_before>"""
(c) Copyright Fair Isaac Corporation 2017. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""

import cvxpy.settings as s
import cvxpy.interface as intf

import cvxpy.lin_ops.lin_utils as linutils

from cvxpy.problems.solvers.solver import Solver

import xpress
import numpy


def makeMstart(A, n, ifCol):

    # Construct mstart using nonzero column indices in A
    mstart = numpy.bincount(A.nonzero()[ifCol])
    mstart = numpy.concatenate((numpy.array([0], dtype=numpy.int64),
                                mstart,
                                numpy.array([0] * (n - len(mstart)), dtype=numpy.int64)))
    mstart = numpy.cumsum(mstart)

    return mstart


class XPRESS(Solver):

    """
    Interface for the FICO Xpress-Optimizer.
    Uses its Python interface to exchange data
    with CVXPY.
    """

    # Main member of this class: an Xpress problem. Marked with a
    # trailing "_" to denote a member
    prob_ = None<commit_msg>Remove import xpress from root of xpress_intf.py<commit_after>"""
(c) Copyright Fair Isaac Corporation 2017. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""

import cvxpy.settings as s
import cvxpy.interface as intf

import cvxpy.lin_ops.lin_utils as linutils

from cvxpy.problems.solvers.solver import Solver

import numpy


def makeMstart(A, n, ifCol):

    # Construct mstart using nonzero column indices in A
    mstart = numpy.bincount(A.nonzero()[ifCol])
    mstart = numpy.concatenate((numpy.array([0], dtype=numpy.int64),
                                mstart,
                                numpy.array([0] * (n - len(mstart)), dtype=numpy.int64)))
    mstart = numpy.cumsum(mstart)

    return mstart


class XPRESS(Solver):

    """
    Interface for the FICO Xpress-Optimizer.
    Uses its Python interface to exchange data
    with CVXPY.
    """

    # Main member of this class: an Xpress problem. Marked with a
    # trailing "_" to denote a member
    prob_ = None
{'fraction_non_alphanumeric': 0.0762970498474059, 'fraction_numerical': 0.009494743981010512, 'mean_word_length': 3.190340909090909, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '394205', 'n_tokens_mistral': 880, 'n_tokens_neox': 830, 'n_words': 339}