matrix Questions

4

There are two coordinate systems. We know the 3D coordinates of the origin and the 3D vectors of the axes of the second coordinate system with respect to the first coordinates system. Then how can ...
Catlett asked 21/12, 2015 at 8:57

3

Solved

I want to write applications in JavaScript that require a large amount of numerical computation. However, I'm very confused about the state of efficient linear-algebra-like computation in client-si...
Minny asked 21/3, 2017 at 2:51

5

Solved

I have a 70x70 numpy ndarray, which is mainly diagonal. The only off-diagonal values are the below the diagonal. I would like to make the matrix symmetric. As a newcomer from Matlab world, I can't...
Centipede asked 6/3, 2015 at 17:35

4

Solved

Thank you , i am trying to solve a project euler problem it wants me to print the sum of 21 22 23 24 25 20 7 8 9 10 19 6 1 2 11 18 5 4 3 12 17 16 15 14 13 this is formed by starting with the nu...
Abelabelard asked 4/1, 2014 at 20:0

2

Solved

I am new to using armadillo, and could not get the following in spite of trying / searching quite a bit. There are two huge (dynamic) arrays (not vectors) that I need to perform correlation on. I ...
Pinhead asked 14/10, 2013 at 22:10

2

Using the Eigen C++ library, how can I make a deep copy of a matrix? For example, if I have: Eigen::Matrix4f A; Eigen::Matrix4f B = A; And then I modify A, it will also modify B. But I want B to...
Resplendence asked 24/3, 2015 at 11:43

6

Solved

I need to calculate the number of non-NaN elements in a numpy ndarray matrix. How would one efficiently do this in Python? Here is my simple code for achieving this: import numpy as np def numbe...
Rogue asked 14/2, 2014 at 11:26

3

Solved

I am looking for finding or rather building common eigenvectors matrix X between 2 matrices A and B such as : AX=aX with "a" the diagonal matrix corresponding to the eigenvalues BX=bX wi...
Selfsustaining asked 3/1, 2021 at 9:49

17

Solved

I am looking to sort the following array based on the values of [][0] double[][] myArr = new double[mySize][2]; so for example, myArr contents is: 1 5 13 1.55 12 100.6 12.1 .85 I want it to get t...
Popp asked 16/3, 2013 at 17:35

4

There is a m x n matrix given each with integer elements. The problem says that we have to place two rooks on that matrix, such that they don't attack each other and the sum of the elements on whic...
Swot asked 13/11, 2020 at 4:34

3

Solved

I was wondering how to create a matrix and compute its inverse using SymPy in Python? For example, for this symbolic matrix:
Gallenz asked 21/11, 2010 at 17:34

2

Solved

rich.main3 is a linear model in R. I understand the rest of the elements of the list but I don't get what qraux is. The documentation states that it is a vector of length ncol(x) which contains...
Halo asked 3/8, 2016 at 10:34

4

Solved

I don't know if the title makes any sense. Normally an identity matrix is a 2D matrix like In [1]: import numpy as np In [2]: np.identity(2) Out[2]: array([[ 1., 0.], [ 0., 1.]]) and there's ...
Nalchik asked 4/9, 2017 at 0:46

5

Solved

I have two matrices a = np.matrix([[1,2], [3,4]]) b = np.matrix([[5,6], [7,8]]) and I want to get the element-wise product, [[1*5,2*6], [3*7,4*8]], which equals matrix([[5, 12], [21, 32]]) I have...

3

Solved

I am working on argmax function of PyTorch which is defined as: torch.argmax(input, dim=None, keepdim=False) Consider an example a = torch.randn(4, 4) print(a) print(torch.argmax(a, dim=1)) ...
African asked 15/4, 2019 at 14:50

7

Solved

Goal: from a list of vectors of equal length, create a matrix where each vector becomes a row. Example: > a <- list() > for (i in 1:10) a[[i]] <- c(i,1:5) > a [[1]] [1] 1 1 2 3 4 5...
Yeomanry asked 25/8, 2009 at 18:2

2

Solved

I guess this is more a math question than it is an OpenGL one, but I digress. Anyways, if the whole purpose of the perspective divide is to get usable x and y coordinates, why bother dividing z by ...
Solleret asked 30/8, 2014 at 16:44

2

I have a question on the eigen-decomposition of hundreds of small matrices using CUDA. I need to calculate the eigenvalues and eigenvectors of hundreds (e.g. 500) of small (64-by-64) real symmetr...
Dail asked 9/7, 2012 at 18:51

4

Solved

I am writing a function to take the Mahalanobis distance between two vectors. I understand that this is achieved using the equation a'*C^-1*b, where a and b are vectors and C is the covariance matr...
Transfiguration asked 2/8, 2012 at 20:26

1

We consider a bit matrix (n x m) to be a regular array containing n lines of integers of size m. I have looked in Hacker's Delight and in other sources and the algorithms I found for this were rath...

15

Solved

I'm looking for a Pythonic way to get all the diagonals of a (square) matrix, represented as a list of lists. Suppose I have the following matrix: matrix = [[-2, 5, 3, 2], [ 9, -6, 5, 1], [ 3, 2,...
Jack asked 11/6, 2011 at 0:38

3

Solved

For skeletal animation using colladas, I need to linearly interpolate between 2 matrices. I saw somewhere that I can use quaternions to interpolate between matrices, but that only works for the rot...
Loan asked 3/1, 2015 at 4:4

2

Solved

I have the following code that lives inside an optimization routine. Hence, while it's reasonably fast, profiling shows the line producing the result called res to be the largest bottleneck in my c...
Petrography asked 30/11, 2023 at 0:21

3

Solved

I have the intrisic and extrinsic parameters of the camera. The extrinsic is a 4 x 4 matrix with rotation and translation. I have sample data as under, I have this one per camera image taken. 2....

6

Solved

I am currently trying to convert some Python code into C++. One 'small' problem is changing the dimensions of a matrix. Is it possible to reshape a matrix in C++ similar to the Python reshape funct...
Towill asked 3/11, 2014 at 17:42

© 2022 - 2024 — McMap. All rights reserved.