Next Article in Journal
Multi-Threshold Image Segmentation Based on the Improved Dragonfly Algorithm
Previous Article in Journal
Stochastic Orderings between Two Finite Mixtures with Inverted-Kumaraswamy Distributed Components
Previous Article in Special Issue
Efficiency of Various Tiling Strategies for the Zuker Algorithm Optimization
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Accurate Computations with Block Checkerboard Pattern Matrices

Departamento de Matemática Aplicada, Universidad de Zaragoza, 50018 Zaragoza, Spain
*
Author to whom correspondence should be addressed.
These authors contributed equally to this work.
Mathematics 2024, 12(6), 853; https://doi.org/10.3390/math12060853
Submission received: 19 January 2024 / Revised: 3 March 2024 / Accepted: 13 March 2024 / Published: 14 March 2024
(This article belongs to the Special Issue Numerical Algorithms: Computer Aspects and Related Topics)

Abstract

:
In this work, block checkerboard sign pattern matrices are introduced and analyzed. They satisfy the generalized Perron–Frobenius theorem. We study the case related to total positive matrices in order to guarantee bidiagonal decompositions and some linear algebra computations with high relative accuracy. A result on intervals of checkerboard matrices is included. Some numerical examples illustrate the theoretical results.

1. Introduction

Finding classes of structured matrices for which accurate computations can be assured has been a very active research field in recent years (cf. [1,2,3,4,5,6,7]). The desired goal is to guarantee high relative accuracy (HRA), and it has been achieved for the usual linear algebra computations only for a few classes of matrices. If an algorithm uses only additions of numbers of the same sign, multiplications, and divisions, on the assumption that each original real datum is known to HRA, then the output of that algorithm can be calculated with HRA (cf. [2] p. 52). Furthermore, in well-implemented floating-point arithmetic, HRA is preserved even when performing true subtractions with original exact data (cf. p. 53 of [2]). Therefore, an algorithm that only uses additions of numbers of the same sign, multiplications, divisions, and subtractions (additions of numbers of different sign) of the initial data ensures an output with HRA.
Among the sources of structured matrices for which HRA computations can be guaranteed are some subclasses of nonsingular, totally positive matrices. We say that a matrix is totally positive (TP) whenever all its minors are non-negative (see [8]). These matrices are also known as totally non-negative. TP matrices have been applied in many different fields (cf. [9,10,11,12]), including Approximation Theory, Statistics, Mechanics, Computer-Aided Geometric Design, Biomathematics, and Combinatorics, in addition to many other fields. A nonsingular TP matrix can be decomposed as a bidiagonal factorization, that is, it can be written as a product of bidiagonal matrices (see Chapter 7 of [10]). If we can compute this factorization with HRA, then we can apply the algorithms of [13] to perform many linear algebra computations with HRA, like the calculation of every eigenvalue, every singular value, and the inverse or solving some linear systems.
Many advantages of dealing with non-negative matrices are known. As recalled above, additional advantages can be obtained when dealing with TP matrices, in particular in the field of achieving HRA computations. In this paper, we show that the nice spectral properties of Perron–Frobenius theorems of non-negative matrices can be extended to some matrices with a special sign pattern. Analogously, we show how the HRA computations of some nonsingular TP matrices can be extended to some related classes of matrices with a special sign pattern.
The originality of the new results comes from the fact that this manuscript provides tools to identify new classes of matrices of different signs for which Perron–Frobenius-type theorems can be applied and for which high-relative-accuracy algorithms can be used. These matrices arise in Combinatorics, as shown in Section 6, but also in Computer-Aided Geometric Design or in Approximation Theory.
The structure of the paper is the following: Section 2 presents basic definitions, auxiliary results and the extension of Perron–Frobenius theorems to signed matrices. Section 3 introduces bidiagonal decompositions and the class of checkerboard matrices, whose advantages for achieving HRA computations are presented in Section 4. Section 5 includes a result on intervals of checkerboard matrices. Section 6 shows some examples of checkerboard matrices with integer entries whose bidiagonal decomposition can be extremely simple. Finally, Section 7 includes numerical experiments illustrating the accuracy of our methods with respect to standard methods.

2. Definitions and Auxiliary Results

