matrix

How do I make a matrix from a list of vectors in R?

Goal: from a list of vectors of equal length, create a matrix where each vector becomes a row. Example: > a <- list() > for (i in 1:10) a[[i]] <- c(i,1:5) > a [[1]] [1] 1 1 2 3 4 5 [[2]] [1] 2 1 2 3 4 5 [[3]] [1] 3 1 2 3 4 5 [[4]] [1] 4 1 2 3 4 5 [[5]] [1] 5 1 2 3 4 5 [[6]] [1] 6 1 2 3 4 5 [[7]] [1] 7 1 2 3 4 5 [[8]] [1] 8 1 2 3...

What is a Matrix Table ?

Can somebody give me a picture as to what Matrix Tables are in the area of Database and the context in which they are best used ? Thanks, ...

Matrix3D.pointAt in Silverlight 3.0

Has anyone one every created a method for Silverlight which does the same thing as Matrix3D.pointAt() does in Flash? In flash pointAt rotates a display object so that it faces a specified position. In my situation I want it to face the same direction as its velocity vector. ...

mapping from normalized device coordinates to view space

Hey there! I'd like to map from normalized device coordinates back to viewspace. The other way arround works like this: viewspace -> clip space : multiply the homogeneous coordinates by the projection matrix clip space -> normalized device coordinates: divide the (x,y,z,w) by w now in normalized device coordinates all coordinates wh...

Matrix rotateAt c#

Hello, Im trying to rotate a image with matrix object and can't get it right When i rotate the image i got a black spot, it's one pixel wrong and it's the same with 180 angle and 270 angle. 90 angle ex. A picture of this problem: http://www.spasm-design.com/rotate/onePixelWrong.jpg And here is the code: public System.Drawing.Image...

Interpolation on excel

Hi to all I've a source data like this: 35 40 -15 15.0 15.1 -10 17.2 17.4 -5 19.7 19.8 and I need to find the value in (-16, 37). I've tried with linear interpolation but I can solve only with (x,y) couple of values. Could you help me? thanks a lot, Andrea ...

How do you dynamically allocate a matrix?

How do you dynamically allocate a 2D matrix in C++? I have tried based on what I already know: #include <iostream> int main(){ int rows; int cols; int * arr; arr = new int[rows][cols]; } It works for one parameter, but now for two. What should I do? ...

How do you write a CSV in R with the matrix names (dimnames(M)) intact in R?

Is there a command in R that will allow you to write a CSV file that has the row and column names of a matrix (dimnames(M))? Whenever I output the file, the names are gone. help(write) doesn't mention that this is possible to do. ...

double[,], int[], bool[] ... matrix,vector manipulation extensions in C#

I need(for rapid prototyping and libraries integration) something like this(extensions for usual arrays) double[] d; d.SetRow(1,{ 1.1 , 2.0 ,3.3}); var r = d.GetRow(1); d = d.AppendRight(new int[]{1,2,3}); ... Does exist such thing anywhere? On may be anybody implemented it so I do not need do i for me myself? ...

Coordinate Transformation C++

Hello, I have a webcam pointed at a table at a slant and with it I track markers. I have a transformationMatrix in OpenSceneGraph and its translation part contains the relative coordinates from the tracked Object to the Camera. Because the Camera is pointed at a slant, when I move the marker across the table the Y and Z axis is updated, ...

Symmetrically adressable matrix

I'm looking to create a 2d matrix of integers with symmetric addressing ( i.e. matrix[2,3] and matrix[3,2] will return the same value ) in python. The integers will have addition and subtraction done on them, and be used for logical comparisons. My initial idea was to create the integer objects up front and try to fill a list of lists wi...

Windows Magnification API, .NET and matrices.

I'm trying to create a magnifier app in .net using the Windows Magnification API. I've pretty much got everything working except for actually setting the magnification level (which defaults to 100%). The problem is, I can't find any examples anywhere on the net and all the documentation for the API is C++ code. This is the particular ...

Quickly generate the cartesian product of a matrix

Let's say I have a matrix x which contains 10 rows and 2 columns. I want to generate a new matrix M that contains each unique pair of rows from x - that is, a new matrix with 55 rows and 4 columns. E.g., x <- matrix (nrow=10, ncol=2, 1:20) M <- data.frame(matrix(ncol=4, nrow=55)) k <- 1 for (i in 1:nrow(x)) for (j in i:nrow(x)) { ...

What is a good free (open source) BLAS/LAPACK library for .net (C#)?

Dear all I have a project written in C# where I need to do various linear algebraic operations on matrices (like LU-factorization). Since the program is mainly a prototype created to confirm a theory, a C# implementation will suffice (compared to a possibly speedier C++ one), but I would still like a good BLAS or LAPACK library availab...

Making Dynamic and Static columns play nicely in Matrix in SSRS 2005

I have a report that shows financial data by year along with a few other bits of static data: every time I try to put in a Column group, it does either above or below the static data: FiscalYear StaticData1 | StaticData2 | StaticData3 | StaticData4 Or: StaticData1 | StaticData2 | StaticData3 | StaticData4 FiscalYear What I want is tha...

Transpose a 2D array

How do you efficiently transpose a matrix? Are there libraries for this, or what algorithm would you use? E.g.: short src[W*H] = { {1,2,3}, {4,5,6} }; short dest[W*H]; rotate_90_clockwise(dest,src,W,H); //<-- magic in here, no need for in-place //dest is now: { {4, 1}, {5, 2}, {6, 3} }; (In my specific case its src arr...

Speed up text comparisons (with sparse matrices)

I have a function which takes two strings and gives out the cosine similarity value which shows the relationship between both texts. If I want to compare 75 texts with each other, I need to make 5,625 single comparisons to have all texts compared with each other. Is there a way to reduce this number of comparisons? For example sparse m...

Rotating cordinates around pivot? (tetris)

Hi guys, I'm attempting to design my very own tetris clone but have run into a little problem with shape rotations. I have a 2 dimensional array representing a 10 x 20 game grid and individual shape objects which when initialised contain coordinates of where on the grid the shape will start falling from. So for example, when the user m...

Read a txt file containing a matrix of numbers separated by spaces and lines into an array

I've been trying to read a txt file containing a formatted matrix (9x9) into an int array. The txt file is selected by the user using NSOpenPanel. An example txt file: 2 7 9 1 6 2 1 1 1 9 1 3 3 4 0 6 8 5 5 3 2 9 3 8 6 7 0 6 0 9 2 5 6 4 8 0 3 2 0 4 0 5 0 6 0 4 0 5 4 0 3 9 0 0 6 4 1 3 2 5 7 2 0 6 5 7 2 1 3 0 9 3 1 0 2 7 5 1 0 0 0 I...

Hide matrix Gridlines SQL Server Reporting Services 2005

Hi, I am creating a report using SQL Server Reporting Services in Visual Studio 2005 (SSRS). I have placed a matrix in a list. The data and the matrix are working fine. However I can't seem to find a way to hide the matrix grid lines at runtime. Also, I have set the visibility of the static 1st column and 1st row to false, but when the ...