How to add columns to a big numpy matrix

I happen to have a 2-D numpy matrix of the form 2 3 1 2 3 9 . . I need to add another column to it so that it represents the squared sum of the first two columns like : 2 3 13 1 2 5 3 9 36 . . what numpy functions should I use to add this th...
more »

2017-10-01 20:10 (3) Answers

Achieving batch matrix multiply using tensordot

I'm trying to achieve the same behaviour as np.matmul parallel matrix multiplication using just tensordot,dot and reshaping etc. The library I am translating this to using does not have a matmul that supports parallel multiplication, only dot and te...
more »

2017-09-18 19:09 (1) Answers

Computing the null space of a bigmatrix in R

I can not find any function or package to calculate the null space or (QR decomposition) of a bigmatrix (from library(bigmemory)) in R. For example: library(bigmemory) a <- big.matrix(1000000, 1000, type='double', init=0) I tried the following...
more »

2017-09-16 13:09 (1) Answers

return matrix on C

Here is my code below. #include <stdio.h> #define _USE_MATH_DEFINES #include <math.h> void rot(int angle); static double R[3][3]={0}; int main(void) { int angle = 30; rot(angle); int i, j = 0; for (i = 0; i < 3;i++) ...
more »

2017-09-16 08:09 (2) Answers

VBA creation of a Matrix and double loop

I have a lot of Excel files in one folder and for each one I have (H:H) which contains a certain hour from 00:00 to 23:59 (appears within H at the format 0000 or 2359 etc ..) . Then, at a certain hour we associate a certain number of operation (conta...
more »

2017-09-11 20:09 (0) Answers

Iterate over list of NumPy matrices

I've got a list with row matrices: rows = [ matrix([[1, 0, 0]]), matrix([[0, 1, 0]]), matrix([[0, 0, 1]]) ] and I attempted to loop over these using for (a, b, c) in rows:, but instead of this working, I got an error: ValueError: not enough valu...
more »

2017-09-07 22:09 (3) Answers

caching the matrix value in R Permanently

I am working on caching a matrix and its inverse in R, I tried working on with the R.cache package but that doesn't give the result expected. I have included my code and the actual output that I am getting and also included the output that I expect p...
more »

2017-09-07 04:09 (0) Answers

Replace matrix values for each array element

I have a 3-dimensional array arr where each array element is a matrix with the same number of rows and columns. Then I have a 3-column matrix m where the first two columns specify an index (row and column) and the last column a value. arr = array(0...
more »

2017-09-06 16:09 (1) Answers