Public Member Functions | |
def | __new__ |
def | __init__ |
Constructor form a data container. | |
def | __setitem__ |
Sets an item in the vector dictionary. | |
def | getSpace |
returns a VectorSpace representing this vector | |
def | __setslice__ |
set a slice of this data inplace | |
def | setName |
sets the name of the file on disk | |
def | plot |
plot vector | |
def | reshape |
reshape underlying image | |
Vector Transformation Operations | |
def | __add__ |
Overload the '+' __operator if other can be a scalar or another vector for self + other invokes math(). | |
def | __radd__ |
Overload the '+' __operator for other + self. | |
def | __neg__ |
Overload the '-' __operator if other can be a scalar or another vector. | |
def | __sub__ |
Overload the '-' __operator if other can be a scalar or another vector. | |
def | __rsub__ |
Overload the '-' __operator if other can be a scalar or another vector for other - self. | |
def | __div__ |
Overload the '/' __operator if other can be a scalar or another vector. | |
def | __rdiv__ |
Overload the '/' __operator if other can be a scalar or another vector. | |
def | __mul__ |
Overload the '*' __operator if other can be a scalar or another vector. | |
def | __rmul__ |
Overload the '*' __operator if other can be a scalar or another vector. | |
def | __pow__ |
Overload the '**' __operator if other can be a scalar or another vector. | |
def | __abs__ |
Overload abs(). | |
def | __or__ |
boolean comparison | |
def | __and__ |
boolean comparison | |
def | __lt__ |
boolean comparison | |
def | __gt__ |
boolean comparison | |
def | __le__ |
boolean comparison | |
def | __ge__ |
boolean comparison | |
def | __eq__ |
boolean comparison | |
def | __ne__ |
boolean comparison | |
def | thr |
thresholding operation | |
def | thrhard |
hard thresholding | |
def | garrote |
Returns a garroted vector. | |
def | sort |
Sort a vector by absolute values. | |
def | __real__ |
real part of vector | |
def | __imag__ |
imaginary part of vector | |
Scalar Reduction Operations | |
def | __getitem__ |
If index is a string: Returns an item from one of the dictionaries. | |
def | rms |
root mean square of vector | |
def | max |
maximum element of vector | |
def | min |
minimum element of vector | |
def | mean |
mean value of vector | |
def | var |
variance of vector | |
def | sdt |
standard deviation of vector | |
def | norm |
lval-norm of vector | |
def | orderstat |
ith order statistic of the vector (ith smallest element), | |
Deprecated | |
these functions have been replaced by linear operators | |
def | conj |
return vector conjugate of data | |
def | grad |
gradient of the vector | |
def | noise |
Returns vector with added random noise. | |
def | transp |
TRANSP : Move transp to image. | |
Public Attributes | |
sorted | |
Static Public Attributes | |
string | name = "Vector" |
for string | |
tuple | env = InstanceManager() |
slimpy global variables | |
tuple | is_transp = property( _get_transp_flag, _set_transp_flag ) |
test if vector is transposed | |
tuple | space = property( getSpace ) |
getter property for getSpace | |
real = __real__ | |
imag = __imag__ | |
tuple | T = property( _transpose ) |
symbolic transpose of the vector | |
tuple | H = property( _conj_transp ) |
When creating a SLIMpy Vector using the command vector(filename) several variables are initialized. The only input that the user should need is `file` corresponding to a file on disk. The other variables are mostly for internal use. If file is not None, creates a vector instance with a pointer to the file `file`. If create is given as a list on integers a vector with a temporary name and the given size will be created. There are more easy to use functions such as zeros to create a file
Definition at line 54 of file serial_vector.py.
def __new__ | ( | cls, | ||
args | ||||
) |
Definition at line 65 of file serial_vector.py.
def __init__ | ( | self, | ||
container | ||||
) |
Constructor form a data container.
data - must be a data_container.
Reimplemented from ADI.
Reimplemented in aug_vec.
Definition at line 81 of file serial_vector.py.
def __setitem__ | ( | self, | ||
index, | ||||
item | ||||
) |
Sets an item in the vector dictionary.
Reimplemented in aug_vec.
Definition at line 104 of file serial_vector.py.
def getSpace | ( | self | ) |
returns a VectorSpace representing this vector
returns a Space object that contains all of the information about this vector
Reimplemented in aug_vec.
Definition at line 113 of file serial_vector.py.
def __setslice__ | ( | self, | ||
i, | ||||
j, | ||||
data | ||||
) |
set a slice of this data inplace
Writes a numarray array from index i to j to the binary file corresponding to the data_container.
Reimplemented in aug_vec.
Definition at line 142 of file serial_vector.py.
def __add__ | ( | self, | ||
other | ||||
) |
Overload the '+' __operator if other can be a scalar or another vector for self + other invokes math().
vec1.__add__(vec2) <==> vec1 + vec2
Reimplemented in aug_vec.
Definition at line 155 of file serial_vector.py.
def __radd__ | ( | self, | ||
other | ||||
) |
Overload the '+' __operator for other + self.
vec1.__radd__(vec2) <==> vec2 + vec1 vec2 may be a scalar or a vector
Reimplemented in aug_vec.
Definition at line 174 of file serial_vector.py.
def __neg__ | ( | self | ) |
Overload the '-' __operator if other can be a scalar or another vector.
vec1.__neg__() <==> -vec1
Reimplemented in aug_vec.
Definition at line 183 of file serial_vector.py.
def __sub__ | ( | self, | ||
other | ||||
) |
Overload the '-' __operator if other can be a scalar or another vector.
self..__sub__(other) <==> self - other vec2 may be a scalar or a vector
Reimplemented in aug_vec.
Definition at line 192 of file serial_vector.py.
def __rsub__ | ( | self, | ||
other | ||||
) |
Overload the '-' __operator if other can be a scalar or another vector for other - self.
vec1.__rsub__(vec2) <==> vec2 - vec1 vec2 may be a scalar or a vector
Reimplemented in aug_vec.
Definition at line 212 of file serial_vector.py.
def __div__ | ( | self, | ||
other | ||||
) |
Overload the '/' __operator if other can be a scalar or another vector.
vec1.__div__(vec2) <==> vec1 / vec2 vec2 may be a scalar or a vector
Reimplemented in aug_vec.
Definition at line 229 of file serial_vector.py.
def __rdiv__ | ( | self, | ||
other | ||||
) |
Overload the '/' __operator if other can be a scalar or another vector.
vec1.__rdiv__(vec2) <==> vec2 / vec1 vec2 may be a scalar or a vector
Reimplemented in aug_vec.
Definition at line 249 of file serial_vector.py.
def __mul__ | ( | self, | ||
other | ||||
) |
Overload the '*' __operator if other can be a scalar or another vector.
vec1.__mul__(vec2) <==> vec1 * vec2 vec2 may be a scalar or a vector
Reimplemented in aug_vec.
Definition at line 264 of file serial_vector.py.
def __rmul__ | ( | self, | ||
other | ||||
) |
Overload the '*' __operator if other can be a scalar or another vector.
vec1.__rmul__(vec2) <==> vec2 * vec
Reimplemented in aug_vec.
Definition at line 293 of file serial_vector.py.
def __pow__ | ( | self, | ||
other | ||||
) |
Overload the '**' __operator if other can be a scalar or another vector.
vec1.__pow__(vec2) <==> vec1 ** vec2 vec2 may be a scalar or a vector
Reimplemented in aug_vec.
Definition at line 302 of file serial_vector.py.
def __abs__ | ( | self | ) |
Overload abs().
Vector.__abs__(vec2) <==> abs(vec1) vec2 may be a scalar or a vector
Reimplemented in aug_vec.
Definition at line 320 of file serial_vector.py.
def __or__ | ( | self, | ||
other | ||||
) |
def __and__ | ( | self, | ||
other | ||||
) |
def __lt__ | ( | self, | ||
other | ||||
) |
boolean comparison
vec1.__lt__(vec2) <==> vec1 < vec2
Definition at line 345 of file serial_vector.py.
def __gt__ | ( | self, | ||
other | ||||
) |
boolean comparison
vec1.__gt__(vec2) <==> vec1 > vec2
Definition at line 353 of file serial_vector.py.
def __le__ | ( | self, | ||
other | ||||
) |
boolean comparison
vec1.__le__(vec2) <==> vec1 <= vec2
Definition at line 361 of file serial_vector.py.
def __ge__ | ( | self, | ||
other | ||||
) |
boolean comparison
vec1.__lt__(vec2) <==> vec1 >= vec2
Definition at line 369 of file serial_vector.py.
def __eq__ | ( | self, | ||
other | ||||
) |
boolean comparison
vec1.__eq__(vec2) <==> vec1 == vec2
Definition at line 377 of file serial_vector.py.
def __ne__ | ( | self, | ||
other | ||||
) |
boolean comparison
vec1.__ne__(vec2) <==> vec1 != vec2
Definition at line 385 of file serial_vector.py.
def thr | ( | self, | ||
obj, | ||||
mode = 'soft' | ||||
) |
thresholding operation
obj | can be a Scalar or vector | |
mode | one of 'soft', 'hard' or 'nng' |
Reimplemented in aug_vec.
Definition at line 397 of file serial_vector.py.
def thrhard | ( | self, | ||
obj | ||||
) |
hard thresholding
Returns a thresholded vector. obj - may be a scalar or a vector. Same as vector.sort(obj,'hard')
Definition at line 414 of file serial_vector.py.
def garrote | ( | self, | ||
obj | ||||
) |
Returns a garroted vector.
obj - may be a scalar or a vector. Same as vector.sort(obj,'nng')
Definition at line 423 of file serial_vector.py.
def sort | ( | self, | ||
ascmode = False , |
||||
memsize = None | ||||
) |
Sort a vector by absolute values.
ascmode | sort in ascending or descending order | |
memsize | define memory size of system |
Reimplemented in aug_vec.
Definition at line 434 of file serial_vector.py.
def __real__ | ( | self | ) |
real part of vector
Returns a vector containing the real component of a complex vector.
Definition at line 445 of file serial_vector.py.
def __imag__ | ( | self | ) |
imaginary part of vector
Returns a vector containing the imaginary component of a complex vector.
Definition at line 456 of file serial_vector.py.
def __getitem__ | ( | self, | ||
index | ||||
) |
If index is a string: Returns an item from one of the dictionaries.
Checks the vector dictionary first. If index is a number: Returns a number at index from the binary file.
Reimplemented in aug_vec.
Definition at line 479 of file serial_vector.py.
def rms | ( | self | ) |
root mean square of vector
Reimplemented in aug_vec.
Definition at line 500 of file serial_vector.py.
def max | ( | self | ) |
maximum element of vector
Reimplemented in aug_vec.
Definition at line 507 of file serial_vector.py.
def min | ( | self | ) |
minimum element of vector
Reimplemented in aug_vec.
Definition at line 514 of file serial_vector.py.
def mean | ( | self | ) |
mean value of vector
Reimplemented in aug_vec.
Definition at line 521 of file serial_vector.py.
def var | ( | self | ) |
variance of vector
Reimplemented in aug_vec.
Definition at line 528 of file serial_vector.py.
def sdt | ( | self | ) |
standard deviation of vector
Reimplemented in aug_vec.
Definition at line 535 of file serial_vector.py.
def norm | ( | self, | ||
lval = 2 | ||||
) |
lval-norm of vector
lval | power of the norm |
Reimplemented in aug_vec.
Definition at line 543 of file serial_vector.py.
def orderstat | ( | self, | ||
i | ||||
) |
ith order statistic of the vector (ith smallest element),
i | index within size of vector |
Reimplemented in aug_vec.
Definition at line 555 of file serial_vector.py.
def conj | ( | self | ) |
def grad | ( | self | ) |
gradient of the vector
Returns a vector containing the gradient of the vector.
Definition at line 592 of file serial_vector.py.
def noise | ( | self, | ||
mean = 0 , |
||||
seed = None | ||||
) |
Returns vector with added random noise.
mean - noise mean seed - noise seed
Definition at line 603 of file serial_vector.py.
def transp | ( | self, | ||
a1 = 1 , |
||||
a2 = 2 , |
||||
memsize = 100 | ||||
) |
def setName | ( | self, | ||
name, | ||||
path = None | ||||
) |
sets the name of the file on disk
set the name of this vector. Makes it non persistent.
Reimplemented in aug_vec.
Definition at line 649 of file serial_vector.py.
plot vector
Definition at line 666 of file serial_vector.py.
def reshape | ( | self, | ||
shape | ||||
) |
reshape underlying image
Definition at line 675 of file serial_vector.py.
string name = "Vector" [static] |
tuple env = InstanceManager() [static] |
tuple is_transp = property( _get_transp_flag, _set_transp_flag ) [static] |
tuple space = property( getSpace ) [static] |
real = __real__ [static] |
Definition at line 462 of file serial_vector.py.
imag = __imag__ [static] |
Definition at line 463 of file serial_vector.py.
tuple T = property( _transpose ) [static] |
symbolic transpose of the vector
Definition at line 634 of file serial_vector.py.
tuple H = property( _conj_transp ) [static] |
Definition at line 642 of file serial_vector.py.
Definition at line 557 of file serial_vector.py.