linear-algebra

Matrix classes in c++

I'm doing some linear algebra math, and was looking for some really lightweight and simple to use matrix class that could handle different dimensions: 2x2, 2x1, 3x1 and 1x2 basically. I presume such class could be implemented with templates and using some specialization in some cases, for performance. Anybody know of any simple implement...

Algorithm that takes 2 'similar' matrices and 'aligns' one to another

First of all, the title is very bad, due to my lack of a concise vocabulary. I'll try to describe what I'm doing and then ask my question again. Background Info Let's say I have 2 matrices of size n x m, where n is the number of experimental observation vectors, each of length m (the time series over which the observations were collect...

Programming a smooth change of thrust from current velocity vector to a target vector.

TL;dr: "I am not sure how to calculate a smooth transition of thrust between one vector and another." I am programming a simple game where an enemy chases after the player in an open space (no walls). I was calculating the enemy's x & y velocities independently, accelerating them if they were taking them in the direction of the player a...

How do I create an identity matrix of arbitrary size in Java?

Is there a utility to create an identity matrix of specified size in Java? ...

Any open source library for sparse linear algebra in OpenCL?

I am looking for some sparse linear algebra OpenCL kernels such as blas vector/vector operations and matrix / vector operations but with sparse data structures. Ideally that library would feature most of scipy.sparse but using OpenCL kernels instead of scalar C code wrapped in python ndarrays. After some googling I could not find anythi...

What are the most widely used C++ vector/matrix math/linear algebra libraries, and their cost and benefit tradeoffs?

It seems that many projects slowly come upon a need to do matrix math, and fall into the trap of first building some vector classes and slowly adding in functionality until they get caught building a half-assed custom linear algebra library, and depending on it. I'd like to avoid that while not building in a dependence on some tangenti...

Sparse linear algebra solvers for C#

I'm working on an experimental implementation of Goldenthal et.al's inextensible cloth algorithm in C#. First I used Math.NET Iridium to assemble and solve the matrices, but quickly replaced this with dnAnalytics since the latter allows me to reuse matrices, almost eliminating further memory allocation, which is important for real-time...

C++ libraries for Image Segmentation

Hi, I am going to do a project in Data Mining related to image clustering (in C++) .I am looking for a powerful library which is helpful in image processing, linear algebra and 3d graphics. Any thoughts? Thanks. ...

Solving a matrix in MATLAB?

How does one solve the (non-trivial) solution Ax = 0 for x in MATLAB? A = matrix x = matrix trying to solve for I've tried solve('A * x = 0', 'x') but I only get 0 for an answer. ...

Rotation about the Y-Axis

Doing a couple rotations in Matlab, one which is rotation about the y-axis, however online I've found two different answers: here and here. Which is correct, if both how does one get to the other? ...

"Cloning" row or column vectors

Hello, Sometimes it is useful to "clone" a row or column vector to a matrix. By cloning I mean converting a row vector such as [1,2,3] Into a matrix [[1,2,3] [1,2,3] [1,2,3] ] or a column vector such as [1 2 3 ] into [[1,1,1] [2,2,2] [3,3,3] ] In matlab or octave this is done pretty easily: x = [1,2,3] a = ones(3,1) ...

finding matrix through optimisation

I am looking for algorithm to solve the following problem : I have two sets of vectors, and I want to find the matrix that best approximate the transformation from the input vectors to the output vectors. vectors are 3x1, so matrix is 3x3. This is the general problem. My particular problem is I have a set of RGB colors, and another se...

CSS Transformation

Hello, how can I change with CSS (-moz-transform) a div that should look like this: ...

Clojure Matrix Representation

What is a good representation for matrices in Clojure? I'm interested in dealing with dense matrices of floating point numbers. The "list of lists" representation springs to mind, but is there something better? Some criteria for a good representation include: Efficiency: They won't be used for constant processing of huge data sets, bu...

How to get the plane out of a arbitrary collection of points?

I've got a arbitrary collection of 3d points, i know they're coplanar, but how do i calculate that plane? ...

Transforming captured co-ordinates into screen co-ordinates

Hi everyone. I think this is probably a simple maths question but I have no idea what's going on right now. I'm capturing the positions of "markers" on a webcam and I have a list of markers and their co-ordinates. Four of the markers are the outer corners of a work surface, and the fifth (green) marker is a widget. Like this: Here's ...

Linear Independence Matrix

Suppose we have a m by n matrix A with rank m and a set K⊆{1..n} such that the columns of A indexed by K are linearly independent. Now we want to extend K and find a set L so that k⊆L and columns indexed by L are linearly independent too. One way of doing it would be to start adding column indexes to K and test if the new set are linear...

Solving for variables in an over-parameterised system

I am trying to write a Matlab program that accepts variables for a system from the user, but there are more variables than system parameters. To be specific, six variables in three equations: w - d - M = 0 l - d - T = 0 N - T + M = 0 This could be represented in matrix form as A*x=0 where A = [1 0 0 -1 0 -1; 0 1 0 -1 -1 0;...

How do I use the least squares approximation in MATLAB?

For a homework assignment in linear algebra, I have solved the following equation using MATLAB's \ operator (which is the recommended way of doing it): A = [0.2 0.25; 0.4 0.5; 0.4 0.25]; y = [0.9 1.7 1.2]'; x = A \ y which produces the following answer: x = 1.7000 2.0800 For the next part of assignment, I'm supposed to solve the ...

How to Get a Quantitative Comparison of Two Signals

I’m trying to implement a Blind Source Separation (BSS) algorithm and I’m running into trouble determining the efficacy of the algorithm. I’m trying to create test cases where I work backwards and start with a signal vector s, which is normally unknown, and then create a mixing matrix A, which I use to transform s to create the observa...