matrix

Matrix in python

Hi, I am very new to Python, I need to read numbers from a file and store them in a matrix like I would do it in fortran or C; for i for j data[i][j][0]=read(0) data[i][j][1]=read(1) data[i][j][2]=read(2) ... ... How can I do the same in Python? I read a bit but got confused with tuples and similar things If you could ...

Passing Boost uBLAS matrices to OpenGL shader

I'm writing an OpenGL program where I compute my own matrices and pass them to shaders. I want to use Boost's uBLAS library for the matrices, but I have little idea how to get a uBLAS matrix into OpenGL's shader uniform functions. matrix<GLfloat, column_major> projection(4, 4); // Fill matrix ... GLuint projectionU = glGetUniformLocat...

Where can I obtain the matrix layout of keyboards?

Hi, I'm designing a system where some of the commands require multiple key presses (in order to avoid accidental execution of certain commands). However, in order to do that in a way that will avoid keyboard jamming, I want to select the key combination according to the matrix layout of the keyboard (All the systems will have the same k...

How do I specify non-scalar parameters in a Slim table?

I want to test functions that have non-scalar parameters and return types, e.g., "given a matrix M, check that M times its inverse is the appropriate identity" or "given a row vector V, check that transpose(V) is the correct column vector. Do I need a clever use of TableTable? ...

Matrix "Zigzag" Reordering

I have an NxM matrix in Matlab that I would like to reorder in similar fashion to the way JPEG reorders its subblock pixels: (referenced from here) I would like the algorithm to be generic such that I can pass in a 2D matrix with any dimensions. I am a C++ programmer by trade and am very tempted to write an old school loop to accomplis...

Best way in Python to determine all possible intersections in a matrix?

So if I have a matrix (list of lists) where each column represents a unique word, each row represents a distinct document, and every entry is a 1 or 0, indicating whether or not the word for a given column exists in the document for a given row. What I'd like to know is how to determine all the possible combinations of words and documen...

Column header direction is SSRS Matrix

Hi is it possible to change the direction of column header values ? By default header valules displayed in horizontal direction only. But I want to show the values in vertical direction. Is it possible? I tried from the last 3 days. But no where I got any good results. Thanks in advance ...

I want to make a wrapped acces type for certain internals of one of classes and I have some performance questions

I am writing an abstract matrix class (and some concrete subclasses) for use on very differing hardwares/architectures, etc. and I want to write a row and column type that provides a transparent reference to the rows and columns of the matrix. However, I want to tune for performance, so I'd like this class to be essentially a compiler ...

How can I accumulate cells of different lengths into a matrix in MATLAB?

So, I have a cell-array of 1xN vectors of different lengths. I want to append them into a matrix so I can display them with imagesc. Obviously the matrix must be the width of the largest vector. My current code for this is below: tcell = {[1,2,3], [1,2,3,4,5], [1,2,3,4,5,6], [1], []}; lens = cellfun('length', tcell); rmat = NaN(length(...

dximagetransform.matrix, absolutely position child elements not rotating in IE 8 standards mode

I've looked all over for more information on this, and would like to know why it happens. Here's the code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html> <head> </head> <body> <div style="position:absolute; top:200px; left:200px; height:200px;...

Initialization of a vector of vectors?

Is there a way to initialize a vector of vectors in the same ,quick, manner as you initialize a matrix? typedef int type; type matrix[2][2]= { {1,0},{0,1} }; vector<vector<type> > vectorMatrix; //??? ...

vector holding read-only matrices?

I want to use a vector to hold read-only integer-matrices of the size 5x5 vector<const int[5][5]> startingPieces; But this declaration causes a bunch of weird errors I've never ever seen before. error C2535: 'const int (*std::allocator<_Ty>::address(const int (&)[5][5]) const)[5][5]' : member function already defined or declared 1> ...

Accessing a subslice of a boost matrix in a helper class

I'm trying to build a class that eases the use of the boost boost::numeric::ublas::matrix. Thus I've got: using namespace boost::numeric::ublas; typedef matrix<double> matrix_t; class Tensor : public matrix_t { public: Tensor (const int M, const int N) : matrix_t(M, N) { } virtual ~Tensor() { } Tensor SubMatrix (const...

AS3 Matrix Rotation

I'm trying to rotate a string file by utilizing flash.geom.matrix but I'm clueless. How do you essentially input data into a matrix? I know that you can input data into a, b, tx, ty, etc. but these affect skewing, enlarging, and other stuff. I simply just want to create a M X N matrix with some data that can be rotated. Any help? ...

What techniques exists in R to visualize a "distance matrix" ?

Hi all, I wish to present a distance matrix in an article I am writing, and I am looking for good visualization for it. So far I came across balloon plots (I used it here, but I don't think it will work in this case), heatmaps (here is a nice example, but they don't allow to present the numbers in the table, correct me if I am wrong. ...

Android efficient matrix library

Hi Is there any efficient linear algebra library for android? I need to compute matrices of different sizes(also bigger than 4x4) and rectangular too. Thanks. ...

How to do PHP matrix operation easily and gracefully?

I've a $max which is essentially a two dimensional array. Each element in $max is eithor 1 or 0, can be denoted by $max[$x][$y], where $x is an integer within 0~WIDTH,similar for $y My purpose is to find rows and columns in the $maxthat sums up greater than a CONSTANT, and get the average distance between rows/columns that qualify. ...

3d geometry: how to interpolate a matrix

hello, i store the position of an object in 3d space in a 4by4 transformation matrix. now in order to move the object from the position stored in matrix A to the position stored in matrix B, i would like to interpolate them. so do i just do this by interpolating each of the 16 values in the matrix, or do i have to take special care abo...

How do I find all sets of matrix columns that together contain a value for every row?

Given a matrix of boolean values (example): a b c +-------- X | 1 0 1 Y | 1 1 1 Z | 0 1 1 +-------- What's the optimum way to find all sequences [a|b|c] such that each sequence has at least one "true" (1) value for each of X, Y and Z. In the example above, the set of sequences is (in no particular order): abc...

OpenGL ES: Disabling transformation?

This NVIDIA video podcast (dated?) suggests bypassing OpenGL's matrix stack as a performance tip. It also suggets to bypass OpenGL's lighting, which implies that their intention is to actually transform the geometry manually. I happen to do this anyway for other reasons. Ofcourse, it doesn't make sense that you'll actually benefit from ...