In linear algebra, an $m$x$n$ matrix maps vectors from space $R^m$ to $R^n$. Matrices are distinguished from multidimensional arrays, which is a general term for any rectangular array of information.

learn more… | top users | synonyms

1
vote
1answer
41 views

Convert Image of Map to 2D Grid in Python

I have this map showing the geography of Europe (below), and I wish to convert it to a matrix in python that would be a 2D approximation of this image where 0's would represent the ocean and 1's would ...
3
votes
0answers
56 views

Combinatorial algorithm problem of a symmetric matrix [migrated]

Given a matrix A of a strongly $k$ regular graph G(srg($n,k,\lambda,\mu$);$\lambda ,\mu >0;k>3$). The matrix A can be divided into 4 sub matrices based on adjacency of vertex $x \in G$. $A_x$ ...
-1
votes
1answer
37 views

Solving large system of equations, is linear programming best option?

I have a problem where I am trying to solve many systems of equations, that have very few variables per equation, but a lot of equations. For example potentially 10 variables max in a single ...
1
vote
2answers
71 views

How to use the basic Sparse matrix operations (multiplication, .etc) in PyCUDA

I try to use sparse matrix operations in GPU in Python and now try to use PyCUDA with theano. But I can't find how to do sparse matrix and vector multiplication. I only got an example showing how to ...
3
votes
1answer
149 views

Numerically stable approach for calculating x in Ax=b

I have an equation $Ax=b$ for which I need to solve for numerous $x$ matrices given $b$. Both $x$ and $b$ are nx1 matrices. Unfortunately, $A$ is a 32x32 matrix and inversion gives highly unstable ...
2
votes
1answer
110 views

Is my matrix symmetric?

I obtained a mass matrix through Finite Elements discretization. Now, I want to check if it is symmetric. To do that I subtract to my matrix $M$ its transposed $M^T$. The result is another matrix of ...
5
votes
0answers
55 views

How does an unpivoted QR fail to reveal rank?

An unpivoted QR factorization produces a triangular factor $R$. A rank-revealing QR factorization is typically done with column pivoting. My question is, how does an unpivoted QR factorization fail to ...
0
votes
1answer
66 views

Standard Algorithms for Permuting CCS or CRS Sparse Matrices

I need to permute the degrees of freedom of a system and apply this permutation to a few sparse matrices in CCS (or CRS) format. I could construct a permutation matrix and perform sparse matrix-matrix ...
4
votes
0answers
124 views

Alternative to (costly) matrix multiplication

Consider the integral $$2\pi T = -\frac{1}{2} \int_0^{2\pi} A\frac{\partial B}{\partial \xi} \ d\xi$$ where $$A= \sum_{-N}^N i \ sign(n) \ B_n e^{-in\xi}; \quad \quad B= \sum_{-N}^N \ B_n ...
0
votes
2answers
164 views

How to obtain a convergent solution iteratively for a linear system of equations? [closed]

