Did I find the right examples for you? yes no

All Samples(35)  |  Call(21)  |  Derive(0)  |  Import(14)

src/s/c/scipy-0.13.3/scipy/sparse/lil.py   scipy(Download)
 
from .base import spmatrix, isspmatrix
from .sputils import getdtype, isshape, issequence, isscalarlike, ismatrix, \
    IndexMixin, upcast_scalar
 
    def __init__(self, arg1, shape=None, dtype=None, copy=False):
        spmatrix.__init__(self)
        self.dtype = getdtype(dtype, arg1, default=float)
 
        # First get the shape

src/c/o/cobrapy-HEAD/cobra/oven/danielhyduke/jython/scipy/sparse/lil.py   cobrapy(Download)
 
from base import spmatrix, isspmatrix
from sputils import getdtype, isshape, issequence, isscalarlike
 
class lil_matrix(spmatrix):
    def __init__(self, arg1, shape=None, dtype=None, copy=False):
        spmatrix.__init__(self)
        self.dtype = getdtype(dtype, arg1, default=float)
 
        # First get the shape

src/s/c/scipy-0.13.3/scipy/sparse/compressed.py   scipy(Download)
from .dia import dia_matrix
from . import sparsetools
from .sputils import upcast, upcast_char, to_native, isdense, isshape, \
     getdtype, isscalarlike, isintlike, IndexMixin
 
                self.shape = arg1   # spmatrix checks for errors here
                M, N = self.shape
                self.data = np.zeros(0, getdtype(dtype, default=float))
                self.indices = np.zeros(0, np.intc)
                self.indptr = np.zeros(self._swap((M,N))[0] + 1, dtype=np.intc)
                    self.indices = np.array(indices, copy=copy)
                    self.indptr = np.array(indptr, copy=copy)
                    self.data = np.array(data, copy=copy, dtype=getdtype(dtype, data))
                else:
                    raise ValueError("unrecognized %s_matrix constructor usage" %

src/s/c/scipy-HEAD/scipy/sparse/lil.py   scipy(Download)
 
from base import spmatrix, isspmatrix
from sputils import getdtype, isshape, issequence, isscalarlike
 
from warnings import warn
    def __init__(self, arg1, shape=None, dtype=None, copy=False):
        spmatrix.__init__(self)
        self.dtype = getdtype(dtype, arg1, default=float)
 
        # First get the shape

src/c/o/cobrapy-HEAD/cobra/oven/danielhyduke/jython/scipy/sparse/compressed.py   cobrapy(Download)
from data import _data_matrix
import sparsetools
from sputils import upcast, to_native, isdense, isshape, getdtype, \
        isscalarlike, isintlike
 
                self.shape = arg1   #spmatrix checks for errors here
                M, N = self.shape
                self.data    = np.zeros(0, getdtype(dtype, default=float))
                self.indices = np.zeros(0, np.intc)
                self.indptr  = np.zeros(self._swap((M,N))[0] + 1, dtype=np.intc)
                    self.indices = np.array(indices, copy=copy)
                    self.indptr  = np.array(indptr, copy=copy)
                    self.data    = np.array(data, copy=copy, dtype=getdtype(dtype, data))
                else:
                    raise ValueError, "unrecognized %s_matrix constructor usage" %\

src/s/c/scipy-HEAD/scipy/sparse/compressed.py   scipy(Download)
from data import _data_matrix
import sparsetools
from sputils import upcast, upcast_char, to_native, isdense, isshape, \
     getdtype, isscalarlike, isintlike
 
                self.shape = arg1   #spmatrix checks for errors here
                M, N = self.shape
                self.data    = np.zeros(0, getdtype(dtype, default=float))
                self.indices = np.zeros(0, np.intc)
                self.indptr  = np.zeros(self._swap((M,N))[0] + 1, dtype=np.intc)
                    self.indices = np.array(indices, copy=copy)
                    self.indptr  = np.array(indptr, copy=copy)
                    self.data    = np.array(data, copy=copy, dtype=getdtype(dtype, data))
                else:
                    raise ValueError("unrecognized %s_matrix constructor usage" %

src/s/c/scipy-0.13.3/scipy/sparse/bsr.py   scipy(Download)
from .compressed import _cs_matrix
from .base import isspmatrix, _formats
from .sputils import isshape, getdtype, to_native, upcast
from . import sparsetools
from .sparsetools import bsr_matvec, bsr_matvecs, csr_matmat_pass1, \
                        raise ValueError('invalid blocksize=%s' % blocksize)
                    blocksize = tuple(blocksize)
                self.data = np.zeros((0,) + blocksize, getdtype(dtype, default=float))
                self.indices = np.zeros(0, dtype=np.intc)
 
                self.indices = np.array(indices, copy=copy)
                self.indptr = np.array(indptr, copy=copy)
                self.data = np.array(data, copy=copy, dtype=getdtype(dtype, data))
            else:
                raise ValueError('unrecognized bsr_matrix constructor usage')

src/s/c/scipy-0.13.3/scipy/sparse/dok.py   scipy(Download)
 
from .base import spmatrix, isspmatrix
from .sputils import (isdense, getdtype, isshape, isintlike, isscalarlike,
                      upcast, upcast_scalar)
 
    def __init__(self, arg1, shape=None, dtype=None, copy=False):
        dict.__init__(self)
        spmatrix.__init__(self)
 
        self.dtype = getdtype(dtype, default=float)

src/s/c/scipy-HEAD/scipy/sparse/bsr.py   scipy(Download)
from compressed import _cs_matrix
from base import isspmatrix, _formats
from sputils import isshape, getdtype, to_native, upcast
import sparsetools
from sparsetools import bsr_matvec, bsr_matvecs, csr_matmat_pass1, \
                        raise ValueError('invalid blocksize=%s' % blocksize)
                    blocksize = tuple(blocksize)
                self.data    = np.zeros( (0,) + blocksize, getdtype(dtype, default=float) )
                self.indices = np.zeros( 0, dtype=np.intc )
 
                self.indices = np.array(indices, copy=copy)
                self.indptr  = np.array(indptr,  copy=copy)
                self.data    = np.array(data,    copy=copy, dtype=getdtype(dtype, data))
            else:
                raise ValueError('unrecognized bsr_matrix constructor usage')

src/s/c/scipy-0.13.3/scipy/sparse/coo.py   scipy(Download)
from .base import isspmatrix
from .data import _data_matrix, _minmax_mixin
from .sputils import upcast, upcast_char, to_native, isshape, getdtype, isintlike
 
 
                self.row = np.array([], dtype=np.intc)
                self.col = np.array([], dtype=np.intc)
                self.data = np.array([], getdtype(dtype, default=float))
            else:
                try:
                    'use coo_matrix( (M,N) ) instead', DeprecationWarning)
            self.shape = shape
            self.data = np.array([], getdtype(dtype, default=float))
            self.row = np.array([], dtype=np.intc)
            self.col = np.array([], dtype=np.intc)

  1 | 2  Next