Questions tagged [linear-algebra]
Questions on the algorithmic/computational aspects of linear algebra, including the solution of linear systems, least squares problems, eigenproblems, and other such matters.
976
questions
2
votes
1answer
80 views
Efficiently compute a projection matrix from Householders reflectors
Let $A \in \mathbb{R}^{m \times n}$ where $m \geq n$.
Let $B$ and $\tau$ be the result of applying LAPACK's dgeqrfp method (R on the upper right triangle, and the ...
-2
votes
0answers
30 views
C++ code Thomas algorithm for solving a pentadiagonal Ax=b
I am looking to solve Ax=b for x where A is pentadiagonal square matrix (elements on the upper and lower diagonals can however equal to zero) and x, b two vectors of the same size.
I used the code ...
3
votes
1answer
103 views
A notion of resolution in inverse problems
Suppose I have a linear inverse problem of the form:
\begin{align}
Ax=b
\end{align}
I would like to reconstruct $x$ from the measurement $b$ via the objective
$$\min_x\{\vert\vert Ax-b\vert\vert^2_2+\...
1
vote
0answers
56 views
Upper bound on condition number in linear preconditioning
I'm studying iterative methods for solving linear system, and I find the following setting in Wikipedia:
Consider a matrix splitting $A = M-N$, where $A,M,N$ are all symmetric and positive definite ...
6
votes
1answer
197 views
Efficiently computing $e^{tX}$ for many different values of $t$
Given an anti-Hermitian and sparse matrix $X$, I am using Python (NumPy and SciPy) to compute the matrix exponential $f(t) := e^{tX}$ for many values of $t$. The method I am currently using is to ...
2
votes
1answer
92 views
Numerical Linear Algebra: When to use Direct methods versus iterative methods to solve a linear system - for PDEs in particular
I am reading the Chapra and Canale book on numerical methods, and was working through the chapters on solving linear systems. Now the book goes through direct methods including Gaussian Elimination, ...
1
vote
0answers
61 views
Given an unpivoted form of Aasen's algorithm, how does one add pivoting?
I've implemented the version of Aasen's algorithm described in the book Matrix Computations 4th Edition. The version there doesn't have pivoting. The book's description of how to add pivoting is a bit ...
2
votes
1answer
56 views
How do I extract the output of Aasen's algorithm into a usable form?
I tried implementing the algorithm in Aasen's 1971 paper on factorizing symmetric indefinite matrices. I've translated the code verbatim from Algol into Python, and I used the test example given in ...
2
votes
1answer
81 views
Complexity of solving an image differential linear system
Define an "image differential linear system" as a linear system $A\mathbf{x}=\mathbf{b}$ wherein $\mathbf{x}$ contains the ($\mathbb{R}$) pixels of an image and each row of $A$ constrains ...
6
votes
1answer
159 views
Parallelize Scipy iterative methods for linear equation systems(bicgstab) in Python
I need to solve linear equations system Ax = b, where A is a sparse CSR matrix with size 500 000 x 500 000. I'am using scipy.bicgstab and it takes almost 10min to solve this system on my PC and I need ...
5
votes
1answer
186 views
Symmetric matrix which satisfies conditions of the form $v_i^T X v_i = 0$
I want to solve an underdetermined system of linear equations $A x = b$ with $A \in \mathbb{R}^{n \times r^2}, x \in \mathbb{R}^{r^2}, b \in \mathbb{R}^n$. The matrix $A$ has the following additional ...
0
votes
0answers
57 views
How to make a directed graph symmetric?
Say I have a directed graph given as an adjacency matrix $A$ in CSR format represented by the arrays ia (row indexes) and ja (...
3
votes
2answers
106 views
Equations that are easier to verify than to solve?
Are there interesting examples of (systems) of equations where it is known to be harder to find a solution (in terms of scaling with respect to problem size) than verifying a provided solution for ...
1
vote
1answer
76 views
Range of a matrix from its complete orthogonal decomposition
In this StackOverflow answer, @Gokul has shown how to get a basis of the kernel of a matrix with the help of the 'Eigen' function CompleteOrthogonalDecomposition. ...
1
vote
1answer
93 views
Factorization of cubic spline interpolation matrix
In cubic spline interpolation, we use the set of knots and function values $(x_i,y_i),i=1,...,n$ to construct a (tridiagonal) system of equations for the unknowns $\sigma_i$:
$$
h_{i-1}\sigma_{i-1} + ...
0
votes
0answers
47 views
Formula for overdetermined logical matrix pseudoinverse not requiring SVD?
In https://commons.wikimedia.org/wiki/File:YI_%3D_PI.png, you will find a formula-based solution for an overdetermined logical matrix pseudoinverse. This simple formula gives the same result as the ...
4
votes
1answer
72 views
Trace of inverse from LU decomposition
Given an LU decomposition of $A\in \mathbb{R}^{n\times n}$, is there a way to compute $\operatorname{trace}(A^{-1})$ with lower complexity than that of the inversion ($O(n^3)$ in practice)?
This ...
4
votes
0answers
52 views
Efficient computation of marginalized multivariate normal likelihood
In general,if we know that the marginal Gaussian distribution for some variable $\textbf{x}$ and a conditional Gaussian distribution for some $\textbf{y}|\textbf{x}$ of the forms:
$$p(\textbf{x}) = \...
3
votes
0answers
39 views
Choice of iterative solver for a sparse asymmetric matrix with symmetric structure
I have a sparse $nxn$ matrix A with pretty interesting structure. It has a block structure with symmetric structure but asymmetric blocks. Expressed mathematically $A_{jk} = A_{kj}$ but $A_{jk} \neq ...
2
votes
1answer
83 views
Diagonalization of Hermitian matrices vs Unitary matrices
What are the general algorithms used for diagonalization of large Hermitian matrices and Unitary matrices? ($>5000 \times 5000$)
LAPACK seems to diagonalize Hermitian matrices almost 20 times as ...
2
votes
0answers
81 views
Algorithm for computing inner products multiple times
I am taking a computational linear algebra course and i got stuck during a homework problem concerning the computation of inner products. I am supposed to compute the inner product:$$\mathrm{a}_{\...
4
votes
0answers
61 views
Optimize linear equation using inner products and subject to L1 norm
I have a linear system of the form $A x = b$ where $A$ and $b$ are known, $A$ is "square", and $\lvert b \rvert_1 = \lvert x \rvert_1 = 1$. Unfortunately, I am working in a framework that ...
2
votes
1answer
82 views
Efficient change of basis real positive definite symmetric matrix
I need to optimize a code where the most performance critical part is doing a 'change of basis', in other words it is an unitary similarity transformation on a big real positive definite symmetric ...
0
votes
0answers
65 views
Ill-conditioned stiffness matrix
I am writting a Fem code in c++ for a 2d plane stress model. My question is regarding the assembly stiffness matrix.I noticed that some elements of the matrix are not exactly zero but insted a number ...
1
vote
1answer
82 views
Jacobi iterative method
I'm using Jacobi iterative method for finding eigenvalue and eigenvector for hermitian or symmetric matrix. Eigenvectors corresponding to eigenvalues are not exact. The third eigenvector is totally ...
1
vote
0answers
25 views
Multiplying by E[xy'] where only some statistics of xy' are known
(cross-posted on crossvalidated)
For random variable $(x,y)$ in $\mathbb{R}^{d}\times \mathbb{R}^{d}$ and vector $v \in \mathbb{R}^d$, I need to perform the following matrix vector multiplication.
$$T(...
5
votes
0answers
119 views
Inverse problem with uncertain forward operator
Suppose I want to solve a linear inverse problem. In this example we take a convolution with the kernel:
$$\frac{1}{(y^2+z^2)^{3/2}}$$
We only take a fixed $z$ for the computation and convolve with ...
4
votes
1answer
127 views
When is it easy to invert a sparse matrix?
(Crossposted on cstheory.SE)
When is it easy to invert a sparse matrix? Specifically, I'm wondering about the cases in which matrix inversion has similar cost to sparse matrix multiplication, hence ...
2
votes
1answer
41 views
Solving MX=N where M is structured as a Gaussian 4th-moment tensor
I'm looking to solve numerically the following equation for $(d,d)$ variable $X$, in Einstein summation notation
$$M_{ijkl}X_{kl}=N_{ij}$$
Where $M$ is a $(d,d,d,d)$ 4th-moment tensor of random ...
2
votes
1answer
115 views
Ill-condioned Linear System and Gaussian Elimination
Suppose that I have a linear system $Ax=b$ such that $A$ is ill-conditioned. Can I say that it is dangerous to find a solution with Gaussian Elimination for this system, or does there exist some class ...
3
votes
2answers
160 views
1D FEM for nonlinear diffusion coefficient
I want to solve with linear finite elements the equation $$\partial_t u = \partial_{x}(a(u)\partial_xu)$$
in the domain $t \in [0,1]$ and $x \in [-L,L]$. Here $a(u)$ is just a function of $u$.
...
3
votes
1answer
95 views
Efficient solution to a structured symmetric linear system with condition number estimation
I have a real-valued linear system $Hx = b$ where $H$ is symmetric matrix** (not necessarily positive/negative definite) with a very particular structure:
$$
H = \begin{bmatrix} D && B \\ B^T &...
0
votes
0answers
45 views
Norm estimates if adjoints can't be computed
Assume that you have two linear maps $A$ and $V$. For a given $x$ (of appropriate dimension) you can compute $Ax$ numerically, and for any $y$ (of appropriate dimension) you can calculate $V^Ty$ ...
6
votes
1answer
563 views
Cheap recalculation of eigenvalues and eigenvectors for a low-rank update of the matrix
Suppose I have a correlation matrix, $A$, and I already have the eigenvalues and eigenvectors of this matrix.
For a given vector, $\mathbf{\mathit{v}}$, I want to calculate the eigenvalues and ...
3
votes
1answer
78 views
Runtime of Gaussian elimination/row reduction on an $m \times n$ matrix
The runtime of Gaussian elimination on an $n \times n$ matrix is $O(n^3)$. What is the runtime on an $m \times n$ matrix?
I am taking Gaussian elimination to mean putting the matrix in reduced row ...
1
vote
1answer
82 views
Frobenius norm of a binary matrix
In term of the mathematical distance measurement,
What is the significance of a Frobenius norm for a binary matrix?
1
vote
1answer
53 views
How to optimize nuclear norm subject to positive semidefinite constraints?
For finite dimensional symmetric positive semidefinite matrices $A$ and $B$, I would like to solve
\begin{align}&\min |X - A|_1 \\
&\text{subject to}\\
&X \preceq B \\
&0 \preceq X\...
0
votes
0answers
69 views
Derivative-free ill-conditioned non-linear least squares
I am looking for a package which can solve (non-linear) least squares problems without the use of derivatives (because of an expensive model), but which also deals with ill-conditioning well (such as ...
8
votes
5answers
498 views
Checking singularity of a matrix
Suppose that we don't know $n \times n$ matrix $A$ explicitly but we are only able to compute products $Ax$ where $x$ is a column vector with $n$ elements. Is there an algorithm to determine whether $...
1
vote
3answers
127 views
How to determine global stiffness matrix is constrained or not
Background
In solid fem, we often solve $$\mathbf{Ku}=\mathbf{p}$$
where $\mathbf{K}$ is global stiffness matrix, $\mathbf{u}$ is displacement, $\mathbf{p}$ is global load vector.
If displacement not ...
2
votes
1answer
96 views
Efficient projection of a vector onto matrix kernel
Given an $m \times n$ matrix $A$ and a vector $x\in\mathbb R^n$, with $m<n$, what's an efficient way of computing the projection of $x$ onto the kernel of $A$?
7
votes
2answers
280 views
Is there an iterative solver for dense matrices with possible zero diagonal entries?
Is there an iterative solver that can handle potentially zero entries on the central diagonal? I am implementing a polynomial fitting algorithm (up to $10^{th}$-order) and my matrix is a "...
2
votes
1answer
246 views
Solution of the linear system using Sherman-Morrison formula for 1000000x1000000 (7450.6GB) matrix using MATLAB
Let $n = 10^6.$ Let $A \in \mathbb{R}^{n\times n} $ be the lower triangular matrix having 1's on and below the main diagonal.
We want to solve the following linear system:
$$ (A + uv^T)x = b$$
by the ...
3
votes
0answers
102 views
Compute Nullspace of Sparse Matrix
I am computing the nullspace of a sparse rectangular $m$ x $n$ matrix $A$, where $m$ << $n$. I do this by computing the QR decomposition of $A^T$ and extract the $n-m$ right-most columns of the ...
3
votes
0answers
45 views
Numerical calculation of the Berry connection
I'm doing some numerical calculations involving Hermitian matrices, and derivatives of the eigenvectors.
Essentially, I have an n x n, Hermitian matrix H(x), which is dependent on some continuous ...
3
votes
0answers
88 views
Is the matrix exponential and the Jordan canonical form actually useful for solving differential equations?
All of my yearlong graduate-level Linear Algebra course notes from my professorāan algebraist/representation theoristāshows his love for the exponential map $e^A$ and the Jordan canonical formāand one ...
5
votes
1answer
94 views
Accurately Computing a Positive Vector in the Nullspace of a Matrix
I'm sure this question has been asked before yet after many hours of searching I am unable to find a definitive answer.
The problem at hand is solving the linear system: $$A \mathbf{x} = \mathbf{0}$$ ...
0
votes
0answers
86 views
A parallelized GMRES solver?
My application calls for solving a dense, 40,000 x 40,000, ill-conditioned linear system. The native SciPy GMRES solver with preconditioning has worked well for my application and solving a single ...
2
votes
0answers
74 views
Why is LAPACK (seemingly) suboptimal for packed and banded eigenvalue problems?
Based on this LAPACK routines list, it looks like there is no relatively robust representation (RRR) driver routine for either packed or banded symmetric eigenvalue problems. According to the relevant ...
1
vote
1answer
167 views
Is LAPACK behind the cutting edge of dense linear algebra?
I have been digging into some numerical linear algebra lately, and reading in particular about how LAPACK solves symmetric eigenvalue problems. I noticed that the ...