Questions tagged [matrices]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2
votes
0answers
71 views

What's the most practically efficient way to store differences in adjacent matrix values?

I am implementing a certain algorithm that works like this: Create a closed contour (list) of elements in a matrix, where closed means that the last element is adjacent (by row, column) to the first. ...
3
votes
3answers
97 views

Say we have a group of N person, and each person might want to sell or buy one of the M items, how to find a closed path among them for an exchange?

Say we have N persons and M items (when a person has a certain item, she usually only has one piece). For example, person 1 has item A, C, D, and wants item F person 2 has item B, C, and wants E ...
2
votes
2answers
737 views

Formats for Storing Sparse Matrices

For storing sparse matrices I know there are multiple formats that are common, like COO, CSR, DIA, ELL, HYB, etc. (Link to some storage formats), but I haven't found that any of these stores the ...
4
votes
3answers
729 views

How to represent a three-dimensional (or more) data structure in a terminal?

I am working on a library that allows the creation and manipulation of Vectors (lists with a known length), Matrices (lists of lists with known dimensions), and three-, four- etc. order Tensors (lists ...
1
vote
1answer
135 views

Question about the uses of matrices in games and 3D graphics [closed]

So I know that matrices are used extensively in the field of games and 3D graphics, for example, you need to know how to do matrix multiplication if you want to understand how scaling an object works, ...
17
votes
3answers
4k views

Why does expressing calculations as matrix multiplications make them faster?

In Google's MNist tutorial using TensorFlow, a calculation is exhibited in which one step is equivalent to multiplying a matrix by a vector. Google first shows a picture in which each numeric ...
3
votes
1answer
148 views

How can you write an activation function in a neural network to handle a layer architecture of arbitrary dimensions?

I am making a neural network in Clojure that can take an array of integers,and return a data structure representing the layers of a neural network: so (make-layers [1 4 5]) would evaluate to: [[0] ...
2
votes
4answers
88 views

Similar multidimensional array detection

I'm looking for some sort of algorithm so I can quickly identify similar matrices, the matrices are not stored permanently so I'd need a way of mapping each matrix to an easily stored values, after ...
-1
votes
3answers
76 views

number of square matrices in a non-square matrix [closed]

i was wondering if there is any formula to calculate the number of square matrices present in a square matrix. e.g a 3x2 matrix has 3 square matrices that are (2x2, 1x1, 1x1) a 6x3 matrix has 2 ...
1
vote
0answers
1k views

How to loop through array bidimensional in diagonal according to a position in degrees

The title could be no self-explanatory enough but I need some conceptual help in order to implement a solution to go through an array: I'm developing a program to calculate the "most shadepath" route ...
3
votes
1answer
178 views

Why use atomic vectors or matrices in R at all?

In reading Hadley Wickham's Advanced R I learned about the difference between atomic vectors and lists; and matrices/arrays and dataframes. This is something I hadn't really appreciated before, and ...
0
votes
1answer
663 views

How to display an inward spiral matrix

Suppose I have the following matrix with values 1-25 as input to my program. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 The inward spiral should give me the output 13 ...
0
votes
1answer
433 views

Two dimensional matrix-like data type using lists and/or mutable lists

I am trying to think of an implementation of a two dimensional matrix-like data type. Normally I would take an array of arrays but I'm bound to a relatively low language level which only provides ...
1
vote
1answer
155 views

Matrix distribution to process grid

I need to write a program, which will perform LU-decomposition, etc. The problem is that I don't know about the preferred way to distribute the loaded matrix from the root process to other processes. ...
4
votes
1answer
3k views

Transpose a matrix without a buffering one

How is it possible to transpose a MxN matrix without using a "buffering" matrix? In the latter case it's easy and quite the "classic" approach... Given a matrix[M][N], I would like to put it into a ...
0
votes
1answer
343 views

Matrices calculations on partial shape matching

I'm working in a shape recognition project where it is supposed for me to develop an application that receives two images: an original one and a sketch made by a user. I am supposed to detect contours ...
0
votes
1answer
129 views

Finding same numbers in a matrix

I have a question here and I am trying to find a solution of it. But I want to see some other opinions as well. The problem is the following: There is a matrix NxN which holds integer numbers. You ...
1
vote
1answer
141 views

Program to find Orthogonal Matrices

I have been trying to find orthogonal matrix of order n where first row will be given as 1/√n, 1/√n, .... n times. The second row will be a vector such that dot product of it with the row above and ...
6
votes
5answers
1k views

Find the peak of each islands in sparse matrix

I have a sparse matrix that contains several islands of unknown size. I would like to find the highest peak of each islands. Consider this matrix as an example: 0 0 1 0 0 0 0 0 0 1 2 1 0 0 0 0 0 3 2 ...