Given a matrix A, we write A 0 if all its entries are non-negative. Let us introduce the notation Q r for the set of strictly increasing sequences of r positive integers, and let α , β Q r . Then, we denote the r × r submatrix of A that is formed by taking the rows numbered by α and the columns numbered by β as A [ α | β ] . If  α = β , submatrix A [ α | α ] is a principal submatrix of A, and it is written as A [ α ] . The dispersion number, d ( α ) , is defined for every α Q r as
d ( α ) : = α r α 1 ( r 1 ) .
So, α consists of successive integers whenever d ( α ) = 0 .
Given a non-negative integer r, let us denote by P r the set of sequences of r positive consecutive indices α t Q r such that α t : = ( t r + 1 , , ( t + 1 ) r ) for t N { 0 } .
Definition 1.
We say that an infinite matrix B : = ( b i j ) i , j 1 has a block checkerboard sign pattern if for some positive integer r and all sequences of indices α t , α s P r , we have that
B [ α t | α s ] 0 if t s is an even number , B [ α t | α s ] 0 if t s is an odd number .
Let us notice that the principal submatrices B [ α t ] are non-negative for every α t P r .
In Definition 1, the parameter r describes the size of the sign blocks appearing in B. For the case r = 3 , the sign structure of a block checkerboard pattern would be as follows:
B = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
We say that D : = ( d i j ) i , j 1 is a diagonal matrix if d i j = 0 when i j . Hence, D can be represented in terms of its diagonal entries using the notation D : = diag ( d i ) i 1 , where d i : = d i i for i 1 .
The matrices introduced in Definition 1 have a particular block sign structure that can be captured using a sign matrix. Sign matrices are diagonal matrices S : = diag ( s i ) i 1 such that s i { 1 , 1 } . We will consider the particular case S r : = diag ( s i ) i 1 where s i = ( 1 ) i 1 r . Then, we have the following characterization of infinite matrices with a block checkerboard sign pattern.
Proposition 1.
Given an infinite matrix B : = ( b i j ) i , j 1 , B has a block checkerboard sign pattern with blocks of size r × r if and only if S r B S r : = ( s i b i j s j ) i , j 1 is a non-negative matrix.
We can build finite matrices with a block checkerboard sign pattern by taking principal submatrices with consecutive indices from the infinite matrices given by Definition 2.
Definition 2.
We say that A : = ( a i j ) 1 i , j n is an r-checkerboard matrix if, given r 1 , A = B [ α ] for some sequence α Q n with d ( α ) = 0 and for some infinite matrix B : = ( b i j ) i , j 1 with a block checkerboard sign pattern given by (2).
An r-checkerboard matrix A can be identified in terms of an n × n sign matrix K. In this case, the sign matrix would be given by K : = S r [ α ] , where α is the sequence of indices for which A satisfies Definition 2. For this sign matrix K, we have that K A K 0 as a consequence of Proposition 1. Thanks to this property, we can deduce, for r-checkerboard matrices, some analogous results to the well-known Perron–Frobenius theorems.
Theorem 1
(cf. p. 26 in [14]). If A : = ( a i j ) 1 i , j n is a non-negative square matrix, then the following apply:
1. 
The spectral radius of A, ρ ( A ) , is an eigenvalue of A;
2. 
A has a non-negative eigenvector that corresponds to ρ ( A ) .
Theorem 1 gives important information about non-negative matrices. For the case of r-checkerboard matrices, this result provides the following corollary.
Corollary 1.
If A : = ( a i j ) 1 i , j n is an r-checkerboard matrix with an associated sign matrix K, then the following apply:
1. 
The spectral radius of A, ρ ( A ) , is an eigenvalue of A;
2. 
A has an eigenvector v that corresponds to ρ ( A ) such that K v is non-negative.
Proof. 
Since K A K 0 , ρ ( K A K ) is an eigenvalue of K A K by Theorem 1. The fact that K = K 1 implies that A and K A K are similar matrices and that they have the same eigenvalues. Hence, ρ ( A ) is an eigenvalue of A. By condition 2 of Theorem 1, K A K w = ρ ( A ) w for a non-negative vector w. Hence, A K w = ρ ( A ) K w , and v : = K w is an eigenvector corresponding to ρ ( A ) such that K v 0 .    □

3. Checkerboard Matrices and Bidiagonal Decomposition

In the previous section, we have seen that r-checkerboard matrices are similar to non-negative matrices thanks to sign matrices K. This relationship allowed us to deduce some spectral properties for r-checkerboard matrices. In this section, we will consider a stronger property, i.e., that K A K is a nonsingular TP matrix. In that case, we obtain many interesting properties for this class of matrices, as well as the possibility of achieving accurate computations for solving many of the most common linear algebra problems with these matrices. The role of sign matrix K is fundamental. Let us start with the simplest case, which will showcase an important property of nonsingular TP matrices.

3.1. Checkerboard Pattern Matrices

Our first example of a sign matrix is n × n diagonal matrix J : = diag ( ( 1 ) i 1 ) 1 i n , that is, the matrix associated to an alternating sign pattern. If A is a checkerboard pattern matrix, then matrix J A J is non-negative. For example, for the case n = 4 ,
A = + + + + + + + + .
For the particular case where J A J is a nonsingular TP matrix, we have that A 1 is also a nonsingular TP matrix (see Section 1 of [8]).

3.2. Two-Block Checkerboard Matrices

