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.

225 questions
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
  • 664
  • 2
  • 10
  • 20
5
votes
2 answers

Boost Library, how to get determinant from lu_factorize()?

I am trying to calculate a determinant using the boost c++ libraries. I found the code for the function InvertMatrix() which I have copied below. Every time I calculate this inverse, I want the determinant as well. I have a good idea how to…
phoganuci
  • 4,984
  • 9
  • 39
  • 50
4
votes
1 answer

What is the time complexity of numpy.linalg.det?

The documentation for numpy.linalg.det states that The determinant is computed via LU factorization using the LAPACK routine z/dgetrf. I ran the following run time tests and fit polynomials of degrees 2, 3, and 4 because that covers the least…
Galen
  • 1,128
  • 1
  • 14
  • 31
4
votes
2 answers

Memoization of Haskell Function

I wrote a function in Haskell to compute the determinant of a Matrix, it works just fine but is horribly slow so I tried to memoize it just like the Haskell Wiki does with the Fibonacci function. But somehow my memoized function takes slightly…
4
votes
1 answer

How do calculate a determinant of an large matrix without getting an overflow?

Good morning! I have an nxn-Matrix with n large enough to give me an overflow. I tried to fix this problem the mathematical way and it worked for small n but now I get an overflow from the Exponent. To explain it better here the code: # create a…
JulianeB
  • 91
  • 5
4
votes
2 answers

Experimentally determining computing complexity of matrix determinant

I need help determining experimentally the computing complexity of the determinant of a matrix nxn My code: import numpy as np import timeit t0 = time.time() for n in range(1, 10): A = np.random.rand(n, n) det =…
4
votes
5 answers

Code to solve determinant using Python without using scipy.linalg.det

Description(this is a hwk question): I am not sure where to start here. I plan to use Laplace's Expansion but I am not sure how to implement it for nxn matrices. Any help would be appreciated. Note: I already have a function to generate random…
theAngryPhysicist
  • 129
  • 1
  • 5
  • 12
4
votes
1 answer

Math error computing log(det(AA^T)+1) in python

I am trying to estimate the mean value of log(det(AAT)+1) in Python. My simple code works fine until I get to 17×17 matrices at which point it gives me a math error. Here is the code: iter = 10000 for n in xrange(1,20): h = n dets = [] …
Simd
  • 19,447
  • 42
  • 136
  • 271
4
votes
1 answer

Alternative ways to calculate the determinant of a matrix in R

So it is a mathematical fact that if the determinant of a matrix is equal to zero, then the matrix must be singular (not invertible). Now, the problem I am running into is that when I calculate the determinant of my matrix it is equal to zero,…
user2005253
3
votes
1 answer

keep track of the parity of a permutation during sort?

std::sort (and related) is one of the crown jewels of the STL. However, when I try to use it in the context of numerical linear algebra, I find a glaring problem with it, which prevents me from using it. The key is that in mathematics, keeping track…
alfC
  • 14,261
  • 4
  • 67
  • 118
3
votes
2 answers

UFuncTypeError: Cannot cast ufunc 'det' input from dtype('O') to dtype('float64') with casting rule 'same_kind'? How to avoid this issue?

I'm trying to build a PDE in python. I'm new to this and wondering where I have gone wrong. Would appreciate some help. I understand that I have a python object and I'm trying to cast it to a float64 but is there any way around this? Here is my…
3
votes
1 answer

Exact Value In Determinant Using Numpy

I want to compute the determinant of a 2*2 matrix , and I use linalg.det from Numpy like this: import numpy as np a = np.array([ [1,2], [3,4] ]) b=np.linalg.det(a) In other hand, We know that we also can compute it by a multiplication and a…
ariankazemi
  • 105
  • 3
  • 14
3
votes
2 answers

Determinant of a complex matrix in PyTorch

Is there a way to calculate the determinant of a complex matrix in PyTroch? torch.det is not implemented for 'ComplexFloat'
DeepRazi
  • 259
  • 4
  • 13
3
votes
1 answer

Calculate determinant of matrix using an iterative method

I wrote C++ codes that calculates the determinant of matrix using the recursive method. Now, I would like to rewrite that recursive method using an iterative method. But I cannot figure out how to accomplish that. The question is: How to rewrite…
L_J
  • 2,351
  • 10
  • 23
  • 28
3
votes
1 answer

Optimization of determinant calculation function

Searching for the best algorithm I found there is a tradeoff: complexity to implement and big constant on the one hand, and runtime complexity on the other hand. I choose LU-decomposition-based algorithm, because it is quite simple to implement and…
Tomilov Anatoliy
  • 15,657
  • 10
  • 64
  • 169
1
2
3
14 15