Skip to main content

Questions tagged [linear-algebra]

For code aims to resolve problems of linear algebra like vectors, vectorial space, linear transformations and systems of equations.

Filter by
Sorted by
Tagged with
3 votes
2 answers
111 views

C - SIMD Code to invert a transformation matrix

I am writing a maths library for a raytracer project, and so I'm trying to make my heavy operations (like matrix inverse) more optimised. After doing some research, I discovered this trick to invert a ...
Astranged T'fyer's user avatar
1 vote
0 answers
63 views

Solving upper triangular matrix-vector equation in Rust

Most linear algebra libraries written for Rust, e.g. nalgebra or ndarray have type or trait requirements that mean their ...
Attack68's user avatar
  • 593
3 votes
3 answers
102 views

Determinant of matrix Python

This is an addition of my previous question Python matrix class. I've added a determinant function using Laplace expansion to my Matrix class. What I am looking for specifically is how 3x3 matrices ...
Linny's user avatar
  • 10.4k
8 votes
5 answers
1k views

Python matrix class

To prepare for my studies in linear algebra, I've decided to write a simple matrix class. This is the initial program, with functions to find the determinant and decomposition(s) to follow. I wanted ...
Linny's user avatar
  • 10.4k
2 votes
1 answer
138 views

Multithreaded sparse linear solver in Python

I would like to know if there are any multithreaded sparse linear solvers for LU decomposed sparse matrices. I want to increase the solving speed of a system like: ...
aqw's user avatar
  • 29
5 votes
3 answers
315 views

Find highest number of swaps within a set of possible duty swaps with networkx and PuLP

With huge help from Stack Overflow, I have created code which takes possible swap matches with given weights as an input and outputs a set of matches which gives the highest weight with the highest ...
Oehoe's user avatar
  • 53
2 votes
1 answer
81 views

Scene Hierarchy with Translation, Rotation and Scale

This code represents an Entity Component that holds and manipulates an entity's local and world transforms, dealing with hierarchy and translation/rotation/scale transformations. The code is written ...
Daniel Marques's user avatar
-1 votes
1 answer
45 views

Python manual SVD only working for some matrices - how to stabilize it? [closed]

I use the following code for a manual single value decomposition using numpy. Depending on the array I choose it sometimes works out well and I can verify the svd and sometimes it does not work out ...
LF-137's user avatar
  • 7
5 votes
2 answers
523 views

Partial pivoting code in python

...
JustAnotherMind's user avatar
1 vote
1 answer
278 views

Implementing Preconditioned conjugate gradient

I have implemented the Preconditioned Conjugate Gradient (PCG) method for solving a system of linear equations in Python and I would appreciate it if someone could verify its correctness since I am ...
blov's user avatar
  • 29
2 votes
1 answer
261 views

Python integer optimization with PuLP involving polynomials that I think can be faster

I have a problem where we are given multivariate polynomials in variables like y_i and z_j and the goal is to express them as sums of products of terms of the form y_i-z_j with nonnegative integer ...
Matt Samuel's user avatar
5 votes
2 answers
518 views

Generic matrix library in Java

I have this repository. The most important source files follow. com.github.coderodde.math.linear.matrix.AbstractMatrix.java: ...
coderodde's user avatar
  • 29.8k
2 votes
0 answers
63 views

Implementing PLU Decomposition in Rust

I am using abstalg, because I wanted to learn more about how to do this with generic fields, (So you can implement LU decomposition not just for floats). I used ...
Rainb's user avatar
  • 121
2 votes
1 answer
119 views

An implementation of Givens method for diagonalising symmetric matrices

So I tried to create a code which aims to diagonalise symmetric matrices via Givens algorithm. The program only works for symmetric matrices, for we know a symmetric matrix is always diagonalisable, ...
Henry's user avatar
  • 121
2 votes
1 answer
557 views

Matrix-vector multiplication with block-column distribution and MPI_Reduce_scatter

I'm studying MPI and I'm trying to solve the exercise (number 3.5) taken from Pacheco's book Introduction to parallel programming. Essentially the exercise is: Write an MPI program that computes the ...
bobinthebox's user avatar
5 votes
1 answer
215 views

Yet another mathematical vector class

This is an implementation of a mathematical vector. I am currently working on a linear algebra project and before proceeding further with other classes (matrix, polar_vector etc.) I would like to have ...
SomeonePassionate's user avatar
2 votes
2 answers
244 views

Coordinate Descent Non-negative Least Squares optimization

In my fast implementation of Non-negative Matrix Factorization (Rcpp Machine Learning Library, RcppML), about 40% of the runtime is spent solving Non-negative Least Squares (NNLS) systems (the rest of ...
zdebruine's user avatar
  • 153
5 votes
1 answer
224 views

Why is this tensor contraction so slow and how can I make it faster?

I am trying to calculate a specific complicated tensor contraction (of complex valued tensors) which appears as part of some other calculation and is called multiple times in a row, about 100 times or ...
HerpDerpington's user avatar
2 votes
1 answer
160 views

Solving a linear system with Gaussian Elimination

I decided to implement a solver for linear systems of equations based on the gaussian elimination and reduction to upper triangular form. The gaussian elimination is quite simple to implement but the ...
Caridorc's user avatar
  • 27.6k