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

Creating a matrix of arbitrary size where rows sum to 0

From Creating a matrix of arbitrary size where rows sum to 1?, we can simply normalize the values by dividing each value in the matrix by the sum of all values to make sure that it sums to 1. For example: cols, rows = 5, 5 matrix =…
alvas
  • 115,346
  • 109
  • 446
  • 738
0
votes
1 answer

NaN out of determinant function?

I have the following Code for forming matrix and finding its determinant :- function matrix(m, n, arr) { var result = {}; for (t = 1; t <= m; t++) { result[t] = {}; } for (i = 1; i <= m; i++) for (j = 1; j <= n; j++) result[i][j] =…
0
votes
2 answers

Why doesn't this Scilab program of finding the determinant recursively work?

I am trying to find the determinant of an $N\timesN$ matrix. Here's my code: clc function determinant=take_detm(A) order=sqrt(length(A)) disp(order) if order==2 then determinant=A(1,1)*A(2,2)-A(1,2)*A(2,1); else s=0 for i=1:order …
hello_world
  • 29
  • 10
0
votes
1 answer

How to obtain determinant as polynomial when matrix includes unknown values (in R)?

if I have a matrix that is including variables as entries, how can I obtain the determinant? It does not seem like R can handle non-numeric entries in matrices in calculations. for ex. z <- matrix(c(1,1,1,"d"),nrow = 2) then I would want the…
Yung Gud
  • 67
  • 6
0
votes
1 answer

Determinant of sparse matrix

I'm implementing a sparse matrix class , using a vector of map for store the data (the map represents a row of matrix in which the key is the index of columns and the value is the value of the maitrix in this position ) I have wrote the function…
Marco Ghiani
  • 219
  • 1
  • 12
0
votes
4 answers

implement matrix determinant in R

I was asked to implement function that calculates n-dimensional matrix determinant using Laplace expansion. This involves recursion. I developed this: minor<-function(A,i,j)…
Julia
  • 11
  • 4
0
votes
0 answers

Unable to find determinant using partial pivoting

whats the problem. It executes but doesnt show the correct answer. It gets compiled as well. I've used calling function in many places. its assumed that the matrix is square and i give the input througgh terminal. for ex=3 then a random 3x3 matrix…
0
votes
1 answer

Python solve given conditions

everyone Is it possible to solve the following like: x = np.matrix([[8.3,-20.6],[-20.6,65.8]]) y is a function of P: y = lambda P: np.matrix([[0.02P,-0.02P], [-0.02P,0.04P]]) I want to find the P value given conditions that: P>0, det(x-y)==0; Is…
Darth BEHFANS
  • 409
  • 6
  • 10
0
votes
1 answer

Fast way to compute the determinant of all minors (and minors of minors)

I have an invertible Hermitian matrix and square submatrices of , defined: I need to know the determinant of every . Is there a fast way of computing this in MATLAB? Here is the bad way to do it: Loop over [1:2^K] Convert loop index to…
Christian Chapman
  • 1,018
  • 10
  • 27
0
votes
2 answers

Python code for determinant of N x N matrix

my code only works for 3x3 matrix how to make some modification to work for N x N matrix?` alist = [] def det(m): if len(m) > 2: for i in range(len(m)): new_m = deepcopy(m) minor(new_m,i) multiplier = m[i][0] *…
Ren Yuan
  • 49
  • 1
  • 1
  • 4
0
votes
1 answer

Calculating the determinant of a pointer to a 2D array in C++

My program consists of two classes. The first creates a 2D array and populates it with user input. The first class works correctly, and when I call it in main it is able to create and print a 2D array. However, I am attempting to pass a pointer to…
0
votes
1 answer

Resize script scales up, not down. Using the determinant makes it jumpy

I built the following resize script - as you can see from the fiddle, it works for scaling up but not down: https://jsfiddle.net/calipoop/a37aeb08/ var item = document.getElementById('item'), btn = document.getElementById('resizeBtn'), s =…
calipoop
  • 792
  • 9
  • 31
0
votes
2 answers

Getting log of determinant as fast with Eigen as with Alglib

I need a quick way to get logarithms of complex determinants, preferably not by getting the determinants first and then taking the log, as the numbers can get really big or really small (and I later use ratios of such numbers but only when they are…
jorgen
  • 3,425
  • 4
  • 31
  • 53
0
votes
1 answer

vectorization of matlab for-loop

I am looking for proper vectorization of following matlab function to eliminate for-loop and gain speed by multithreading. size(A) = N-by-N, where 30 <= N <= 60 1e4 <= numIter <= 1e6 function val=permApproxStochSquare(A,numIter) %// A ...…
michal
  • 239
  • 2
  • 9
0
votes
2 answers

Finding a determinant given an expansion

I was wondering if anyone could think of a three-by-three determinant containing a and b (and other real numbers) whose expansion is ab(a + b)^2. There will probably be many possibilities but just one will do. Thanks.
Will
  • 190
  • 7