Questions tagged [linear-algebra]

Linear Algebra is a core body of mathematics studying vector spaces and linear mappings between these spaces. Key topics include: matrices, vectors, simultaneous systems of linear equations, diagonal form, eigenvalues, eigenvectors, projections, points, lines, planes, hyperplanes, rotations and reflections.

Linear Algebra is a core body of mathematics studying vector spaces and linear mappings between these spaces. It has extensive applications in computer graphics, economics, engineering, and control systems, among other fields.

Key topics include: matrices, vectors, simultaneous systems of linear equations, diagonal form, eigenvalues, eigenvectors, projections, points, lines, planes, hyperplanes, rotations, reflections, shears, scaling.

Popular packages for solving linear algebra problems include , , , and .

4466 questions
2
votes
2 answers

Find all quadrilaterals between intersecting lines?

How do I find all quadrilaterals in between several intersecting lines? Only condition is that each side of the quadrilateral is one line. I found this theoretical explanation but not a code for it. So far I'm pretty much in the beginning. I have…
wittich
  • 2,079
  • 2
  • 27
  • 50
2
votes
1 answer

Calculate a color with opacity based on it's values over other colors?

For example, I know the color is #a0c5e8 (160,197,232) when over white, and it's #496e91 (73,110,145) when over black. Is there a way to calculate the "real" color (at 100% opacity)?
Sarke
  • 2,805
  • 2
  • 18
  • 28
2
votes
1 answer

How do I identify rows/columns that does not increase rank of matrix in R?

Suppose I have a symmetric, positive semidefinite matrix A of dimension n x n. The rank of A is d < n, and I want to find a set of indices of length d such that A[indices, indices] has rank d. For example, if A <- structure(c(3, 2, 1, 1, 2, 2, 1, 1,…
Lars Lau Raket
  • 1,905
  • 20
  • 35
2
votes
4 answers

Computing Mahalanobis Distance Between Set of Points and Set of Reference Points

I have an n x p matrix - mX which is composed of n points in R^p. I have another m x p matrix - mY which is composed of m reference points in R^p. I would like to create an n x m matrix - mD which is the Mahalanobis Distance matrix. D(i, j) means…
Royi
  • 4,640
  • 6
  • 46
  • 64
2
votes
1 answer

Singular value decomposition (svd) and mean does not exclude masked values during computation

I am new in python programming, so forgive me if my questions are too basic. I've been helped a lot by this forum before and thanks to you guys for all your contributions. This time I have a set of 12,000 image data which I am performing singular…
Kela
  • 41
  • 6
2
votes
2 answers

Armadillo's solve(A, b) returning different answer from Matlab, Eigen

I am using Armadillo 5.200 with Visual Studio 2013 to solve a system of linear equations xA=b. My code calculates this by solving x=(A'\b')', and I am using Armadillo's solve() function to solve the system of linear equations. My problem is that…
2
votes
0 answers

How to reuse decomposed LU matrix to solve Ax = b in JBLAS

I have started working with JBLAS, but I am facing an issue, doubleMatrix x = Solve.solve(A,b); This gives the results just fine. But if i wish to do a recalculation to find Ax = b1, then it will go all over again to decompose to get A = LU or…
harpribot
  • 223
  • 1
  • 11
2
votes
1 answer

Numpy Matrix Multiplication U*B*U.T Results in Non-symmetric Matrix

In my program, I need the following matrix multiplication: A = U * B * U^T where B is an M * M symmetric matrix, and U is an N * M matrix where its columns are orthonormal. So I would expect A is also a symmetric matrix. However, Python doesn't…
panc
  • 817
  • 2
  • 14
  • 30
2
votes
1 answer

Constraining the least squares fitting in python

I want to solve the following in a least-squares sense: H = dot(A, B) + dot(A.conj(), C) where the complex matrices H, B and C are known. The remaining complex matrix A (with its complex conjugate) is being searched. I tried computing it with the…
blaz
  • 4,108
  • 7
  • 29
  • 54
2
votes
2 answers

Scipy.linalg.eig() giving different eigenvectors from GNU Octave's eig()

I want to compute the eigenvalues for a generalized eigenvalue problem with lambda * M * v = K * v, where lambda is the eigenvalue, v is an eigenvector, and M and K are matrices. Let's say we have K = 1.8000 + 0.0000i -1.0970 + 0.9550i …
user1704042
  • 399
  • 1
  • 5
  • 18
2
votes
1 answer

Eigen decomposition in Scala

I want to calculate the eigenvalues and eigenvectors of a positive semi-definite matrix in Scala (using Breeze), and I'm stuck. From the Breeze linear algebra library reference example: val A =…
Alt
  • 2,597
  • 5
  • 26
  • 36
2
votes
0 answers

How do I determine the weight to assign to each bucket?

Someone will answer a series of questions and will mark each important (I), very important (V), or extremely important (E). I'll then match their answers with answers given by everyone else, compute the percent of the answers in each bucket that are…
2
votes
2 answers

Least squares regression on 2d array

The numpy.linalg.lstsq(a,b) function accepts an array a with size nx2 and a 1-dimensional array b which is the dependent variable. How would I go about doing a least squares regression where the data points are presented as a 2d array generated from…
brunston
  • 1,244
  • 1
  • 10
  • 18
2
votes
1 answer

Confused with pdpotrf arguments

I want to do a Cholesky factorization in a distributed environment. For that purpose, I use pdpotrf(). However, I am struggling understanding the parameters needed by the function and they provide no C example on how to use it (and an example would…
gsamaras
  • 71,951
  • 46
  • 188
  • 305
2
votes
2 answers

Linear equation solver Arduino,printing wrong answers

Please help me any help will be appreciated. I wrote a code in C to solve equations, but I don't know why some equations that I input into this calculator, give me wrong values, the algorithm is correct because I execute it in C and give me the…
user2461687
  • 173
  • 1
  • 13
1 2 3
99
100