matrix

LaTeX: How to add a matrix in a LaTeX document?

How to add a matrix in LaTeX? ...

A Transpose/Unzip Function in Python

I have a list of 2-item tuples and I'd like to convert them to 2 lists where the first contains the first item in each tuple and the second list holds the second item. For example: original = [('a', 1), ('b', 2), ('c', 3), ('d', 4)] # and I want to become... result = (['a', 'b', 'c', 'd'], [1, 2, 3, 4]) Is there a builtin function th...

How do you rotate a two dimensional array?

Inspired by Raymond Chen's post, say you have a 4x4 two dimensional array, write a function that rotates it 90 degrees. Raymond links to a solution in pseudo code, but I'd like to see some real world stuff. [1][2][3][4] [5][6][7][8] [9][0][1][2] [3][4][5][6] Becomes: [3][9][5][1] [4][0][6][2] [5][1][7][3] [6][2][8][4] Update: Nick'...

int matrix with pointers in C - memory allocation confusion

Hello! I'm having some issues with producing an int matrix without creating memory leaks. I want to be able to make a given (global) matrix into any size dynamically via read_matrix(). But then i want to be able to free the memory later on. So in my main method the second printf should result in a bus error since it should not have any ...

How do I get the current size of a matrix stack in OpenGL?

How do I get the current size of a matrix stack (GL_MODELVIEW, GL_PROJECTION, GL_TEXTURE) in OpenGL? I want this so that I can do some error checking to ensure that in certain parts of the code I can check that the matrix stacks have been left in the original condition. ...

GPU programming on Xbox 360

I'm looking for some insight into XNA on Xbox 360, mainly if its possible to run vector-based float mathematics on its GPU? If there's a way, can you point me into the right direction? ...

3d to 2d Projection Matrix

I have 3 points in 3d space. I know the exact locations of them. Suppose they are (x0,y0,z0) (x1,y1,z1) (x2,y2,z2) Also i have a camera that are looking at these 3 points and i know the 2d locations of those three points on camera view plane. So for example (x0,y0,z0) will be (x0',y0') and (x1,y1,z1) will be (x1',y1') and (x2,y2,z2) wil...

How can I sort a 2-D array in MATLAB with respect to one column?

I would like to sort a matrix according to a particular column. There is a sort function, but it sorts all columns independently. For example, if my matrix data is: 1 3 5 7 -1 4 Then the desired output (sorting by the first column) would be: -1 4 1 3 5 7 But the output of sort(data) is: -1 3 1 ...

Is there a library for Linear algebra matrix handling in Java?

Is there any libraries in java that allow using mathematical matrices? I am looking for a library that allows me to perform operations in matrices such as invert, scalar multiplication, linear transformations, etc. etc. etc. In a nutshell, the operations required for lineal algebra. ...

Invert 4x4 matrix - Numerical most stable solution needed.

I want to invert a 4x4 matrix. My numbers are stored in fixed-point format (1.15.16 to be exact). With floating-point arithmetic I usually just build the adjoint matrix and divide by the determinant (e.g. brute force the solution). That worked for me so far, but when dealing with fixed point numbers I get an unacceptable precision loss ...

determining points from set of pairwise distances

given a matrix of distances between points is there an algorithm for determining a set of n-dimensional points that has these distances? (or at least minimises the error) sort of like a n-dimensional version of the turnpike problem. The best I can come up with is using multidimensional scaling. ...

What is the easiest way to align the Z axis with a vector?

Given a point such as (0, 0, 0) and a vector like (x, y, z). What is the easiest way to align the negative Z-axis centered at (0, 0, 0) to point in the direction of this vector? Examples using OpenGL would be welcome, but not neccessary. ...

Python Inverse of a Matrix

How do I get the inverse of a matrix in python? I've implemented it myself, but it's pure python, and I suspect there are faster modules out there to do it. ...

MySource Matrix - Opinions

Has anyone had experience with MySource Matrix as a content management system? If so, thoughts/opinions/comments? Thanks in advance. ...

Best way to represent a 2-D array in C++ with size determined at run time

In C++ I'd like to do something like: int n = get_int_from_user(); char* matrix = new char[n][n]; matrix[0][0] = 'c'; //... matrix[n][n] = 'a'; delete [][] matrix; but of course this doesn't work. What is the best way to do something similar? I've seen some solutions to this but they seem pretty messy. ...

Does anyone have any experience using math.net

I have a project on my plate that will involve a lot of linear algebra; mostly matrix and vector algebra. I've been looking for a library to help me out, and I came across math.net http://mathnet.opensourcedotnet.info/ Math.net I am doing this project in .net 3.5 and will be using C# Does anyone have any experience with this librar...

How can I implement a RESTful webservice using C++?

Hi, I have to develop a computing intensive Web Service (say we are making really big Matrix computations) so I've think that the way to go is coding it in C++. I can't do a wrapper using SWIG or JNI in Java to benefit from the WS existing libraries because the computations are state dependant and involve big matrices. Passing those val...

Database Bejewelled Puzzle- How does this solution work?

I'm interested in the programming challenge presented by the game Bejewelled. It seems like a simple game but programmatically it's more complex that it looks. In my search for hints on how the board is evaluated, I came across this QUIZ put on by the good folks at Simple-Talk. They have posted the winning answer, but I'm tarred and f...

How can I calculate the inverse of a matrix?

Can somebody show me how to calculate the inverse of a matrix? I'm using VC++ 6.0 ...

.Net Matrix

Is there a standard .Net matrix class? I cannot find it if there is. If not, why not? It sounds like something people would need very frequently. Are there any non-standard libs you could recommend? ...