Now, we are going to focus on the 2 × 2 -block case. Let us introduce sign matrix K 2 , 1 : = diag ( ( 1 ) ( i 1 ) / 2 ) 1 i n . For example, for  n = 6 , we have that
K 2 , 1 = 1 1 1 1 1 1
The sign structure associated to K 2 , 1 is formed by alternating 2 × 2 blocks of entries with the same sign. A 2-checkerboard matrix A with a block sign structure associated to K 2 , 1 would be as follows:
A = + + + + + + + + + + + + + + + + + + + + .
Let us now define the counterpart to K 2 , 1 , i.e., sign matrix K 2 , 0 = diag ( ( 1 ) i / 2 ) 1 i n . For example, for  n = 6 , it takes the form
K 2 , 0 = 1 1 1 1 1 1 .
Once again, the associated sign structure to K 2 , 0 is formed by alternating 2 × 2 blocks of entries with the same sign (leaving the first row and column as special cases). Hence, a 2-checkerboard matrix A with this pattern would be of the form
A = + + + + + + + + + + + + + .

3.3. r-Block Checkerboard Matrices

Let us now extend the study to more general block structures: blocks with size r × r . In this case, the sign matrix of an r-checkerboard matrix A takes the form K r , t = d i a g ( ( 1 ) i + t r ) 1 i n for some t = 1 , , r 2 , where t depends on sequence α given by Definition 2. We are particularly interested in the case where r-checkerboard matrix A satisfies that K r , t A K r , t is a nonsingular TP matrix. For this class of matrices, a parametrization that ensures computations with high relative accuracy is achieved through bidiagonal factorization.
Definition 3.
Let A : = ( a i j ) 1 i , j n be an r-checkerboard matrix such that K r , t A K r , t 0 for some t = 1 , , r 2 . Then, we say that A is a K r , t -checkerboard matrix if K r , t A K r , t is nonsingular TP.
In this case, we have r different sign structures depending on the size of the block appearing on the upper left-hand corner of the matrix.

3.4. Bidiagonal Decomposition and SBD Matrices

Now, we will introduce the representation of a matrix in terms of bidiagonal decomposition. This factorization gives a unique representation of a nonsingular TP matrix that can be used to achieve many computations with HRA with this class of matrices.
Theorem 2
(cf. Theorem 4.2 of Chapter 7 of [10]). Let A be a nonsingular n × n TP matrix. Then, A admits factorization as
A = F n 1 F 1 D G 1 G n 1 ,
where F i and G i , i { 1 , , n 1 } , are non-negative bidiagonal matrices defined by
F i = 1 0 1 0 1 m i + 1 , 1 1 m n , n i 1 , G i T = 1 0 1 0 1 m ˜ i + 1 , 1 1 m ˜ n , n i 1 ,
and D = d i a g ( p 11 , , p n n ) with p i i > 0 for i = 1 , , n . Moreover, if  m i j and m ˜ i j fulfill the conditions
m i j = 0 m h j = 0 h > i
and
m ˜ i j = 0 m i k = 0 k > j ,
then the factorization defined by (5) and (6) is unique.
The bidiagonal decomposition given by Theorem 2 represents a TP matrix in terms of n 2 parameters. These parameters can be stored in an n × n matrix according to the notation introduced in [15], where BD ( A ) represented the bidiagonal decomposition of nonsingular TP matrix A:
( BD ( A ) ) i j = m i j , if i > j , m ˜ j i , if i < j , p i i , if i = j .
Let us denote by ε a vector whose entries are only + 1 or 1 , that is, ε : = ( ε 1 , , ε m ) with ε j { 1 , 1 } for all j = 1 , , m . This vector is called a signature. Based on the sign structure defined by the signature, in [16], a new class of matrices that admits a signed bidiagonal decomposition was introduced as an extension of nonsingular TP matrices that admit a unique bidiagonal decomposition. This class was called SBD matrices.
Definition 4.
Given a signature ε : = ( ε 1 , , ε n 1 ) and a nonsingular n × n matrix A, we say that A has a signed bidiagonal decomposition with signature ε if there exists a BD ( A ) such that the following apply:
1. 
d i > 0 for all i = 1 , , n .
2. 
m i j ε i 1 0 , and m ˜ j i ε j 1 0 for all 1 i , j n .
We say that A is an SBD matrix if it has a signed bidiagonal decomposition for some signature ε.
We will represent the bidiagonal decomposition of SBD matrices using the notation in (7). We can define a sign diagonal matrix K : = diag ( k 1 , , k n ) associated to signature vector ε such that k i { 1 , 1 } for all i = 1 , , n and k i k i + 1 = ε i for all i = 1 , n 1 . Let us observe that there are only two possible sign matrices K for any given ε , defined by either k 1 = ε 1 or k 1 = ε 1 . Hence, we can univocally identify ε with a sign matrix K such that k 1 = + 1 . We can also characterize SBD matrices in terms of sign matrices K.
Proposition 2
(Corollary 3.2 of [16]). Let A be an n × n nonsingular matrix. Then, A has a signed bidiagonal decomposition if and only if there exists a diagonal matrix K = diag ( k 1 , , k n ) with k i { 1 , 1 } for all i = 1 , , n such that K A K = | A | is a TP matrix, where | A | represents a matrix whose entries are the absolute values of the corresponding entries of A.
This proposition implies that K r , t -checkerboard matrices are SBD matrices for the signature vector associated to sign matrix K r , t . Hence, K r , t -checkerboard matrices can be represented in terms of a bidiagonal decomposition according to Definition 4. For these matrices, the associated signature vector is ε k , t = ( ε j ) j = 1 n 1 , where
ε j = 1 , if j = i k t 1 for i = 1 , , n k , + 1 , otherwise .
For a general K r , t -checkerboard matrix, the signature vector of its inverse is given by ε k , t (see Theorem 3.1 of [16]). Hence, the sign structure of their inverses is related to the sign blocks appearing in the K r , t -block checkerboard matrices, and the following apply:
  • If we look at the blocks appearing in the principal diagonal of the matrix, the interior of the blocks of positive entries breaks into 1 × 1 positive blocks when we compute the inverse.
  • The 2 × 2 diagonal blocks that have positive diagonal entries and negative off-diagonal entries (corresponding to the end of a positive diagonal block and the start of the next one) turn into 2 × 2 blocks of positive entries when computing the inverse.
