matrix-multiplication

SVG Linear Gradient Scale and Translation Question

I have the following radial gradient: <radialGradient inkscape:collect="always" xlink:href="#linearGradient2454" id="radialGradient2460" cx="4022.8572" cy="5451.2656" fx="4022.8572" fy="5451.2656" r="3559.865" gradientTransform="matrix(-0.1071067,-0.1166362,0.1377765,-7.0459663e-2,276.61943,1452.439)" gradi...

How do you multiply a matrix by itself?

This is what i have so far but I do not think it is right. for (int i = 0 ; i < 5; i++) { for (int j = 0; j < 5; j++) { matrix[i][j] += matrix[i][j] * matrix[i][j]; } } ...

Clarification on FFT

I know there is something wrong with the following reasoning but I'm not sure what it is. The FFT: given two polynomials A = a_0 + a_1 x + a_2 x^2 + ... + a_n x^n and B = b_0 + b_1 x + b_2 x^2 + ... + b_n x^n you can compute the coefficients of the product AB = \sum _k = 0 ^ 2n ( \sum _ j = 0 ^ k (a_j b_{k-j}))x^k in O(n lo...

iPhone matrix multiplication and inversion

Hi all, I'm trying to apply a Kalman filter to the data coming out from the iPhone accelerometer. I need to perform matrix multiplication and inversion as fast as possible, so I was curious about the possibility of using the GPU to perform these two tasks. As of now I found only one reference for the matrix multiplication: float mBone01...

java matrix-multiplication (FAST)

I have to multiply 2 (most of the times) sparse matrix. Those matrix are pretty bit (about 10k*10k) and i've a two Xeon Quad core and just one thread for this job? is there any fast library for multi-thread moltiplication? any other advice? ...

compute only diagonals in matrix product in octave

Is there a way in octave to compute and store only the diagonal of a matrix product? Basically like doing vector = diag(A*B); I don't care about any of the values of A*B except those on the diagonal. The matrix to around 80k x 12 and 12 x 80k. So even if I didn't care about the speed/extra memory it simply wont fit in RAM. Strange, ...

Matrix multiplication using pairs

Hi, I am looking into alternate ways to do a Matrix Multiplication. Instead of storing my matrix as a two-dimensional array, I am using a vector such as vector<pair<pair<int,int >,int > > to store my matrix. The pair within my pair (pair) stores my indices (i,j) and the other int stores the value for the given (i,j) pair. I thought...

Matrix multiplication in java

Hi, I wanted to do matrix multiplication in Java, and the speed needs to be very good. I was thinking of calling R through java to achieve this. I had a couple of Qs though: Is calling R using Java a good idea? If yes, are there any code samples that can be shared? What are the other ways that can be considered to do matrix multip...

Strassen's Algorithm for Matrix multiplication c# implementation

Hi, I'm just doing a self-study of Algorithms & Data structures and I'd like to know if anyone has a C# (or C++) implementation of Strassen's Algorithm for Matrix Multiplication? I'd just like to run it and see what it does and get more of an idea of how it goes to work. ...

Multithreaded Multiplication of Large Non-sparse, Non-square Matrices in C/C++

All, I'm looking for recommendations for C or C++ libraries (preferably open source) that use multi-threaded techniques to multiply large, non-square, (e.g. 65536xn in size where n < 65536) non-sparse matrices. Thanks. -&& ...

What is Chain Matrix Multiplication ?

Hello, I am trying to understand what is a chain matrix multiplication and how it is different from a regular multiplication. I have checked several sourcers yet all seem to be very academically explained for me to understand. I guess it is a form of dynamic programming algorithm to achieve the operation in an optimised way but I didn'...

OpenGL ES 2.0: Object rotation problem

Hi everyone ! I know the following question have been asked many times on different forums, but after viewing different solutions, it still did not fix my problem, or maybe I did not get what they mean I am trying to model a pyramid using OpenGL ES 2.0 on the iPhone. I would like to allow the user to rotate this pyramid using the touch ...

Parallelizing the element wise multiplication of two matrices in F#

I'm trying to parallelize the element by element multiplication of two matrices in F#. I can't quite figure it out thought. I keep trying to create tasks but it never wants to compile. My non-working messy code is the following: let myBigElemMultiply (m:matrix) (n:matrix) = let AddTwoRows (row:int) (destination:matrix) (source1:matri...

How to efficiently store a matrix with highly-redundant values

I have a very large matrix (100M rows by 100M columns) that has a lots of duplicate values right next to each other. For example: 8 8 8 8 8 8 8 8 8 8 8 8 8 8 4 8 8 1 1 1 1 1 8 8 8 8 8 4 8 8 1 1 1 1 1 8 8 8 8 8 4 8 8 1 1 1 1 1 8 8 8 8 8 4 8 8 1 1 1 1 1 8 8 8 8 8 4 8 8 1 1 1 1 1 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 3 3 3 3 3 3 3 3 3 3 3...

How do you store a discretized 3D domain (for solve PDE) in sparse format, when boundary conditions can change?

Hello all, I am looking at solving a problem that is a PDE, and the 3D discretized domain can have a different boundary condition on each of the 6 boundaries (or all the same). What is the best way to put this sparse matrix into a compressed format? Is CSR going to be my only option here? I thought about using ellpack, but I am not sur...

How to find a 1x3 matrix with resultant as zero matrix in Matlab

I know a 3x3 matrix M, and I want to find a 1x3 matrix P. The given condition is: [p1 p2 p3]*[m11 m12 m13; m21 m22 m23; m31 m32 m33] = [0 0 0] Given is [m11 m12 m13; m21 m22 m23; m31 m32 m33] I have to find non trivial (non-zero) solution of [p1 p2 p3] using Matlab. I am wanting to be done in Matlab because its part of a code. If ne...

Matrix Transformation Problem - Z Axis Rotation is Skewing

For a simple 2d game I'm making I'm trying to rotate sprites around the z axis using matrices. I'm clearly doing something wrong as when I attempt to rotate my sprite it looks like it's being rotated around the screen origin (bottom, left) and not the sprite origin. I'm confused as my quad is at the origin already so I didn't think I nee...

Why is matrix multiplication in .NET so slow?

I don't quite understand what makes matrix multiplication in C#/.NET (and even Java) so slow. Take a look at this benchmark (source): Trying to find an updated benchmark. C#'s integer and double performance is damn close to C++ compiled with MSVC++. 87% as fast for double and 99% as fast for 32-bit integer. Pretty damn good, I'd say....

How would I go about converting ASM to PHP?

There is a program I would like to understand a bit more of, but most of it is in ASM. MatrixMultiply The reference page is here. I understand C++, but the ASM part is a bit vague. Can someone explain? ...

Factoring matrices into elementary matrices

Is there a package in MATLAB, Maple or Mathematica which does this? ...