python/pycubool/matrix.py
def build(self, rows, cols, is_sorted=False, no_duplicates=False):
        """
        Build sparse matrix of boolean values from provided arrays of non-zero rows and columns.

        >>> matrix = Matrix.empty(shape=(4,4))
        >>> matrix.build([0, 1, 2, 3], [0, 1, 2, 0], is_sorted=True, no_duplicates=True)
        >>> print(matrix)
        '
                0   1   2   3
          0 |   1   .   .   . |   0
          1 |   .   1   .   . |   1
          2 |   .   .   1   . |   2
          3 |   1   .   .   . |   3
                0   1   2   3
        '

        :param rows: Array of values rows indices
        :param cols: Array of values column indices
        :param is_sorted: True if values are sorted in row-col order
        :param no_duplicates: True if provided values has no duplicates
        :return:
        """

        if len(rows) != len(cols):
            raise Exception("Rows and cols arrays must have equal size")

        nvals = len(rows)
        t_rows = (ctypes.c_uint * len(rows))(*rows)
        t_cols = (ctypes.c_uint * len(cols))(*cols)

        status = wrapper.loaded_dll.cuBool_Matrix_Build(
            self.hnd, t_rows, t_cols,
            ctypes.c_uint(nvals),
            ctypes.c_uint(bridge.get_build_hints(is_sorted, no_duplicates))
        )

        bridge.check(status)

        Build sparse matrix of boolean values from provided arrays of non-zero rows and columns.

        >>> matrix = Matrix.empty(shape=(4,4))
        >>> matrix.build([0, 1, 2, 3], [0, 1, 2, 0], is_sorted=True, no_duplicates=True)
        >>> print(matrix)
        '
                0   1   2   3
          0 |   1   .   .   . |   0
          1 |   .   1   .   . |   1
          2 |   .   .   1   . |   2
          3 |   1   .   .   . |   3
                0   1   2   3
        '

        :param rows: Array of values rows indices
        :param cols: Array of values column indices
        :param is_sorted: True if values are sorted in row-col order
        :param no_duplicates: True if provided values has no duplicates
        :return:
        
Build sparse matrix of boolean values from provided arrays of non-zero rows and columns.
Build sparse matrix of boolean values from provided arrays of non - zero rows and columns .
def build(self, rows, cols, is_sorted=False, no_duplicates=False):
        if len(rows) != len(cols):
            raise Exception("Rows and cols arrays must have equal size")
        nvals = len(rows)
        t_rows = (ctypes.c_uint * len(rows))(*rows)
        t_cols = (ctypes.c_uint * len(cols))(*cols)
        status = wrapper.loaded_dll.cuBool_Matrix_Build(
            self.hnd, t_rows, t_cols,
            ctypes.c_uint(nvals),
            ctypes.c_uint(bridge.get_build_hints(is_sorted, no_duplicates))
        )
        bridge.check(status)
def build ( self , rows , cols , is_sorted = False , no_duplicates = False ) : if len ( rows ) != len ( cols ) : raise Exception ( "Rows and cols arrays must have equal size" ) nvals = len ( rows ) t_rows = ( ctypes . c_uint * len ( rows ) ) ( * rows ) t_cols = ( ctypes . c_uint * len ( cols ) ) ( * cols ) status = wrapper . loaded_dll . cuBool_Matrix_Build ( self . hnd , t_rows , t_cols , ctypes . c_uint ( nvals ) , ctypes . c_uint ( bridge . get_build_hints ( is_sorted , no_duplicates ) ) ) bridge . check ( status )
Build sparse matrix of boolean values from provided arrays of non-zero rows and columns.
Build sparse matrix of boolean values from provided arrays of non - zero rows and columns .
"""
        Build sparse matrix of boolean values from provided arrays of non-zero rows and columns.

        >>> matrix = Matrix.empty(shape=(4,4))
        >>> matrix.build([0, 1, 2, 3], [0, 1, 2, 0], is_sorted=True, no_duplicates=True)
        >>> print(matrix)
        '
                0   1   2   3
          0 |   1   .   .   . |   0
          1 |   .   1   .   . |   1
          2 |   .   .   1   . |   2
          3 |   1   .   .   . |   3
                0   1   2   3
        '

        :param rows: Array of values rows indices
        :param cols: Array of values column indices
        :param is_sorted: True if values are sorted in row-col order
        :param no_duplicates: True if provided values has no duplicates
        :return:
        """
None
self
rows
Array of values rows indices
Array of values rows indices
cols
Array of values column indices
Array of values column indices
is_sorted
True if values are sorted in row-col order
True if values are sorted in row - col order
no_duplicates
True if provided values has no duplicates
True if provided values has no duplicates