In order to check this behavior, we should look at the signature vector associated to diagonal matrix K r , t . By Theorem 3.1 of [16], a matrix is SBD with signature ε if and only if its inverse is SBD with signature ε . For the case of K r , t -checkerboard matrices, their inverses are SBD matrices with signature ε k , t . The negative entries in the signature vector imply that there is a change of sign in the associated sign matrix; hence, only 1 × 1 blocks of positive entries appear in the principal diagonal of the inverse matrix. The only positive entries of the signature vector appear for the indices j = i k t 1 for i = 1 , , n k , which implies that the sign matrix has two entries with the same sign; therefore, at those positions, we find 2 × 2 blocks of positive entries.
For example, for  k = 3 and t = 1 , we have that the sign matrix of the inverse is K 3 , 1 i n v = diag ( 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , ) . If we consider an 8 × 8 r-checkerboard matrix A with the sign structure given by K 3 , 1 , we have that
  • Mathematics 12 00853 i001
  • where the black squares denote the diagonal blocks of positive entries. The dashed-line squares show how the interior of these blocks break into 1 × 1 blocks and the 2 × 2 blocks appearing when a positive block finishes and the next one starts. Hence, the sign structure of the inverse would be as follows:
  • Mathematics 12 00853 i002
For the particular case of 2-checkerboard matrices, we have that the two only possibilities for sign patterns are closely related. For a K 2 , 1 -checkerboard matrix, the associated signature would be ε 2 , 1 = ( + 1 , 1 , + 1 , 1 , ( 1 ) n 2 ) . For a K 2 , 0 -checkerboard matrix, its signature is ε 2 , 0 = ( 1 , + 1 , 1 , + 1 , ( 1 ) n 1 ) . Hence, we have that ε 2 , 1 = ε 2 , 0 , and we can obtain the following result by Theorem 3.1 of [16].
Corollary 2.
The inverse of a K 2 , 1 -checkerboard matrix is a K 2 , 0 -checkerboard matrix.
Proof. 
If A is a K 2 , 1 -checkerboard matrix, then by Proposition 3.4, A is SBD with signature ε 2 , 1 . By Theorem 3.1 of [16], a matrix is SBD with signature ε if and only if its inverse is SBD with signature ε . Therefore, A 1 is SBD with signature ε 2 , 1 = ε 2 , 0 , which implies, by Proposition 3.4, that K 2 , 0 A 1 K 2 , 0 is nonsingular TP; so, A 1 is a K 2 , 0 -checkerboard matrix.    □

4. Bidiagonal Decomposition of Checkerboard Matrices

Given a K r , t -checkerboard matrix A, we can multiply it from left and right by sign matrix K r , t to obtain a nonsingular TP matrix. Hence, their bidiagonal decompositions are related by the following formula:
| A | = K r , t A K r , t = K r , t F n 1 F 1 D G 1 G n 1 K r , t = ( K r , t F n 1 K r , t ) ( K r , t F 1 K r , t ) ( K r , t D K r , t ) ( K r , t G 1 K r , t ) ( K r , t G n 1 K r , t ) .
If we know the bidiagonal decomposition of nonsingular TP matrix K r , t A K r , t = | A | , we can obtain the bidiagonal decomposition of A thanks to formula (9). This formula also allows us to apply some of the HRA algorithms known for nonsingular TP matrices to this class of matrices, according to [16]. For nonsingular TP matrices, accurate computations can be achieved using bidiagonal decomposition (Theorem 2) as a parametrization. In [13,15], Plamen Koev designed algorithms to solve various linear algebra problems with nonsingular TP matrices with HRA by taking the bidiagonal decomposition as input. These algorithms have been implemented and are available in the library TNTool for use in Matlab and Octave. This library also contains later contributions by other authors and can be downloaded from Koev’s personal website [17]. For  K r , t -checkerboard matrices, we can perform the following:
  • Computing the eigenvalues of | A | with HRA with the function TNEigenvalues in TNTool. The eigenvalues of A are the same, since they are similar matrices.
  • Computing the singular values of | A | with HRA using the function TNSingularValues. These singular values are also equal to the singular values of A, since | A | and A coincide up to unitary matrices.
  • Computing the inverse of | A | with HRA with the function TNInverseExpand presented in Section 4 of [6] and available in TNTool. Then, we can obtain the inverse of A with HRA, since A 1 = K r , t | A | 1 K r , t .
  • Solving the system of linear equations A x = b with HRA whenever K r , t b has an alternating pattern of signs, since A x = b is equivalent to K r , t A K r , t ( K r , t x ) = K r , t b , i.e.,  | A | y = K r , t b , where y = K r , t x , using the function TNSolve.