I am working on a problem that requires an iterative procedure to solve a linear system of equations, the system of equations in matrix form is: $$\underbrace{\begin{bmatrix} r_{11} & r_{12} ...
0
votes
0answers
62 views

Implicit QR Algorithm

Its have been some days that I'm researching matrices eigenvalues and eigenvectors. The research led me to the Implicit QR Algorithm (Francis Algorithm), and in all the papers that I found, I cant ...
0
votes
0answers
102 views

Estimating the second largest eigenvalue

I am currently dealing with the following problem. I am given a matrix $A$ of order $n \times n$ where $n \leq 20.$ The principal $(n-1) \times (n-1)$ matrix of $A$ is symmetric and contains only ...
3
votes
1answer
65 views

Simple way to derive transpose of a vectorized operation

In a program I'm writing, I have a sub-routine that does some vectorized linear operations (specifically differentiation). Say for convenience I have defined the following inline function, which ...
0
votes
1answer
104 views
0
votes
1answer
78 views

Solve eigenvalue problem using finite differences without vectorization

I am interested in solving the problem $-A u = \lambda u$ on a finite differences grid on a square. In my case, the operator $A$ is of the type $-\Delta + \mu I$, where $\mu$ is there to impose some ...
4
votes
0answers
107 views

How big a matrix can we row reduce in reasonable time?

I have very large matrices that I would like to row reduce (I need to keep track of the steps and find a basis of the kernel/image, not just find the rank). The good news is that I work mod 2 and the ...
5
votes
1answer
127 views

What is a good way to take fractional powers of a matrix in MATLAB?

I am working on a problem that involves taking fractional powers of particular matrices. For the matrix A with 2 on the main diagonal and -1 on the sub and super diagonal (the finite difference ...
3
votes
1answer
387 views

Why is my MATLAB code for back-substitution slower than the backslash operator?

I wrote the code below to invert an upper triangular matrix, avoiding any possible multiplication/subtraction by zero. It just uses $\frac{1}{6}n^3+\ldots$ flops instead of $n^3+\ldots$ flops. ...
1
vote
3answers
164 views

Minimize quadratic form with equality constraints

I want to minimize function: $f(x) = x^T \cdot A \cdot x + b \cdot x$ given constraints: $B \cdot x = 0$. Here: $x$ is a vector ($x \in \mathbb{R}^n$), $A$ is a matrix of size $n \times n$, $b$ ...
2
votes
0answers
74 views

Does it matter if I use principal component analysis on the transpose instead of the original matrix?

My data set is a 60x10 matrix. I performed principal component analysis of this matrix with matlab using the princomp(AdjustedData) after I adjusting my original data set by subtracting the mean of ...
2
votes
1answer
222 views

Translate a 3D point along a heading

I need to translate a point (P1) in 3D a certain amount, call it stepSize, along a vector described by a heading composed of ...
0
votes
0answers
66 views

LU Factorization update when adding columns

I am looking for a way to update the LU factorization of a general $m \times n$ matrix after adding a column to the matrix. I have to iterate this procedure so I will begin with a matrix that is $m ...
0
votes
0answers
21 views

Updating the LU Factorization [duplicate]

I am looking for a way to update the LU factorization of a general m×n matrix after adding a column to the matrix. I have to iterate this procedure so I will begin with a matrix that is m×1 and go all ...
0
votes
1answer
43 views

Writing a 3D array from Petsc

I am trying to do something fairly simple somehow I have made it hard. Is there an example of how to send a 3D array to a binary file?
5
votes
2answers
247 views

Recommendations for symmetric preconditioner

Given symmetric, positive-definite matrix $A$ and its preconditioner $M^{-1}$. What's kind of preconditioner $M^{-1}$ which preserve the symmetry of $M^{-1}A$?
5
votes
1answer
190 views

Sparse matrix ordering in Python

I would like to implement custom, domain-specific algorithms for sparse matrix orderings. I am looking for Python packages for ordering sparse matrices. It would be nice to have: The underlying ...
7
votes
1answer
208 views

Algorithm to calculate the exponential of an Hessenberg matrix

I am interested in computing the solution of a lage system of ODEs using a krylov method as in [1]. Such method involve functions related to the exponential (the so-called $\varphi$-functions). It ...
0
votes
2answers
94 views

How to decrease computation time for symmetric matrices?

We all know the problem that computation time explodes when simulating systems with big matrices. I got just this problem, but I have the advantage that I know that my matrices are symmetric. My ...
3
votes
3answers
404 views

Fast vector - “diagonal” matrix multiplication

Let $\mathbf{1}\in\mathbb{R}^d$ be a vector with all elements equal to $1$. Define: $$\mathbf{D} = \mathrm{diag}(\mathbf{1}^\top,\mathbf{1}^\top,\ldots,\mathbf{1}^\top) = \begin{bmatrix} 1 \cdots 1 ...
1
vote
2answers
88 views

Rearrange a dense distance matrix to a 2x2 non-perfect block diagonal form

I have a distance matrix (square, symmetrical, non-negative, dense). I want to split the objects into two well-connected groups. Mathematically speaking, I want to group (re-arrange) the rows/columns ...
2
votes
3answers
477 views

fortran code-algorithm for qr decomposition of non-square matrix

I am trying to implement QR factorization of a non-square matrix in FORTRAN. I have the algorithm for a square matrix but not for a non-square. I use Housholder matrices. Do you know where I could ...
1
vote
1answer
100 views

LSA, SVD and the Frobenius norm

In Latent Semantic Analysis one uses the SVD to perform a dimensional reduction of the term-document matrix, via the Eckart-Young theorem. Now, the rank $k$ approximation obtained by E-Y is proven to ...
3
votes
3answers
300 views

Efficient solver for a symmetric tridiagonal system where the upper/lower diagonals are offset

I'm looking for an efficient way to solve a symmetric tridiagonal system $Mx = d$, where the upper and lower diagonals of $M$ are offset from the main diagonal by $k$ rows/columns: $$ \begin{bmatrix} ...
1
vote
1answer
104 views

oSVD and cSVD terms

In one article I faced with such terms as sSVD, cSVD and oSVD. As I understand sSVD - standart SVD, cSVD - svd for block-circulant matrices, but I can't find what is oSVD. 1) What is oSVD? 2) Can ...
2
votes
3answers
203 views

Dense distributed matrix

A dense matrix is distributed for parallel computation column-wise, then multiplied from left & right by sparse matrices. What would be appropriate c++ libraries for these tasks?
3
votes
2answers
193 views

Methods for solving linear systems

This is such a basic topic but there are so many different methods proposed for solving a linear system of equations. I recently found a very good source but couldn't really make sense of all the ...
2
votes
1answer
177 views

SVD and HITS Algorithm Power Iterations

As we know, computing the authority (or hub) score of HITS ranking method, means to use the following matrix equation: $$ \textbf{a}^{k}=A^T A\textbf{a}^{(k-1)} $$ and apply the power iteration ...
5
votes
0answers
101 views

Wanted: sequences of linear systems for recycling Krylov solver analysis

In the solution of sequences of linear systems $$A_ix_i=b_i\quad\text{for}\quad i=1,2,\dots$$ with Krylov subspace methods, data can be recycled from already solved linear systems in order to speed up ...
0
votes
2answers
168 views

What to do with singular (non-invertible) rotation matrix

I have an orthotropic material with a (6x1) stress vector known in the global coordinate system and yield surfaces known in a local coordinate system. So far I have only needed to convert from local ...
1
vote
1answer
43 views

detecting special $2 \times 2$ matrices in a large array of zeros and ones

I have a large array of zeros and ones and I need to count instances of 0 1 1 0 0 0 1 1 0 1, 1 0, 1 1, 0 0 And I would like to exclude all ...
4
votes
0answers
84 views

Tracking for two meshes

I'm dealing with physical simulation (position based dynamic). Now I'm trying to realize tracking for two meshes. In order to explain what does it mean, let's assume that we have two similar meshes: ...
3
votes
2answers
263 views

Solving Newton-Raphson step with ill-conditioned sparse matrix

I am trying to build a complex simulator for the transport of mass & heat in porous media. I am currently following coarsely the algorithm laid out in an older software and have got the simulator ...
1
vote
1answer
113 views

Problem with convergence of Jacobi iterative algorithm

I'm dealing with Jacobi iterative method for solving sparse system of linear equations. For small matrices it works well and gives right answers even if matrix is not strictly diagonal dominant, ...
1
vote
0answers
64 views

Efficient way to do congruent transformation using matrix inverse?

I know a square self-adjoint matrix $S_{vv}$ and I want to find: $S_{rr} = HS_{vv}H^{\dagger}$ where $\dagger$ denotes conjugate transpose. I do not know $H$ but I do know $H^{-1}$. What is the ...
2
votes
4answers
576 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? ...
3
votes
0answers
55 views

Matrix completion when the eigenvectors are a tensor product?

Suppose we have incomplete observations of the square matrix $X$. Most matrix completion algorithms assume the matrix is low-rank. What if instead we assume the matrix of eigenvectors is a tensor ...
0
votes
1answer
90 views

inverse of a quadratic form

I have an expression of the form: $ACA^{'}$ where $C$ is an invertible, symmetric and positive definite matrix. I'm trying to figure out if the expression above is invertible. The $C$ matrix is ...
1
vote
0answers
150 views

closed form approximation of matrix inverse with special properties

I'm trying to find some theory to help me explicitly express the inverse of a matrix (or a close approximation of the inverse). My matrix has the following properties: invertible positive definite ...
3
votes
1answer
281 views

How to use eigenvalue information to efficiently diagonalize matrices?

I apologize if this question in a more general form has been asked before. I have a tridiagonal Toeplitz matrix $K$, whose eigenvalues and eigenvectors are known analytically for any dimension $N$ ...