Vectors, handles, and inner products.
We recommend using these functions and classes when possible. Otherwise, you can write your own vector class and/or vector handle, see documentation Interfacing with your data.
Inner product of n-dim arrays on grid using the trapezoidal rule.
nx = 10 ny = 11 x_grid = 1 - N.cos(N.linspace(0, N.pi, nx)) y_grid = N.linspace(0, 1.0, ny)**2 my_trapz = InnerProductTrapz(x_grid, y_grid) v1 = N.random.random((nx,ny)) v2 = N.random.random((nx,ny)) IP_v1_v2 = my_trapz(v1, v2)
Takes the inner product.
Recommended base class for vector handles (not required).
Get a vector, using the private _get function. If available, the base vector will be subtracted from the specified vector. Then, if a scale factor is specified, the base-subtracted vector will be scaled. The scaled, base-subtracted vector is then returned.
Put a vector to file or memory using the _put function.
Gets and puts array vector objects to text files.
Gets and puts vectors in memory.
Gets and puts any vector object to pickle files.
Recommended base class for vector objects (not required).
Takes inner product of numpy arrays without weighting.