5. Intervals of Checkerboard Matrices

This section will present a result on intervals of checkerboard matrices. Given diagonal matrix J and two n × n matrices B and C, we can define the checkerboard ordering associated to J, * . We say that B * C if J B J J C J , where ≤ is the usual entry-wise inequality between two matrices. This ordering has proven to be quite useful in characterizing intervals of TP matrices. In [18], the following theorem, which identifies intervals of nonsingular TP matrices, was proven.
Theorem 3.
Let B and C be n × n nonsingular TP matrices satisfying B * C , i.e.,  J B J J C J . If A is an n × n matrix such that B * A * C , then A is nonsingular TP.
This idea has been extended to find orderings associated to SBD matrices in [19], and here, we analyze orderings for the case of checkerboard matrices. If a given n × n matrix A is a K r , t -checkerboard matrix, we know that K r , t A K r , t is nonsingular TP. Hence, we define the following ordering for K r , t -checkerboard matrices.
Definition 5.
Given two n × n matrices, A and B, we define the ordering r , t as A r , t B if J K r , t A K r , t J J K r , t B K r , t J .
Now, we present a result on intervals of K r , t -checkerboard matrices based on the ordering r , t .
Proposition 3.
Let B and C be n × n K r , t -checkerboard matrices satisfying B r , t C , i.e.,  J K r , t B K r , t J J K r , t C K r , t J . If A is an n × n matrix such that B r , t A r , t C , then A is a K r , t -checkerboard matrix.
Proof. 
Since B and C are K r , t -checkerboard matrices, we have that K r , t B K r , t and K r , t C K r , t are nonsingular TP matrices that satisfy J ( K r , t B K r , t ) J J ( K r , t A K r , t ) J J ( K r , t C K r , t ) J for an n × n matrix A. Hence, by Theorem 3, K r , t A K r , t is a nonsingular TP matrix, or equivalently, A is a K r , t -checkerboard matrix.    □

6. Integer Examples

Many examples of TP matrices are ill conditioned. For instance, the symmetric Pascal matrix, whose ( i , j ) -th entry is the binomial coefficient i + j 2 j 1 is a well-known example of ill-conditioning. However, the symmetric Pascal matrix admits a really simple representation in terms of the bidiagonal decomposition: all the nonzero entries of this factorization are ones. Hence, many linear algebra problems can be solved accurately with the Pascal matrix if we use algorithms that take the bidiagonal decomposition as input.
In this section, we are going to illustrate some examples of r-checkerboard matrices that admit an easy representation in terms of bidiagonal decomposition with integer entries.

6.1. Generalized Pascal Matrix

Our first example comes from an extension of the Pascal matrix depending on a parameter x R . The generalized K r , t -checkerboard Pascal matrix of the first kind, S P n [ x ] , is defined as the triangular matrix
( S P n [ x ] ) i j = ( 1 ) i + t r + j + t r x i j i 1 j 1 , i j
and the symmetric generalized Pascal matrix, S R n [ x ] , is defined as
( S R n [ x ] ) i j = ( 1 ) i + t r + j + t r x i + j 2 i + j 2 j 1 .
These matrices are the signed counterparts of the generalized Pascal matrix, P n [ x ] : = | S P n [ x ] | , and the symmetric generalized Pascal matrix, R n [ x ] : = | S R n [ x ] | (see [20]). Their bidiagonal decomposition are
( BD ( S P n [ x ] ) ) i j = 1 , if i = j , ε i 1 x , if i > j , 0 , if i < j .
( BD ( S R n [ x ] ) ) i j = x 2 ( i 1 ) , if i = j , ε i 1 x , if i > j , ε j 1 x , if i < j ,
respectively, where ε i = ± 1 is given by (8) for i = 1 , , n 1 . For the case x Z , we have that these are examples of integer matrices.

6.2. Matrices of Stirling Numbers

