Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

Questions tagged [matrices]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
35 views

Organizing Complicated Matrix Traversal?

The following are some examples that you may see in an intro to programming course: Print the elements of an nxn array... Spiraling in from the outside Spiraling out from the center Zig zagging from ...
user avatar
  • 37
3 votes
0 answers
81 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. ...
user avatar
3 votes
3 answers
112 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 ...
user avatar
  • 141
2 votes
2 answers
799 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 ...
user avatar
  • 123
4 votes
3 answers
937 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 ...
user avatar
  • 4,449
1 vote
1 answer
314 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, ...
user avatar
21 votes
2 answers
8k 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 ...
user avatar
  • 1,203
3 votes
1 answer
167 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] ...
user avatar
  • 290
2 votes
4 answers
93 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 ...
user avatar
  • 21
-1 votes
3 answers
101 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 ...
user avatar
  • 11
1 vote
0 answers
2k 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 ...
user avatar
  • 113
3 votes
1 answer
198 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 ...
user avatar
  • 161
0 votes
1 answer
712 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 ...
user avatar
0 votes
1 answer
690 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 ...
user avatar
  • 162
1 vote
1 answer
196 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. ...
user avatar
  • 327
5 votes
1 answer
4k 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 ...
user avatar
  • 153
0 votes
1 answer
351 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 ...
user avatar
0 votes
1 answer
135 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 ...
user avatar
1 vote
1 answer
152 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 ...
user avatar
6 votes
5 answers
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 ...
user avatar
  • 161