# Questions tagged [matrix]

Matrix is a rectangular array of elements (e.q. numbers, symbols, or expressions), arranged in columns and rows.

504 questions
Filter by
Sorted by
Tagged with
66 views

### Inverting really big symmetric block matrix

I have a really big symmetric 7.000.000 X 7.000.000 matrix that i would like to invert. The matrix is extremely sparse and it can be rearranged as to become a block matrix. The biggest blocks are ...
101 views

### Efficient ways to numerically evaluate matrix exponentials

What are some computationally efficient ways to solve matrix exponentials, i.e. functions of the form : f(X)=$e^{X}$, where X is a square matrix ? So far I have been able to diagonalise some ...
11k views

### why is A*v+B*v faster than (A+B)*v?

$A$ and $B$ are $n \times n$ matrices and $v$ is a vector with $n$ elements. $Av$ has $\approx 2n^2$ flops and $A+B$ has $n^2$ flops. Following this logic, $(A+B)v$ should be faster than $Av+Bv$. Yet,...
90 views

### How to know which LAPACK's function is used by Scipy's eig function?

As far as I understood, scipy.linalg.eig use wrappers from scipy.lapack to compute the eigenvalues and eigenvectors of a matrix. ...
35 views

### Find index for submatrix with maximum sum

Given an N-dimensional matrix A, I want to find an M<N dimensional index array I such ...
115 views

### Fastest way to calculate the $2$-norm (or an upper bound for the $2$-norm) of the inverse of a matrix $A\in \mathbb{C}^{N\times N}$

I have a matrix $A\in \mathbb{C}^{N\times N}$ and I need to calculate $||A^{-1}||_{2}$ efficiently. Can it be done without having to evaluate the inverse explicitly? In general, I am looking for ...
94 views

### What is the fastest algorithm for computing log determinant of a PSD matrix? (All possible PSD matrices)

I am diving into some literature to understand which is the best algorithm for computing the log-determinant of a PSD matrix. More generally, I am interested in a list of resources to read, which ...
88 views

### Numerical stability in the product of many matrices

I have to calculate in numpy the matrix-product of many matrices (~400). Are there common practices to increase numerical stability? If this is relevant, the matrices are $300\times 300$ orthogonal ...
66 views

### Calculate Transformation Matrix between two sensors

My question is if I can calculate the transformation matrix between two sensors. Each sensor provides a $4\times 4$ matrix for every timestep recorded. The sensors are moving and have some noise in ...
7k views

### How to prove the 2-norm of an invertible matrix is exactly the reciprocal of its minimum singular value?

If a matrix $A_{n\times n}$ is invertible, then $\left\|A^{-1}\right\|_2 = \dfrac{1}{\min\limits_{i} \sigma_i}$ where $\sigma_i$ is the $i$-th singular value of $A$
141 views

52 views

### implementation for coppersmith matrix multiplication

Is there any online implementation for the coppersmith matrix multiplication I have searched alot but can not find any? and if there is not any why is that Isn't this algotithm much faster than ...
86 views

39 views

### Inverses of many standard subspaces of one large matrix

