def eigenvalues(self): """ @returns: the eigenvalues of the tensor @rtype: C{Numeric.array} @raises ValueError: if rank !=2 """ if self.rank == 2: from Scientific.LA import eigenvalues return eigenvalues(self.array) else: raise ValueError('Undefined operation')
def poles(self): """ @returns: the poles of the model in the complex M{z}-plane @rtype: C{Numeric.array} of C{complex} """ if self._poles is None: from Scientific.LA import eigenvalues n = len(self.coeff) if n == 1: self._poles = self.coeff else: a = N.zeros_st((n, n), self.coeff) a[1:, :-1] = N.identity(n-1) a[:, -1] = self.coeff self._poles = eigenvalues(a) return self._poles
def poles(self): """ @returns: the poles of the model in the complex M{z}-plane @rtype: C{Numeric.array} of C{complex} """ if self._poles is None: from Scientific.LA import eigenvalues n = len(self.coeff) if n == 1: self._poles = self.coeff else: a = N.zeros_st((n, n), self.coeff) a[1:, :-1] = N.identity(n - 1) a[:, -1] = self.coeff self._poles = eigenvalues(a) return self._poles
def zeros(self): """ Find the X{zeros} (X{roots}) of the polynomial by diagonalization of the associated Frobenius matrix. @returns: an array containing the zeros @rtype: C{Numeric.array} @note: this is defined only for polynomials in one variable @raise ValueError: is the polynomial has more than one variable """ if self.dim != 1: raise ValueError("not implemented") n = len(self.coeff)-1 if n == 0: return Numeric.array([]) a = Numeric.zeros_st((n, n), self.coeff) if n > 1: a[1:, :-1] = Numeric.identity(n-1) a[:, -1] = -self.coeff[:-1]/self.coeff[-1] from Scientific.LA import eigenvalues return eigenvalues(a)
def zeros(self): """ Find the X{zeros} (X{roots}) of the polynomial by diagonalization of the associated Frobenius matrix. @returns: an array containing the zeros @rtype: C{Numeric.array} @note: this is defined only for polynomials in one variable @raise ValueError: is the polynomial has more than one variable """ if self.dim != 1: raise ValueError("not implemented") n = len(self.coeff) - 1 if n == 0: return Numeric.array([]) a = Numeric.zeros_st((n, n), self.coeff) if n > 1: a[1:, :-1] = Numeric.identity(n - 1) a[:, -1] = -self.coeff[:-1] / self.coeff[-1] from Scientific.LA import eigenvalues return eigenvalues(a)