linear-algebra Questions
3
Lets say I have 3 Numpy arrays, A1,A2,A3, and 3 floats, c1,c2,c3
and I'd like to evaluate B = A1*c1 + A2*c2+ A3*c3.
Will Numpy compute it like the below example?
E1 = A1*c1
E2 = A2*c2
E3 = A3*c3...
Untidy asked 30/5, 2010 at 5:33
3
Solved
Is there a function in Eigen to compare vectors (matrices) using both relative and absolute tolerance aka numpy.allclose? Standard isApprox fails if one of the vectors is very close to zero.
Syconium asked 24/2, 2013 at 11:39
4
For a collision algorithm I am developing, I need to find out how to reflect a line over another.
Line 1:
y=ax+b
Line 2:
y=cx+d
Line 3:
(a result of reflecting line 1 over line 2) y=e...
Procto asked 30/6, 2013 at 23:42
5
Solved
We can do a slerp interpolation between two quaternions like this:
quat slerp(quat q1, quat q2, float t) {
float angle = acos(dotProduct(q1, q2));
float denom = sin(angle);
//check if denom is z...
Sthenic asked 16/7, 2020 at 20:35
2
I have a matrix A = np.array([[1,1,1],[1,2,3],[4,4,4]]) and I want only the linearly independent rows in my new matrix. The answer might be A_new = np.array([1,1,1],[1,2,3]]) or A_new = np.array([1...
Forbid asked 7/12, 2018 at 9:59
10
Solved
I've been reading a lot about this, the more I read the more confused I get.
My understanding: In row-major rows are stored contiguously in memory, in column-major columns are stored contiguously ...
Moneywort asked 23/11, 2015 at 2:8
6
I have two 2-D arrays with the same first axis dimensions. In python, I would like to convolve the two matrices along the second axis only. I would like to get C below without computing the convolu...
Himes asked 8/3, 2011 at 5:31
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
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
4
Solved
I have 2 lines. Both lines containing their 2 points of X and Y. This means they both have length.
I see 2 formulas, one using determinants and one using normal algebra. Which would be the most eff...
Bendite asked 28/12, 2010 at 3:40
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
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
I need to solve a set of simultaneous equations of the form Ax = B for x. I've used the numpy.linalg.solve function, inputting A and B, but I get the error
LinAlgError: Last 2 dimensions of the arr...
Badge asked 21/2, 2018 at 15:27
3
Solved
Inspired by the answer here, I would like to calculate the perpendicular distance (in vector format instead of just magnitude) from a point to a straight line in 3D space.
The above mentioned equat...
Dealate asked 8/7, 2023 at 17:8
4
Solved
After I learned how to use einsum, I am now trying to understand how np.tensordot works.
However, I am a little bit lost especially regarding the various possibilities for the parameter axes.
To ...
Elaina asked 26/1, 2017 at 9:22
2
Solved
What would be the most efficient way to multiply (element-wise) a 2D tensor (matrix):
x11 x12 .. x1N
...
xM1 xM2 .. xMN
by a vertical vector:
w1
...
wN
to obtain a new matrix:
x11*w1 x12*w2 ... x...
Danieldaniela asked 10/12, 2015 at 1:32
2
Solved
I am starting to test Haskell for linear algebra. Does anyone have any recommendations for the best package for this purpose? Any other good resources for doing basic matrix manipulation with Haske...
Experientialism asked 26/2, 2010 at 16:58
2
Background: I'm attempting to warp one face to another of a different shape.
In order to warp one image to another, I'm using a delaunay triangulation of facial landmarks and warping the triangles...
Amhara asked 15/7, 2015 at 23:15
4
Solved
I'm trying to understand how up vectors and lookAt() work together in three.js. I'm setting the up vector of this axisHelper, so that the Y axis always points at the target geo, which marks the pos...
Chrissa asked 10/12, 2013 at 22:12
3
Solved
I'm trying to deduct the 2D-transformation parameters from the result.
Given is a large number of samples in an unknown X-Y-coordinate system as well as their respective counterparts in WGS84 (lon...
Nu asked 18/6, 2013 at 14:24
3
Solved
When making predictions for a linear statistical model we usually have a model matrix X of predictors corresponding to the points at which we want to make predictions; a vector of coefficients beta...
Seldan asked 10/7, 2019 at 1:12
3
Solved
For a ray tracer project, I've been researching algorithms dealing with finding the intersection between rays and triangles (defined by three vertices). What I've found so far is that the Möller-Tr...
Waverly asked 31/5, 2017 at 3:31
7
Solved
If I have the upper triangular portion of a matrix, offset above the diagonal, stored as a linear array, how can the (i,j) indices of a matrix element be extracted from the linear index of the arra...
Tailband asked 23/11, 2014 at 6:16
1
Solved
When computing A @ a where A is a random N by N matrix and a is a vector with N random elements using numpy the computation time jumps by an order of magnitude at N=100. Is there any particular rea...
Fail asked 2/12, 2022 at 22:4
1 Next >
© 2022 - 2025 — McMap. All rights reserved.