матрицы

Sorting a two-dimensional dynamic array by c++strings

Created a dynamic array in c++, filled it in. Now you need to sort by the first element of the rows. That is, so that the row ... cout << endl; } for (int i = 0; i < rows; i++) { delete[] arr[i]; } delete[] arr; }

Calculate the sum of the matrix elements

You need to calculate the sum of the elements of each row of the matrix v (4,5) or the number of positive elements of the col ... lt; endl; } cout << endl; for (int i = 0; i < N; i++) delete [] A[i]; delete [] A; }

Undirected Python graphs. The incidence matrix

An undirected graph is set from a file in the form 6 5 1 2 3 2 4 1 3 4 5 2 Where the first row is the number of vertices ... x[i],0) self.ui.label_2.setText(str(self.matrix)) How to find the incidence matrix with edges and adjacency matrix?

How to create an n-dimensional array in GoLang?

How to create an n-dimensional array in GoLang? For example, as in Python numpy, where you can create an array of zeros with a single function numpy.zeros([n чисел])

The rotation matrix, why doesn't it work as expected?

There is a rotation matrix In my program it works correctly, rotate the point at a specified angle, but I can't understand w ... riment programmatically, I got the same result: rotation in the opposite direction. Maybe someone knows something about this?

Spiral matrix from the center, python

Help make the matrix fillings spiral out of the center. I'm already confused about these indexes. Here are my attempts to do ... 3) print() At the moment, the output looks like this: 7 8 1 6 0 2 5 4 3 Where does it go wrong?

(Python) Matrix, number substitution

At the bottom, I attached a code to fill in the matrix, if it is not convenient, you can change it. The brightness of the im ... jmax = c+1 if(A[i][c] < min): min = A[i][c] imin = i+1 jmin = c+1

How to calculate the determinant of the matrix more efficiently?

The code below counts the determinant of the 20x20 matrix by the minor method and records the time it took to calculate it. B ... nge(N)] print(f"result:\t{division(matrix)}") for i in range(N): print(matrix[i]) print(f"Time:\t{time.time() - timer}")

scipy.linalg.solve banded. Which matrix should I use for the run-through method?

I want to use the scipy.linalg.solve_banded method to solve SLOUGH, but I can't figure out how the ribbon matrix is represent ... од x[n-1] = f[n-1]/A[n-1][n-1]; for i in range(n - 2, -1, -1): x[i]=(f[i] - A[i][i + 1]*x[i+1]) / A[i][i] #Вывод print(x)

Tell me if I think correctly-c++Matrix

Initially, it had a code that output the matrix. I made 2 columns of 3 numbers in the range from 1 to 6. Then I started ex ... ;=N;i++){ for(j=1;j<=M;j++){ cout << a[i] <<"\t"; } cout << endl; } return 0; }

Reducing the lower triangular matrix to a symmetric one

There is a lower triangular matrix of the form: 0.0 0.5 0.0 0.4 0.6 0.0 Written as a list of lists [[0.0], [0.5, 0.0], [0. ... 0.0 0.6 0.4 0.6 0.0 I guess that there is some method in numpy, but I'm not very familiar with this package, I can't find

Reducing the matrix to a triangular shape

def Gauss(A): for k in range(len(A) - 1): At = A.copy() for i in range(len(A)): for j in range( ... and why there are no changes in the matrix on line 7, despite the fact that if you remove line 8, then there will be changes?

Adding and multiplying matrices in PyTorch

Part 1 IN: A = torch.tensor([1,2]) B = torch.tensor([[1,2],[2,4]]) print(A+B) OUT: tensor([[2, 4], [3, 6]]) ... ensor([[-7,5],[2,-1]]) print(A*B) OUT: RuntimeError Question: And why can't I multiply the matrices A(3x2) and B (2x2)?

VBA Excel matrix addition

You need to add up the matrices using VBA Excel. For multiplication, there is a function of the MMult sheet, for addition, I ... will slow down calculations very much. On the addition of a matrix of type C=A+B, the interpreter swears-incompatible types.

The Gram-Schmidt process (orthogonalization of the matrix)

It is required to write a program (using functions) for the Gram-Schmidt process (orthogonalization only) for the matrix A nx ... an with columns imho). But I can't figure out how to proceed. At least I have a hint of how to organize everything correctly.

Multiplying a matrix by a c# WPF vector

It is necessary to multiply the matrix by the vector, while full manipulation of the matrix should be available, how much I f ... } matrix1[i].Add(num); num=0; } } return matrix1; } }

How to check the degeneracy of a matrix

A perfect match in a graph exists if and only if the determinant of the adjacency matrix of the graph is nonzero. It is neces ... the answer may be incorrect due to rounding. Question: how else can we check the degeneracy of a matrix quickly using python?

Multiplication of c++ matrices [closed]

Closed. This question is off-topic. Answers to it are not accepted at the moment. ... ion for matrix multiplication (the number of rows of one=the number of columns of the second) is checked in another function.

Working with np.array arrays in python - how to multiply arrays of matrices of the same length element-by-element?

There is an np. dot method that allows you to multiply a pair of matrices. Is there any syntax or other method that allows yo ... in one cycle, but the running time is too long. I would like the multiplication to occur in parallel, preferably using numpy

C. Why is the dimension of the matrix from the text file not written to memory?And how to do it?

In the program where I did not use the function, but wrote everything in the program body, there were no problems.Everything ... ing\n"); for (i = 0; i < r1; i++) { for (j = 0; j < c2; j++) printf("%3d ", C[i][j]); printf("\n"); } return 0; }