Home | Trees | Indices | Help |
|
---|
|
Functions.py - Utility functions for the multimodal solver.
In order to solve a complex matricial system of ordinary differential equations, it must be convert to a real system of equation. Two functions are used to convert back and forth from the matrix notation to the vectorial form: flat2matrix and matrix2flat.
|
|||
|
|||
|
|
Convert a flat vector (obtained with matrix2flat) to a matrix of complex numbers
|
Transform a matrix of complex numbers in a vector of real number consisting of a flatten version of the original. Example >>> import numpy >>> import wiat >>> mat = numpy.array([[complex(1.,1.), complex(2.,2.)], ... [complex(3.,3.), complex(4.,4.)]]) >>> fmat = wiat.MM.Functions.matrix2flat(mat) >>> print mat [[ 1.+1.j 2.+2.j] [ 3.+3.j 4.+4.j]] >>> print fmat [ 1. 2. 3. 4. 1. 2. 3. 4.] |
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Wed Jun 18 14:33:28 2008 | http://epydoc.sourceforge.net |