matrix Questions

4

Solved

Assume I have the following matrix (defined here in Julia language): mat = [1 1 0 0 0 ; 1 1 0 0 0 ; 0 0 0 0 1 ; 0 0 0 1 1] Considering as a "component" a group of neighbour elements that have v...
Arabian asked 24/9, 2015 at 22:50

6

Solved

I'm trying to make a function with the arguments (a,tol=1e-8) that returns a boolean value that tells the user whether or not the matrix is symmetric (symmetric matrix is equal to its transpose). S...
Mineralogy asked 20/3, 2017 at 15:59

11

I'm trying to make a simple matrix multiplication method using multidimensional arrays ([2][2]). I'm kinda new at this, and I just can't find what it is I'm doing wrong. I'd really appreciate any h...

3

How can I find a permanent of a square matrix (for a general dimension nxn) in R? In particular, I'm trying to find a pdf of order statistics for independent but not identically distributed populat...
Preface asked 11/6, 2014 at 22:45

6

I'd like to take the modular inverse of a matrix like [[1,2],[3,4]] mod 7 in Python. I've looked at numpy (which does matrix inversion but not modular matrix inversion) and I saw a few number theor...
Fermium asked 26/11, 2010 at 18:28

4

I have a homogeneous transformation matrix of size (4x4) and a trajectory of size (nx3). Each row of this trajectory is a vector. I want to multiply homogeneous transformation matrix by each row o...
Ramsgate asked 14/6, 2017 at 7:33

35

Solved

A friend was in need of an algorithm that would let him loop through the elements of an NxM matrix (N and M are odd). I came up with a solution, but I wanted to see if my fellow SO'ers could come u...
Paraclete asked 29/12, 2008 at 18:40

2

Solved

I am trying to get the bird's eye view perspective transform from camera intrinsic, extrinsic matrices and distortion coefficients. I tried using the answer from this question. The image used is...
Radiancy asked 2/2, 2018 at 5:13

3

Solved

How can I squeeze only a subset of singleton dimensions of a matrix in Matlab? The squeeze function removes them all. I keep the index to those dimensions in a vector called "dims".
Mossgrown asked 16/5, 2014 at 19:45

10

Solved

Given a 2D(M x N) matrix, and a 2D Kernel(K x L), how do i return a matrix that is the result of max or mean pooling using the given kernel over the image? I'd like to use numpy if possible. Note...
Febrifuge asked 26/2, 2017 at 0:6

10

Solved

How to identify the linearly independent rows from a matrix? For instance, The 4th rows is independent.
Pyramid asked 2/3, 2015 at 18:12

1

Solved

Context I've got a workflow with 2 jobs. The first job generates a list of tasks (with name and type) as output The second job uses 3 different actions, where each action is associated to a task t...
Battle asked 6/9, 2023 at 20:18

2

Solved

Suppose I have the following sudoku: problem <- matrix(c( 5, 3, 0, 0, 7, 0, 0, 0, 0, 6, 0, 0, 1, 9, 5, 0, 0, 0, 0, 9, 8, 0, 0, 0, 0, 6, 0, 8, 0, 0, 0, 6, 0, 0, 0, 3, 4, 0, 0, 8, 0, 3, 0, 0,...
Aby asked 6/9, 2023 at 6:27

2

Solved

This code won't compile: fn main() { let m1 = vec![1, 2, 3]; let m2 = vec![&m1, &m1, &m1]; let m3 = vec![vec![1, 2, 3], vec![4, 5, 6], vec![7, 8, 9]]; for i in &m2 { for j in...
Mountain asked 25/2, 2016 at 14:30

8

I am trying to implement the Hungarian Algorithm but I am stuck on the step 5. Basically, given a n X n matrix of numbers, how can I find minimum number of vertical+horizontal lines such that the z...
Fifi asked 30/4, 2014 at 4:23

5

Solved

Given a vector I would like to create a square matrix where elements of vector are on diagonal and there is row-wise cumsum of elements. Example vector: vec <- c(1, 2, 3, 4) Required output:...
Cretan asked 27/1, 2015 at 11:39

5

Solved

Given two matrices A: m * r B: n * r I want to generate another matrix C: m * n, with each entry C_ij being a matrix calculated by the outer product of A_i and B_j. For example, A: [[1, 2], [...
Bomber asked 19/7, 2014 at 10:43

3

Solved

I've got coordinates of 4 points in 2D that form a rectangle and their coordinates after a perspective transformation has been applied. The perspective transformation is calculated in homogeneou...
Inca asked 5/3, 2016 at 19:58

3

Solved

I need help finding an Algorithm that is as effective as possible for checking if a given binary matrix can be reached by flipping rows and columns of a matrix with only one's. Whenever you flip a ...
Inversion asked 27/2, 2018 at 12:11

2

Solved

I have a data frame with dimensions 3695 X 20. The first column contains alphanumeric identifiers, the other 19 columns are all numeric. So, rownames(df) provides the numbers 1-3695, and colnames(d...
Soosoochow asked 5/9, 2014 at 21:53

3

I'm struggling with the following problem: I have some very big matrices (say, at least, 2000x2000, and probably in the future they will even reach 10000x10000) with very small rank (2 or 3, call i...
Whipperin asked 27/6, 2015 at 20:37

2

I am looking to use the multiprocessing module to speed up the run time of some Transport Planning models. I've optimized as much as I can via 'normal' methods but at the heart of it is an absurdly...
Lipscomb asked 3/11, 2011 at 0:50

5

Solved

Background Assuming we have a family of matrices Ms of size n-by-n, which should meet the following requirements: Entries of the matrix are either 0 or 1, i.e., boolean, but diagonal entries are a...
Skimmia asked 13/8, 2023 at 22:37

5

Solved

I'm having a numpy ndarray where I would like to check if each row vector is monotonically increasing. Example: a = np.asarray([[1,2,3],[1,5,7],[4,3,6]]) monotonically_increasing(a) Expected re...
Calceiform asked 9/6, 2015 at 13:59

5

Solved

I am not sure if the approach I've been using in sympy to convert a MutableDenseMatrix to a numpy.array or numpy.matrix is a good current practice. I have a symbolic matrix like: g = sympy.Matrix...
Schoolbook asked 12/6, 2013 at 15:48

© 2022 - 2024 — McMap. All rights reserved.