i have a large rectangular invertible matrix M (about 5000x5000) and i have a loop in which i do the following for each iteration i (there are about 6000 iterations): i am given a subspace S_i (which ...
233 views

111 views

### Matrix condition number and reordering

Does the condition number change when a matrix is reordered by e.g. Cuthill Mckee or some other method?
26 views

### Minimize number of math operation of a specific matrix vector multiplication?

Let's say we have a Matrix M and a column vector v like below multiply equals Assume we can only perform multiplication, addition and substraction operation. With normal approach we need 3 ...
6k views

### cartesian products in numPy

Have two arrays, in my case $X = \{1,2,\dots, n\}$ or X = np.arange(n). How do I get $Y = X \times X = \{ [i,j]: 1 \leq i,j \leq n \}$ as a 2D array in numPy? ...
36 views

### numpy.outer without flatten

$x$ is an $N \times M$ matrix. $y$ is a $1 \times L$ vector. I want to return "outer product" between $x$ and $y$, let's call it $z$. z[n,m,l] = x[n,m] * y[l] ...
38 views

### Best way of porting code from the GPU to MPI-nodes

I have a program, structured in two parts, $A$ and $B$. Both parts are capable of running as standalone units, and written in C++. $A$ is written for cluster systems, running entirely on CPU-nodes, ...
57 views

### what does “D = diag(W.1)” means?

, what does “D = diag(W.1)” means?on page #2, just below equation (6) PFA screenshot and here is the link of the paper - original paper
85 views

### Fast algorithm for computing cofactor matrix

I wonder if there is a fast algorithm, say ($\mathcal O(n^3)$) for computing the cofactor matrix (or conjugate matrix) of an $N\times N$ square matrix. And yes, one could first compute its determinant ...
401 views

### Fast algorithm for computing matrix square root using randomized linear algebra?

Is there a fast algorithm for computing the matrix square root of a real symmetric matrix using random matrices or randomized algorithms?
31 views

### Randomized Submatrix of a Sparse Matrix

I have a sparse square matrix $A$ with size $n \times n$ and number of nonzero entries $nnz$. The goal is making a sub-matrix $B$ with $s$ nonzeros which are randomly chosen from $A$. Duplicates are ...
4k views

### Matlab element within ranges and distance between two points

I have a $53534\times 3$ matrix with $x$, $y$, and $z$ coordinates. I want to find the element of matrix within ranges as follows: ...
44 views

### Plotting ratings matrix

Hello fellows and folks. I have been looking to do this for 1 month and still cannot find the way to do it. Here’s what’s going on: I have a csv file called ratings.csv with the following ...
105 views

### BLAS operation question

I want to perform the following operation: $$A = A + U B^T$$ where $A$ is $m \times n$ dense, $U$ is $m \times m$ upper triangular, and $B$ is $n \times m$ dense. The BLAS function ...
62 views

### Computing excited states using itensor (with DMRG)

I am trying to compute first few excited states of some Hamiltonian (I am using itensor and its DMRG algorithm). To do so, I am ...
164 views

### Accurate way of getting the square root inverse of a positive definite symmetric matrix

What is the most accurate algorithm to get the square root inverse of a positive definite symmetric matrix? I am not looking as much for efficiency, though using quadruple precision computation is out ...
184 views

### Computing any element of the null space of a singular matrix

Given a singular matrix $A$, what is the fastest method to find a single non-zero solution to $Ax=0$? Note that we are not looking for the whole kernel, we just want any non-zero vector in it. I ...
824 views

### Testing if two 12x12 matrices have the same determinant

I am given a $12 \times 12$ matrix $Q$ that is symmetric, invertible, positive definite and dense. I need to test if $$\det(Q) = \det(12I-Q-J) \; \; (1)$$ where $J$ is the all ones matrix. I am ...
622 views

### Perron-Frobenius theorem on general real symmetric matrices

From the Perron-Frobenius theorem, it might be concluded that the spectral radius is the largest eigenvalue for positive matrices, ie, matrices with strictly positive entries. In other words, the ...
139 views

### Converting matrices L and U output by dgssv() of SuperLU to triples format

How can I convert matrices L and U output by dgssvx() of SuperLU to triples format (to ...
479 views

### Sparse matrix format and sparse-matrix sparse-matrix multiplication

I'm having some performance problems with my code dealing with the multiplication of big sparse matrices (stiffness and aerodynamic influence coefficient matrices). Mainly I have to multiply such ...
69 views

I have a matrix $A\in\{0,1\}^{d\times n}$ and $rank(A)=d,d<n$, and another matrix $X\in \mathbb{R}^{d\times n}$, but I do not know the rank of $X$. What can we say about the rank of their Hadamard ...
### Convexity of Sum of $k$-smallest Eigenvalue
If I have a real positive definite matrix $A\in\mathbb{R}^{n\times n}$, and denote its eigenvalues as $\lambda_1\leq \lambda_2 \leq ... \leq \lambda_n$. Define the function as \$f(A)=\sum_{i=1}^{k} \...