Our next example comes from matrices of Stirling numbers. The Stirling numbers of the first kind ( s i , j ) are the coefficients of the expansion of the falling factorial ( x ) n = k = 0 n 1 ( x k ) , i.e.,  ( x ) n = k = 0 n s n , k x k , where ( x ) n = k = 0 n 1 ( x k ) . Let us recall that the Stirling numbers of the first kind can be calculated using the following recurrence relation:
s n + 1 , k = s n , k 1 n · s n , k ,
where s 00 = 1 , s n 0 = 0 for n > 0 , and s 0 k = 0 for k > 0 . Then, matrix S = ( s i j ) 1 i , j n is a K 1 , 1 -checkerboard matrix whose bidiagonal decomposition is given by
( BD ( S ) ) i j = 1 , i = j , ( i j ) , i > j , 0 , otherwise .
Matrix S is the inverse of a nonsingular TP matrix. That TP matrix is precisely the matrix whose entries are Stirling numbers of the second kind. Let us recall that the Stirling number of the second kind, b n , k , counts the different partitions of a set of n elements into k non-empty subsets. Hence, these numbers can be obtained by using the recurrence relation
b n + 1 , k = b n , k 1 + k · b n , k ,
with the initial conditions b 00 = 1 , b n 0 = 0 for n > 0 , and b 0 k = 0 for k > 0 . Then, matrix B = ( b i j ) 1 i , j n is a nonsingular TP matrix whose bidiagonal decomposition takes the following form:
( BD ( B ) ) i j = 1 , i = j , j , i > j , 0 , otherwise .

7. Numerical Experiments

In [13], Koev introduced methods to calculate the eigenvalues and the singular values of A and the solution of linear systems of equations A x = b , where b has a pattern of alternating signs from the parameterization BD ( A ) for the case where A is a TP matrix. These algorithms provide approximations to the solutions of these algebraic problems with HRA if BD ( A ) is obtained with HRA. In addition, in [6], Marco and Martínez developed an algorithm to calculate, with HRA, the inverse A 1 under the same previous hypotheses. In the software library TNTool, available in [17], these four algorithms are implemented with Matlab. The names of the corresponding functions are TNEigenvalues, TNSingularValues, TNInverseExpand, and TNSolve. They require, as input argument, bidiagonal decomposition BD ( A ) of A, given by (7), with HRA. In addition, TNSolve needs vector b of the system of linear equations A x = b as a second argument. Regarding computational cost, the algorithms are at least as fast as the usual algorithms for solving these algebraic problems, as shown in the following:
  • TNInverseExpand and TNSolve have both a computational cost of O ( n 2 ) elementary operations.
  • TNEigenValues and TNSingularValues both require O ( n 3 ) elementary operations.
In order to illustrate the theoretical results, we considered the square matrices S R n [ 1 / 2 ] of order n = 5 , 10 , , 50 defined by (10), i.e.,
( S R n [ 1 / 2 ] ) i j = ( 1 ) i 1 2 + j 1 2 1 2 i + j i + j j .
Table 1 shows the condition numbers k ( A ) : = A A 1 of these matrices. It can be observed that these matrices are very ill conditioned. So, accurate results cannot be expected when using the usual algorithms for solving algebraic problems with them.
It can be observed that S R n [ 1 / 2 ] is a K r , t -checkerboard matrix. In particular, it can be seen that K 2 , 1 ( S R n [ 1 / 2 ] ) K 2 , 1 = R n [ 1 / 2 ] > 0 , where R n [ 1 / 2 ] is the symmetric generalized Pascal matrix defined by the absolute value of (10) for x = 1 / 2 and K 2 , 1 is the order n matrix given by (4). Since R n [ 1 / 2 ] is a TP matrix, taking into account the discussion in Section 4, the singular values and the inverse of S R n [ 1 / 2 ] , as well as the solution of systems S R n [ 1 / 2 ] x = b , whenever K 2 , 1 b has an alternating pattern of signs, can be computed with HRA. Observe that since R n [ 1 / 2 ] is a symmetric matrix, the eigenvalues and the singular values of R n [ 1 / 2 ] coincide. Since K 2 , 1 1 = K 2 , 1 , the same applies to matrices S R n [ 1 / 2 ] .
The bidiagonal decomposition ( BD ( R n [ x ] ) ) of a generalized symmetric Pascal matrix R n [ x ] can be computed with HRA for all x > 0 by (11) (taking the case where ε j = 1 for j = 1 , , n 1 ). We implemented the algorithm for the computation of this bidiagonal decomposition in the Matlab function TNBDGPascalSym.
First, by using TNBDGPascalSym in Matlab, we calculated the bidiagonal decomposition ( BD ( R n [ 1 / 2 ] ) ) with high relative accuracy. Then, we computed approximations to the singular values of R n [ 1 / 2 ] by using TNSingularValues with BD ( R n [ 1 / 2 ] ) as input argument. Approximations to these singular values were also obtained with the Matlab function svd. In order to illustrate the accuracy of the approximations to the singular values computed by the two methods, the singular values of S R n [ 1 / 2 ] were also calculated with Mathematica using a precision of one hundred digits. Then, the relative errors for the approximations to the singular values obtained by both methods were computed, taking the singular values obtained with Mathematica as the exact singular values. These relative errors showed that the approximations of all the singular values calculated by using TNBDGPascalSym are highly accurate and that the approximations of the lower singular values computed by using the Matlab function svd are not very accurate. It was also observed that the lower the singular value is, the less accurate the approximation provided by svd is. To demonstrate this fact, the relative errors of the approximations to the smallest singular value of the considered examples ( S R n [ 1 / 2 ] , n = 5 , 10 , , 50 ), obtained by both svd and TNSingularValues, are shown in Figure 1. From the results in that figure, it can be concluded that our method produces very accurate results, as opposed to the inaccurate results obtained with svd.
Approximations to ( S R n [ 1 / 2 ] ) 1 , n = 5 , 10 , , 50 , were also obtained by using Matlab with inv and by using TNInverseExpand together with TNBDGPascalSym. The exact inverses, ( S R n [ 1 / 2 ] ) 1 , were obtained with Mathematica using exact arithmetic. Then, the corresponding component-wise relative errors were computed. The mean relative errors are shown in Figure 2a, and the maximum relative errors are shown in (b). In this case, it is also clear that the accuracy of the results provided by TNInverseExpand is significantly better than that of the results provided by inv.
Finally, we considered the systems of linear equations S R n [ 1 / 2 ] x = b n , n = 5 , 10 , , 50 such that K 2 , 1 b n has an alternating pattern of signs and with entries whose absolute value is an integer randomly chosen in the interval [ 1 , 1000 ] . Then, approximations to the solution of these linear systems were computed in two ways: the first one, by using the Matlab command A\b, and the second one, by solving the system | S R n [ 1 / 2 ] | y = K 2 , 1 b n with TNSolve and then computing the solution of the original system as x = K 2 , 1 y . The exact solutions of these systems were computed with Mathematica; then, the component-wise relative errors for both approximations were calculated. The mean relative errors are shown in Figure 3a, and the maximum relative errors are shown in (b). The results obtained with the HRA algorithms are much better from the point of view of accuracy than the results obtained with the usual Matlab method.
In order to compare the computation time of the HRA methods with that of the usual methods, we solved the three algebraic problems considered in this section for S R 50 [ 1 / 2 ] one hundred times. Table 2 shows the average computation time for each one of the algebraic problems.

