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
1 answer

number of distinct eigenvectors in R

There are 2 eigenvectors corresponding to 1 eigenvalue (with multiplicity 4) for the following example. However, R returns 4 distinct eigenvectors. It looks like pairs of them are approximately the same only differing in machine floating point error…
user236215
  • 7,278
  • 23
  • 59
  • 87
2
votes
1 answer

Apply matrix transformation to a sphere

I have a Sphere structure that looks like this struct Sphere { vec3 _center; float _radius; }; How do I apply a 4x4 transformation matrix to that sphere? The matrix may contain a scale factor, a rotation (which will obviously will not…
McLovin
  • 3,295
  • 7
  • 32
  • 67
2
votes
1 answer

matrix divided by rows of another matrix, without a loop in theano

What is the equivalent theano implementation of the code below without using a loop? dt = np.dtype(np.float32) a=[[12,3], [2,4], [2,4],] b=[[12,3,2,3], …
PickleRick
  • 419
  • 1
  • 5
  • 13
2
votes
1 answer

Theano version of a numpy einsum for two 3dim matrices

I have two 3dim numpy matrices and I want to do a dot product according to one axis without using a loop in theano. a numpy solution with sample data would be like: a=[ [[ 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0], [ 1, 0, 0, 1, …
PickleRick
  • 419
  • 1
  • 5
  • 13
2
votes
1 answer

Solve set of modular equations in C++

I am working on Quadratic Sieve algorithm in c++. And after Gaussian elimination I need to solve set of modular equations such as, for example : (1) b + c = 0 mod 2 (2) a + c = 0 mod 2 Here the symbol = is used to mean "is congruent to". I am…
niar_q
  • 153
  • 9
2
votes
2 answers

How to solve linear algebra equation AC=D where A is non-square matrix

I have a binary matrix A (only 1 and 0), and a vector D in Galois field (256) The vector C is calculated as: C = (A^^-1)*D where A^^-1 denotes the inverse matrix of matrix A in GF(2), * is multiplication operation. The result vector C must be…
user3051460
  • 1,455
  • 22
  • 58
2
votes
1 answer

Solver time of linear equations in SciPy

This is my python code for 4 functions solving the linear system equations: def inverse_solution(A, B): inv_A = scipy.linalg.inv(A) return [numpy.dot(inv_A, b) for b in B] def scipy_standart_solution(A, B): return [scipy.linalg.solve(A,…
H. Joiyu
  • 23
  • 6
2
votes
1 answer

dgeqrf(LAPACK) not working properly in c++

I would grateful if you could help me to resolve the following issue. I have stumbled upon the wall and i can't really tell what is the problem here. I would like to use the LAPACK functions dgeqrf, dormqr and dtrtrs under c++ to solve the…
OwlBite
  • 23
  • 3
2
votes
2 answers

Numpy Hermitian Matrix class

Are you aware of something like a hermitian matrix class in numpy? I'd like to optimize matrix calculations like B = U * A * U.H , where A (and thus, B) are hermitian. Without specification, all matrix elements of B are calculated. In fact, it…
2
votes
3 answers

Feature selection using Gram-Schmidt orthogonalization in R

Is there any package in R that contains algorithm for feature selection using Gram-Schmidt orthogonalization?
pixel
  • 24,905
  • 36
  • 149
  • 251
2
votes
1 answer

Preconditioned Conjugate Gradient and LinearOperator in python

[Homework] I am going to solve the linear system Ax=b by the Preconditioned Conjugate Gradient method, and I use spilu function from scipy.sparse.linalg for the preconditioner. A is a sparse symmetric 162*162 matrix. Since the spilu gives an…
Bob
  • 217
  • 1
  • 3
  • 9
2
votes
0 answers

Max size of set linear equations to solve? (X=AX+B)

This is a very general question regarding the maximum size of a set of linear equations to be solved by today's fastest hardware, in the form: X = AX + B A: NxN matrix of floats, it is sparse. B: N-vector of floats. solve for X. This becomes X(I-A)…
2
votes
1 answer

Column-wise (or row-wise) operations on matrices in sympy

Is there a way to do column-wise (or row-wise) operations on matrices in sympy? For example, dividing each column of a matrix by its norm, or multiplying each row of a matrix by its norm?
Hatshepsut
  • 5,962
  • 8
  • 44
  • 80
2
votes
3 answers

Raising a Power on Matrices

I'm trying to create a function that will give me the value of a matrix once it has been raised to a power. This is what I've done so far: A <- matrix(c(1,2,3,4,0,1,2,3,0,0,1,2,0,0,0,1),nrow=4,ncol=4) power <- function(A,n){ + if(n == 0){ +…
user5340702
2
votes
1 answer

Same SciPy.linalg.eigh() eigenvalues are not equal

I am using Python 2.7, NumPy 1.6.2 and SciPy 0.16.0 to calculate the following. I have created a Hadamard matrix. Then I have created outer products from the 0,2,4-th vectors of the matrix and added them and made the diagonal 0. Then I have computed…
Omar Shehab
  • 1,004
  • 3
  • 14
  • 26
1 2 3
99
100