class_docstr: base matrix class for compressed row and column oriented matrices
class_docstr_tok: ["base","matrix","class","for","compressed","row","and","column","oriented","matrices"]
docstr: Point-wise multiplication by another matrix, vector, or
  scalar.
code: def multiply(self, other):
      """Point-wise multiplication by another matrix, vector, or
      scalar.
      """
      # Scalar multiplication.
      if isscalarlike(other):
          return self._mul_scalar(other)
      # Sparse matrix or vector.
      if isspmatrix(other):
          if self.shape == other.shape:
              other = self.__class__(other)
              return self._binopt(other, "_elmul_")
          # Single element.
          elif other.shape == (1, 1):
              return self._mul_scalar(other.toarray()[0, 0])
          elif self.shape == (1, 1):
              return other._mul_scalar(self.toarray()[0, 0])
          # A row times a column.
          elif self.shape[1] == 1 and other.shape[0] == 1:
              return self._mul_sparse_matrix(other.tocsc())
          elif self.shape[0] == 1 and other.shape[1] == 1:
              return other._mul_sparse_matrix(self.tocsc())
          # Row vector times matrix. other is a row.
          elif other.shape[0] == 1 and self.shape[1] == other.shape[1]:
              other = dia_matrix(
                  (other.toarray().ravel(), [0]),
                  shape=(other.shape[1], other.shape[1]),
              )
              return self._mul_sparse_matrix(other)
          # self is a row.
          elif self.shape[0] == 1 and self.shape[1] == other.shape[1]:
              copy = dia_matrix(
                  (self.toarray().ravel(), [0]),
                  shape=(self.shape[1], self.shape[1]),
              )
              return other._mul_sparse_matrix(copy)
          # Column vector times matrix. other is a column.
          elif other.shape[1] == 1 and self.shape[0] == other.shape[0]:
              other = dia_matrix(
                  (other.toarray().ravel(), [0]),
                  shape=(other.shape[0], other.shape[0]),
              )
              return other._mul_sparse_matrix(self)
          # self is a column.
          elif self.shape[1] == 1 and self.shape[0] == other.shape[0]:
              copy = dia_matrix(
                  (self.toarray().ravel(), [0]),
                  shape=(self.shape[0], self.shape[0]),
              )
              return copy._mul_sparse_matrix(other)
          else:
              raise ValueError("inconsistent shapes")
  
      # Assume other is a dense matrix/array, which produces a single-item
      # object array if other isn't convertible to ndarray.
      other = np.atleast_2d(other)
  
      if other.ndim != 2:
          return np.multiply(self.toarray(), other)
      # Single element / wrapped object.
      if other.size == 1:
          return self._mul_scalar(other.flat[0])
      # Fast case for trivial sparse matrix.
      elif self.shape == (1, 1):
          return np.multiply(self.toarray()[0, 0], other)
  
      from .coo import coo_matrix
  
      ret = self.tocoo()
      # Matching shapes.
      if self.shape == other.shape:
          data = np.multiply(ret.data, other[ret.row, ret.col])
      # Sparse row vector times...
      elif self.shape[0] == 1:
          if other.shape[1] == 1:  # Dense column vector.
              data = np.multiply(ret.data, other)
          elif other.shape[1] == self.shape[1]:  # Dense matrix.
              data = np.multiply(ret.data, other[:, ret.col])
          else:
              raise ValueError("inconsistent shapes")
          row = np.repeat(np.arange(other.shape[0]), len(ret.row))
          col = np.tile(ret.col, other.shape[0])
          return coo_matrix(
              (data.view(np.ndarray).ravel(), (row, col)),
              shape=(other.shape[0], self.shape[1]),
              copy=False,
          )
      # Sparse column vector times...
      elif self.shape[1] == 1:
          if other.shape[0] == 1:  # Dense row vector.
              data = np.multiply(ret.data[:, None], other)
          elif other.shape[0] == self.shape[0]:  # Dense matrix.
              data = np.multiply(ret.data[:, None], other[ret.row])
          else:
              raise ValueError("inconsistent shapes")
          row = np.repeat(ret.row, other.shape[1])
          col = np.tile(np.arange(other.shape[1]), len(ret.col))
          return coo_matrix(
              (data.view(np.ndarray).ravel(), (row, col)),
              shape=(self.shape[0], other.shape[1]),
              copy=False,
          )
      # Sparse matrix times dense row vector.
      elif other.shape[0] == 1 and self.shape[1] == other.shape[1]:
          data = np.multiply(ret.data, other[:, ret.col].ravel())
      # Sparse matrix times dense column vector.
      elif other.shape[1] == 1 and self.shape[0] == other.shape[0]:
          data = np.multiply(ret.data, other[ret.row].ravel())
      else:
          raise ValueError("inconsistent shapes")
      ret.data = data.view(np.ndarray).ravel()
      return ret
  
imports: from __future__ import division, print_function, absolute_import
  from warnings import warn
  import operator
  import numpy
  from scipy._lib.six import zip
  from scipy._lib._util import _prune_array
  from .base import spmatrix, isspmatrix, SparseEfficiencyWarning
  from .data import _data_matrix, _minmax_mixin
  from .dia import dia_matrix
  from .None import _sparsetools
  from .sputils import upcast, upcast_char, to_native, isdense, isshape, getdtype, isscalarlike, IndexMixin, get_index_dtype, downcast_intp_index, get_sum_dtype, check_shape, matrix, asmatrix
label_desc: Use image node_id 16 for calling the _cs_matrix obj's underlying member method code with example usage: obj.multiply(other) and returns: ret, self, np, self, self, np, coo_matrix, self, coo_matrix, other, self, other, self, other, other, copy