8. Conclusions

We introduce the class of block checkerboard pattern matrices, which are matrices with a regular pattern of signs for which a generalized Perron–Frobenius type theorem is satisfied. We consider bidiagonal decomposition of checkerboard matrices for achieving linear algebra computations with high relative accuracy (HRA). These HRA computations include the calculation of all eigenvalues and all singular values, the calculation of the inverses, and the solution of some associated linear systems. We also introduce a new order relation for matrices, deriving a result on intervals of block checkerboard matrices. We present new families of matrices with integer entries, which can be used as test matrices to check the accuracy of linear algebra algorithms. Numerical examples illustrate the accuracy of the presented methods compared with standard methods for the abovementioned linear algebra computations.

Author Contributions

J.D., H.O. and J.M.P. authors contributed equally to this research paper. All authors have read and agreed to the published version of the manuscript.

Funding

This research was partially supported under the Spanish research grants PID2022-138569NB-I00 and RED2022-134176-T (MCIU/AEI) and by Gobierno de Aragón (E41_23R).

Data Availability Statement

Data are contained within the article. Further inquiries can be directed to the corresponding author.

Conflicts of Interest

The authors declare no conflicts of interest.

Abbreviations

The following abbreviations are used in this manuscript:
TPTotally positive
HRAHigh relative accuracy

