matrix

Companion matrix complexity

Hi, I know this is more a complexity theory question than a programming question, hope I'm not doing the wrong thing writing here, apologize me if it's the wrong place but I hope someone of you have the answer. And it's even someway programmin related by being a complexity theory qestion. I'm studying Linear Recurring Sequences, and I r...

Can Any one offer me a sample in gdi+ to draw an image on canvas?

I need to draw an image with a certain angle on a canvas, it need to rotate angle N , and its center is on x, y Matrix myPathMatrix; myPathMatrix.Translate(x, y, MatrixOrderAppend); myPathMatrix.Rotate(angle, MatrixOrderAppend); canvas->SetTransform(&myPathMatrix); Draw(canvas);// draw the image myPathMatrix.Rotate(-an...

Finding row index containing maximum value using R

Given the following matrix lets assume I want to find the maximum value in column two. [1,2,3; 7,8,9; 4,5,6] I know max(matrix[,2]) will return 8. How can I return the row index, in this case row two? ...

MPI matrix multification compile err: undeclared

I coded a mpi matrix multification program, which use scanf("%d", &size), designate matrix size, then I defined int matrix[size*size], but when I complied it, it reported that matrix is undeclared. Please tell me why, or what my problem is! According Ed's suggestion, I changed the matrix definition to if(myid == 0) block, but got the sa...

MPI matrix multification compile err: undeclared with code

I coded a mpi matrix multification program, which use scanf("%d", &size), designate matrix size, then I defined int matrix[size*size], but when I complied it, it reported that matrix is undeclared. Please tell me why, or what my problem is! According Ed's suggestion, I changed the matrix definition to if(myid == 0) block, but got the sa...

Obtaining current ModelView matrix

In OpenGL, how do I read the current x/y translation in the modelview matrix? I know that you have to load the current matrix into an array and read the floats from there, but I don't know precisely how to do it. ...

Small matrices won't appear on the same line in LaTeX

I have a product of two matrices that I would like to appear next to each other on the same line. Even though I have shrunk them down to allow room, LaTeX automatically sends the second matrix to the next line so that they don't appear as a product. What's the word on the street? Thanks. ...

element-wise operations with boost c++ ublas matrix and vector types

i'd like to perform element-wise functions on boost matrix and vector types, e.g. take the logarithm of each element, exponentiate each element, apply special functions, such as gamma and digamma, etc. (similar to matlab's treatment of these functions applied to matrices and vectors.) i suppose writing a helper function that brute-force...

How do I construct the biadjacency matrix of a DAG?

For a bipartite graph, you can substitute the adjacency matrix with what is called its biadjacency matrix: The adjacency matrix A of a bipartite graph whose parts have r and s vertices has the form A = O B BT O where B is an r × s matrix and O is an all-zero matrix. Clearly, the matrix B uniquely represents the...

Appending a vector to an empty matlab matrix

I've got matlab code inserting n-dimensional points (n >1) into a matrix (myPointMatrix) and am having thoughts about how to insert the first point. Right now the program checks the size of myPointMatrix before inserting a point. If it is 1x1 myPointMatrix is set equal to the current point. Otherwise the current point is appended. This...

Fast Fourier Transform using a Vandermonde Matrix - Evaluation of Co-efficients?

Say i'm trying to evaluate the Polynomial: x^2 + 1 Using the Fast Fourier transform method for evaluating co-efficients. Now i can change this into matrix/vector form using the co-effcient as inputs for the fast fourier transform: so: x^2 + 1 = <1, 0, 1, 0> This is done by using the coefficient value e.g 1 = 1, 0x^1 = 0, X^2 = 1 a...

Compact MATLAB matrix indexing notation

I've got an n-by-k sized matrix, containing k numbers per row. I want to use these k numbers as indexes into a k-dimensional matrix. Is there any compact way of doing so in MATLAB or must I use a for loop? This is what I want to do (in MATLAB pseudo code), but in a more MATLAB-ish way: for row=1:1:n finalTable(row) = kDimensionalMa...

How do I resize a matrix in MATLAB?

Suppose I had a 1-by-12 matrix and I wanted to resize it to a 4-by-3 matrix. How could I do this? My current solution is kind of ugly: for n=1:length(mat)/3 out(n,1:3) = mat((n-1)*3+1:(n-1)*3+3); end Is there a better way to do this? ...

How to implement Matrix operations in Pascal?

I need to implement operations with matrices and size of matrix has to be variable. The only solution I came up with is to use linked list: [pointer to this row, pointer to another row] -> [element 1,1; link to another element] -> [element 1,2, link to another element] -> .... -> [nil] | v [pointer to this row, pointer to ano...

C#: Efficient algorithm to find greatest m elements in an N x N matrix

Hi, I would like to know if there's an efficient algorithm to find the greatest m elements in an N x N matrix, with a method header like this: double[] greatestValues(double[][] matrix, int numberOfElements); Any ideas? ...

Storage of sparse numerical data (e.g. inverted index) - any conventions?

Is there an accepted way of storing and accessing sparse numerical data (such as a search engine's inverted index / term by document matrix)? An RDBMS seems inappropriate for this kind of data, but it would be good to have it stored in some kind of database (saved to disk, running as a server, etc). Is there an accepted solution for this...

What does a circled plus mean?

Can someone explain the second, third and fourth rows in the calculation? I cannot understand the calculation "66 fa = 9c". The sum is clearly over "ff", so I am confused. The topic is simple encryption algorithm. Source ...

Matrix Library for .NET

I'm looking for a good (well-tested, fully-featured, and ideally with a nice interface) matrix library for .NET/C#. My main requirements here are only that it should be free (I don't particularly care whether it's open-source in this case) and preferably support sparse matrix operations. The obligatory requirements are all the basic oper...

equality of matrices of m * n

What is the most efficient way for checking for equality of two m * n matrices and more importantly the [i][j] index (or indices) which caused the two matrices to be unequal. In my case, 'm' is relatively small (<=4) and n is relatively large (<=512). Context of the problem : I have an Active Standby setup for my application. Whenever ...

Recommendations for C++ 3d vector/matrix library with targeted camera

I am writing a very simple 3d particle software rendering system, but I am only really interested in coding the particle system and the rasterizer, so what I am looking for, is the easiest way to go from 3d particle coordinates, through camera, to screen coordinates, but with features like variable FOV, and targeted (look at) camera. An...