| |
- array(...)
- array(object, dtype=None, copy=1,order=None, subok=0,ndmin=0)
Return an array from object with the specified date-type.
Inputs:
object - an array, any object exposing the array interface, any
object whose __array__ method returns an array, or any
(nested) sequence.
dtype - The desired data-type for the array. If not given, then
the type will be determined as the minimum type required
to hold the objects in the sequence. This argument can only
be used to 'upcast' the array. For downcasting, use the
.astype(t) method.
copy - If true, then force a copy. Otherwise a copy will only occur
if __array__ returns a copy, obj is a nested sequence, or
a copy is needed to satisfy any of the other requirements
order - Specify the order of the array. If order is 'C', then the
array will be in C-contiguous order (last-index varies the
fastest). If order is 'FORTRAN', then the returned array
will be in Fortran-contiguous order (first-index varies the
fastest). If order is None, then the returned array may
be in either C-, or Fortran-contiguous order or even
discontiguous.
subok - If True, then sub-classes will be passed-through, otherwise
the returned array will be forced to be a base-class array
ndmin - Specifies the minimum number of dimensions that the resulting
array should have. 1's will be pre-pended to the shape as
needed to meet this requirement.
- checkvol(v1, v2, v3, min_vec2=1.0000000000000001e-18)
- Check whether vectors are singular
- dot(...)
- find_lattice(vecs, min_vec2=1, n_try=None, test_vecs=None, tol=0.10000000000000001, fraction_indexed=0.90000000000000002, noisy=False)
- vecs - vectors to use to generate the lattice
min_vec2 - squared length of min_vec (units as vec)
n_try - max number of vecs to test (clips vecs for generating)
test_vecs - vectors to index with the unit cell (else use vecs)
fraction_indexed - whether or not to return cells
- fparl(x, y)
- fraction of x parallel to y
- get_options(parser)
- iter3d(n)
- Generate all possible unordered combinations of vectors i,j,k
for i,j,k < n
- mod(x, y)
- Returns the part of x with integer multiples of y removed
assert that ||mod(x,y)|| <= ||x|| for all y
- reduce(v1, v2, v3, min_vec2=1.0000000000000001e-18)
- Try to find a reduced lattice basis of v1, v2, v3
- rsweep(vl)
- One sweep subtracting each from other two
This idea comes from Knuth TAOCP sec 3.3.4C
- sortvec_len(vl)
- Sorts according to length (d-s-u)
- sortvec_xyz(vl)
- For each choose between x, -x
Sorts according to x then y then z components
- where(...)
- where(condition, | x, y)
The result is shaped like condition and has elements of x and y where
condition is respectively true or false. If x or y are not given,
then it is equivalent to condition.nonzero().
To group the indices by element, rather than dimension, use
transpose(where(condition, | x, y))
instead. This always results in a 2d array, with a row of indices for
each element that satisfies the condition.
- zeros(...)
- zeros((d1,...,dn),dtype=float,order='C')
Return a new array of shape (d1,...,dn) and type typecode with all
it's entries initialized to zero.
|