References

  1. Demmel, J.; Dumitriu, I.; Holtz, O.; Koev, P. Accurate and efficient expression evaluation and linear algebra. Acta Numer. 2008, 17, 87–145. [Google Scholar] [CrossRef]
  2. Demmel, J.; Gu, M.; Eisenstat, S.; Slapnicar, I.; Veselic, K.; Drmac, Z. Computing the singular value decomposition with high relative accuracy. Linear Algebra Appl. 1999, 299, 21–80. [Google Scholar] [CrossRef]
  3. Demmel, J.; Koev, P. The accurate and efficient solution of a totally positive generalized Vandermonde linear system. SIAM J. Matrix Anal. Appl. 2005, 27, 142–152. [Google Scholar] [CrossRef]
  4. Marco, A.; Martínez, J.J. A fast and accurate algorithm for solving Bernstein-Vandermonde linear systems. Linear Algebra Appl. 2007, 422, 616–628. [Google Scholar] [CrossRef]
  5. Marco, A.; Martínez, J.J. Accurate computations with Said-Ball-Vandermonde matrices. Linear Algebra Appl. 2010, 432, 2894–2908. [Google Scholar] [CrossRef]
  6. Marco, A.; Martínez, J.J. Accurate computation of the Moore-Penrose inverse of strictly totally positive matrices. J. Comput. Appl. Math. 2019, 350, 299–308. [Google Scholar] [CrossRef]
  7. Marco, A.; Martínez, J.J.; Viaña, R. Accurate bidiagonal decomposition of totally positive h-Bernstein-Vandermonde matrices and applications. Linear Algebra Appl. 2019, 579, 320–335. [Google Scholar] [CrossRef]
  8. Ando, T. Totally positive matrices. Linear Algebra Appl. 1987, 90, 165–219. [Google Scholar] [CrossRef]
  9. Gantmacher, F.P.; Krein, M.G. Oscillation Matrices and Kernels and Small Vibrations of Mechanical Systems: Revised Edition; AMS Chelsea Publishing: Providence, RI, USA, 2002. [Google Scholar]
  10. Gasca, M.; Micchelli, C.A. (Eds.) Total Positivity and Its Applications, Volume 359 of Mathematics and Its Applications; Kluwer Academic Publishers Group: Dordrecht, The Netherlands, 1996. [Google Scholar]
  11. Karlin, S. Total Positivity; Stanford University Press: Stanford, CA, USA, 1968; Volume I. [Google Scholar]
  12. Pinkus, A. Totally Positive Matrices; Tracts in Mathematics; Cambridge University Press: Cambridge, UK, 2010; Volume 181. [Google Scholar]
  13. Koev, P. Accurate computations with totally nonnegative matrices. SIAM J. Matrix Anal. Appl. 2007, 29, 731–751. [Google Scholar] [CrossRef]
  14. Berman, A.; Plemmons, R.J. Nonnegative Matrices in the Mathematical Sciences; Society for Industrial and Applied Mathematics: Philadelphia, PA, USA; Academic Press: Cambridge, MA, USA; Harcourt Brace Jovanovich, Publishers: New York, NY, USA; London, UK, 1979. [Google Scholar]
  15. Koev, P. Accurate eigenvalues and SVDs of totally nonnegative matrices. SIAM J. Matrix Anal. Appl. 2005, 27, 1–23. [Google Scholar] [CrossRef]
  16. Barreras, A.; Peña, J.M. Accurate computations of matrices with bidiagonal decomposition using methods for totally positive matrices. Numer. Linear Algebra Appl. 2013, 20, 413–424. [Google Scholar] [CrossRef]
  17. Koev, P. Available online: http://www.math.sjsu.edu/~koev/software/TNTool.html (accessed on 16 January 2024).
  18. Adm, M.; Garloff, J. Intervals of totally nonnegative matrices. Linear Algebra Appl. 2013, 439, 3796–3806. [Google Scholar] [CrossRef]
  19. Barreras, A.; Peña, J.M. Intervals of structured matrices. In Monogr. Mat. García Galdeano; Prensas Universitarias de Zaragoza: Zaragoza, Spain, 2016; Volume 40, pp. 21–27. [Google Scholar]
  20. Delgado, J.; Orera, H.; Peña, J.M. Accurate bidiagonal decomposition and computations with generalized Pascal matrices. J. Comput. Appl. Math. 2021, 391, 113443. [Google Scholar] [CrossRef]
Figure 1. Relative errors for the smallest singular value of S R n [ 1 / 2 ] .
Figure 1. Relative errors for the smallest singular value of S R n [ 1 / 2 ] .
Mathematics 12 00853 g001
Figure 2. Relative errors for ( S R n [ 1 / 2 ] ) 1 , n = 5 , 10 , , 50 .
Figure 2. Relative errors for ( S R n [ 1 / 2 ] ) 1 , n = 5 , 10 , , 50 .
Mathematics 12 00853 g002
Figure 3. Relative errors for the linear systems S R n [ 1 / 2 ] x = b n , n = 5 , 10 , , 50 .
Figure 3. Relative errors for the linear systems S R n [ 1 / 2 ] x = b n , n = 5 , 10 , , 50 .
Mathematics 12 00853 g003
Table 1. Condition numbers of S R n [ 1 / 2 ] .
Table 1. Condition numbers of S R n [ 1 / 2 ] .
n k ( SR n [ 1 / 2 ] )
55.44 × 10 3
102.37 × 10 8
151.11 × 10 13
205.77 × 10 17
253.06 × 10 22
301.63 × 10 27
358.96 × 10 31
404.97 × 10 36
452.74 × 10 41
501.54 × 10 46
Table 2. Average computation time in seconds.
Table 2. Average computation time in seconds.
InverseLinear SystemSingular Values
HRA methods6.32 × 10 4 1.34 × 10 5 3.90 × 10 3
Usual methods2.06 × 10 4 1.95 × 10 4 8.07 × 10 5
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Delgado, J.; Orera, H.; Peña, J.M. Accurate Computations with Block Checkerboard Pattern Matrices. Mathematics 2024, 12, 853. https://doi.org/10.3390/math12060853

AMA Style

Delgado J, Orera H, Peña JM. Accurate Computations with Block Checkerboard Pattern Matrices. Mathematics. 2024; 12(6):853. https://doi.org/10.3390/math12060853

Chicago/Turabian Style

Delgado, Jorge, Héctor Orera, and J. M. Peña. 2024. "Accurate Computations with Block Checkerboard Pattern Matrices" Mathematics 12, no. 6: 853. https://doi.org/10.3390/math12060853

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop