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
0 answers

Skipping the numpy.linalg.eigh non-convergence error

I have a for-loop with generates random Hermitian matrices using a function, diagonalizes it and stores the eigenvalues. However, for some of the instances the diagonalization fails to converge and the code stops. I want that, if the diagonalization…
lovespeed
  • 4,835
  • 15
  • 41
  • 54
2
votes
4 answers

XNA - About the relation between world space and the screen space

Edit: Just wanted to make the question I have more clear. I pretty much am having trouble seeing how something like Matrix.CreateTransformationZ works in the context of not only matrix multiplication but more importantly what this does to the screen…
Ilya
  • 1,215
  • 1
  • 14
  • 25
2
votes
0 answers

Numpy/Cython: how to create a memory view of user-defined columns of a matrix

I am currently working on improving the runtime for a simple Cython function to multiply a numpy matrix A and a numpy vector x using BLAS (i.e. runs A.dot.x in normal numpy) My current implementation matrix_multiply(A,x) does this without copying…
Berk U.
  • 7,018
  • 6
  • 44
  • 69
2
votes
2 answers

Algorithm challenge to merge sets

Given n sets of numbers. Each set contains some numbers from 1 to 100. How to select sets to merge into the longest set under a special rule, only two non-overlapping sets can merge. [1,2,3] can merge with [4,5] but not [3,4]. What will be an…
Dennis
  • 159
  • 1
  • 11
2
votes
1 answer

Maple: LinearSystemPlot with two variables

I'm having problem with my Maple project. I want to plot three linear equations, I'm using LinearSystemPlot function. But I also want to make it more interactive, so I though to use Explore function. I tried to find some help on internet, but…
SimiM
  • 21
  • 3
2
votes
2 answers

Wrong result for best fit plane to set of points with scipy.linalg.lstsq?

I have a set of (x, y, z) points for which I need to find the plane that best fits them. A plane is defined by its coefficients as: a*x + b*y + c*z + d = 0 or equivalently: A*X +B*y + C = z The second equation is just a re-write of the first. I'm…
Gabriel
  • 40,504
  • 73
  • 230
  • 404
2
votes
2 answers

making a singular matrix non singular by removing rows and columns

I have large sparse square matrix n by n, its rank is slightly below n, let's say m. I want to make it non-singular by removing rows and columns by a certain rule. The rule is that if you remove ith row, you must remove ith column as well, so that…
Dennis
  • 159
  • 1
  • 11
2
votes
1 answer

R chol and positive semi-definite matrix

I have the following matrix: j <- matrix(c(1,1,.5,1,1,.5,.5,.5,1), nrow=3, ncol=3) Which is positive semi-definite, because all of the eigenvalues are >= 0. Source:…
JoeBass
  • 519
  • 7
  • 18
2
votes
1 answer

Does Theano/Numpy's matrix inverse function use GPU at all?

I ran the following code to compute the pseudo inverse of a matrix, but it seems that it makes no difference whether I switch on the GPU or not. mat = theano.shared(numpy.eye(300, dtype="float32")+1) fn = theano.function([],…
dontloo
  • 10,067
  • 4
  • 29
  • 50
2
votes
2 answers

Is numpy slower than c++ linear algebra libraries like eigen?

I use it to implement neural networks. I prefer NumPy, because it is more convenient to prepare data with Python; however, I am concerned that NumPy is not as fast as c++ libraries.
Jason
  • 169
  • 1
  • 11
2
votes
2 answers

How to reverse warpPerspective()

I get that when I apply warpPerspective() again with inverse of transformation matrix, I obtain first image: M = cv2.getPerspectiveTransform(pts1,pts2) warped = cv2.warpPerspective(img, M, (cols,rows)) # ... some operations, obtain a…
Ekrem Doğan
  • 674
  • 6
  • 13
2
votes
1 answer

using functions as elements in matricies: R

I am a new to R and am trying to do my homework in it. I have looked many places and I cannot find any instructions as to how to make matricies that contain functions. I need my matrix [A] to have functions like cos(x) and sin(x) in them, and then I…
TheGusBus
  • 37
  • 7
2
votes
1 answer

Solving Matrix equation over GF(2) in Sage

I am trying to solve a system of linear equations in Sage. However, I want to print the solution only if it is unique. I have tried using A.solve_right(y) where A is coefficient matrix, y is the right hand side (Ax = y). However, this returns a…
giliev
  • 2,938
  • 4
  • 27
  • 47
2
votes
1 answer

finding eigenvalues of a very huge matrix

I am trying to implement spectral clustering algorithm for a community detection in graph problem. I have very huge matrix to calculates its Eigenvectors, matrix of > 1Mx1M. Numpy and Scipy needs the matrix to be on memory to calculate it, which is…
2
votes
2 answers

Find elements of an NxN matrix given constraints on row and column sums -- Mathematica or Matlab

I'm trying to find the elements of an NxN matrix so that given row and column sums are satisfied. The only other constraint is that the elements of the matrix are restricted to the integers 0 and 1. This is probably a few simple lines in Matlab or…