Questions tagged [determinants]

Anything related to the computation of matrix determinants. The determinant of a square matrix is a number, computed from the matrix elements, that is extremely important in matrix algebra and its applications (geometry, linear systems solving, etc.).

Anything related to the computation of matrix determinants. The determinant of a square matrix is a number, computed from the matrix elements, that is extremely important in matrix algebra and its applications (geometry, linear systems solving, etc.).

See Wikipedia on matrix determinants.

179 questions
30
votes
4 answers

What is the best algorithm to find a determinant of a matrix?

Can anyone tell me which is the best algorithm to find the value of determinant of a matrix of size N x N?
perilbrain
  • 7,496
  • 1
  • 25
  • 35
14
votes
11 answers

Java inverse matrix calculation

I'm trying to calculate the inverse matrix in Java. I'm following the adjoint method (first calculation of the adjoint matrix, then transpose this matrix and finally, multiply it for the inverse of the value of the determinant). It works when the…
dedalo
  • 2,441
  • 12
  • 30
  • 34
11
votes
2 answers

Maximum determinant of sub-matrix

Assuming we have a square matrix M, e.g., set.seed(1) M <- matrix(rnorm(5*5), 5, 5) > M [,1] [,2] [,3] [,4] [,5] [1,] -0.6264538 -0.8204684 1.5117812 -0.04493361 0.91897737 [2,] 0.1836433 0.4874291 …
ThomasIsCoding
  • 53,240
  • 4
  • 13
  • 45
11
votes
5 answers

Calculating matrix determinant

I am trying to calculate the determinant of a matrix (of any size), for self coding / interview practice. My first attempt is using recursion and that leads me to the following implementation: import java.util.Scanner.*; public class Determinant…
all_by_grace
  • 2,237
  • 6
  • 35
  • 51
10
votes
3 answers

Fastest algorithm for computing the determinant of a matrix?

For a research paper, I have been assigned to research the fastest algorithm for computing the determinant of a matrix. I already know about LU decomposition and Bareiss algorithm which both run in O(n^3), but after doing some digging, it seems…
7
votes
3 answers

matrix determinant differentiation in tensorflow

I am interested in computing the derivative of a matrix determinant using TensorFlow. I can see from experimentation that TensorFlow has not implemented a method of differentiating through a determinant: LookupError: No gradient defined for…
user1936768
  • 639
  • 1
  • 8
  • 12
6
votes
3 answers

det of a matrix returns 0 in matlab

I have been give a very large matrix (I cannot change the values of the matrix) and I need to calculate the inverse of a (covariance) matrix. Sometimes I get the error saying Matrix is close to singular or badly scaled. Results may be…
bhavs
  • 1,677
  • 6
  • 32
  • 63
6
votes
5 answers

How to calculate matrix determinant? n*n or just 5*5

everyone. I need to find matrix n*n (or 5*5) determinant. I have a function translated from Pascal, but there's INDEX OUT OF RANGE EXCEPTION. Could somebody help me? Here's my code: public static double DET(double[,] a, int n) { int i,…
Frankie Drake
  • 1,073
  • 9
  • 19
  • 37
6
votes
3 answers

matlab precision determinant problem

I have the following program format compact; format short g; clear; clc; L = 140; J = 77; Jm = 10540; G = 0.8*10^8; d = L/3; for i=1:500000 omegan=1.+0.0001*i; a(1,1) = ((omegan^2)*(Jm/(G*J))*d^2)-2; a(1,2) = 2; a(1,3) = 0; a(1,4) =…
Rook
  • 54,867
  • 44
  • 156
  • 233
6
votes
2 answers

Matrix determinant algorithm C++

I'm new to programming and I was looking for a way to find the determinant of a matrix. I found this code online, but I have trouble understanding the algorithm in place here. I have no problems for the base of the recursion , but the continue and…
user3144334
  • 125
  • 1
  • 1
  • 8
6
votes
2 answers

Efficient way to take determinant of an n! x n! matrix in Maple

I have a large matrix, n! x n!, for which I need to take the determinant. For each permutation of n, I associate a vector of length 2n (this is easy computationally) a polynomial of in 2n variables (a product of linear factors computed recursively…
Daniel
  • 934
  • 1
  • 7
  • 24
5
votes
4 answers

Determinants of huge matrices in MATLAB

from a simulation problem, I want to calculate complex square matrices on the order of 1000x1000 in MATLAB. Since the values refer to those of Bessel functions, the matrices are not at all sparse. Since I am interested in the change of the…
Robert Filter
  • 1,431
  • 2
  • 11
  • 14
5
votes
3 answers

Python Numpy - Treat really small numbers as zero

I want to calculate the Determinant of a Singular Matrix (which has a 0 determinant) with Numpy and when I print the determinant it shows a really small number (which is nearly zero = -7.09974814699e-30) but not zero itself... when I try to print…
Cypher
  • 1,791
  • 2
  • 20
  • 32
5
votes
1 answer

determinant calculation with SIMD

Does there exist an approach for calculating the determinant of matrices with low dimensions (about 4), that works well with SIMD (neon, SSE, SSE2)? I am using a hand-expansion formula, which does not work so well. I am using SSE all the way to…
user1095108
  • 12,675
  • 6
  • 43
  • 96
5
votes
1 answer

Efficient algorithm for determinant of a m-diagonal NxN symmetric matrix

I have to find the determinant of a symmetric square NxN matrix with M diagonals and M << N. Is there a more fast method than LU-decomposing the matrix?
Red
  • 552
  • 2
  • 7
  • 16
1
2 3
11 12