Skip to content

Commit

Permalink
Change tb01id docstring sections to numpydoc style
Browse files Browse the repository at this point in the history
  • Loading branch information
KybernetikJo committed Aug 27, 2023
1 parent 60a5c71 commit 71d5a2c
Showing 1 changed file with 54 additions and 48 deletions.
102 changes: 54 additions & 48 deletions slycot/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,54 +44,60 @@ def tb01id(n,m,p,maxred,a,b,c,job='A'):
S = A, S = ( A B ) or S = ( A )
( C )
Required arguments:
n : input int
The order of the matrix A, the number of rows of matrix B and
the number of columns of matrix C. It represents the dimension of
the state vector. n > 0.
m : input int
The number of columns of matrix B. It represents the dimension of
the input vector. m > 0.
p : input int
The number of rows of matrix C. It represents the dimension of
the output vector. p > 0.
maxred : input float
The maximum allowed reduction in the 1-norm of S (in an iteration)
if zero rows or columns are encountered.
If maxred > 0.0, maxred must be larger than one (to enable the norm
reduction).
If maxred <= 0.0, then the value 10.0 for maxred is used.
A : input rank-2 array('d') with bounds (n,n)
The leading n-by-n part of this array must contain the system state
matrix A.
B : input rank-2 array('d') with bounds (n,m)
The leading n-by-m part of this array must contain the system input
matrix B.
C : input rank-2 array('d') with bounds (p,n)
The leading p-by-n part of this array must contain the system output
matrix C.
Optional arguments:
job := 'A' input string(len=1)
Indicates which matrices are involved in balancing, as follows:
= 'A': All matrices are involved in balancing;
= 'B': B and A matrices are involved in balancing;
= 'C': C and A matrices are involved in balancing;
= 'N': B and C matrices are not involved in balancing.
Return objects:
s_norm : float
The 1-norm of the given matrix S is non-zero, the ratio between
the 1-norm of the given matrix and the 1-norm of the balanced matrix.
A : rank-2 array('d') with bounds (n,n)
The leading n-by-n part of this array contains the balanced matrix
inv(D)*A*D.
B : rank-2 array('d') with bounds (n,m)
The leading n-by-m part of this array contains the balanced matrix
inv(D)*B.
C : rank-2 array('d') with bounds (p,n)
The leading p-by-n part of this array contains the balanced matrix C*D.
scale : rank-1 array('d') with bounds (n)
The scaling factors applied to S. If D(j) is the scaling factor
applied to row and column j, then scale(j) = D(j), for j = 1,...,n.
Parameters
----------
n : int
The order of the matrix A, the number of rows of matrix B and
the number of columns of matrix C. It represents the dimension of
the state vector. n > 0.
m : int
The number of columns of matrix B. It represents the dimension of
the input vector. m > 0.
p : int
The number of rows of matrix C. It represents the dimension of
the output vector. p > 0.
maxred : float
The maximum allowed reduction in the 1-norm of S (in an iteration)
if zero rows or columns are encountered.
If maxred > 0.0, maxred must be larger than one (to enable the norm
reduction).
If maxred <= 0.0, then the value 10.0 for maxred is used.
A : (n, n) array_like
The leading n-by-n part of this array must contain the system state
matrix A.
B : (n, m) array_like
The leading n-by-m part of this array must contain the system input
matrix B.
C : (p, n) array_like
The leading p-by-n part of this array must contain the system output
matrix C.
job := {'A', 'B', 'C', 'N'}, optional
Indicates which matrices are involved in balancing, as follows:
= 'A': All matrices are involved in balancing;
= 'B': B and A matrices are involved in balancing;
= 'C': C and A matrices are involved in balancing;
= 'N': B and C matrices are not involved in balancing.
Returns
-------
s_norm : float
The 1-norm of the given matrix S is non-zero, the ratio between
the 1-norm of the given matrix and the 1-norm of the balanced matrix.
A : (n, n) ndarray
The leading n-by-n part of this array contains the balanced matrix
inv(D)*A*D.
B : (n, m) ndarray
The leading n-by-m part of this array contains the balanced matrix
inv(D)*B.
C : (p ,n) ndarray
The leading p-by-n part of this array contains the balanced matrix C*D.
scale : rank-1 array('d') with bounds (n)
The scaling factors applied to S. If D(j) is the scaling factor
applied to row and column j, then scale(j) = D(j), for j = 1,...,n.
Raises
------
SlycotParameterError
:info = -i: the i-th argument had an illegal value;
"""
hidden = ' (hidden by the wrapper)'
arg_list = ['job', 'N', 'M', 'P', 'maxred', 'A', 'LDA'+hidden, 'B',
Expand Down

0 comments on commit 71d5a2c

Please sign in to comment.