matrix of all 1s

Open discussion for MAGMA library (Matrix Algebra on GPU and Multicore Architectures)

matrix of all 1s

Postby gerstein » Mon Apr 25, 2016 10:24 pm

How do I create an nxn matrix whose entries are all 1's ?
gerstein
 
Posts: 2
Joined: Mon Apr 25, 2016 10:19 pm

Re: matrix of all 1s

Postby mgates3 » Wed Apr 27, 2016 4:14 pm

On the CPU, LAPACK's [sdcz]laset function. MAGMA declares these in a separate LAPACK header. For a double precision, M x N matrix A, embedded in an lda x N array:

Code: Select all
#include "magma_lapack.h"

void function(...) {
    ...
    double c_one = 1.0;
    lapackf77_dlaset( "Full", &M, &N, &c_one, &c_one, A, &lda );
}


On the GPU, MAGMA has a similar function, magmablas_[sdcz]laset.
http://icl.cs.utk.edu/projectsfiles/mag ... 663900ae83

-mark
mgates3
 
Posts: 738
Joined: Fri Jan 06, 2012 2:13 pm

Re: matrix of all 1s

Postby gerstein » Wed Apr 27, 2016 4:19 pm

I am new to Magma (and to any computer algebra system), and I can't understand this at all. I'm guessing that there is a simple command available to produce an nxn matrix of ones, but I am unable to extract this from the response to my question of how to do it.
gerstein
 
Posts: 2
Joined: Mon Apr 25, 2016 10:19 pm

Re: matrix of all 1s

Postby mgates3 » Wed Apr 27, 2016 4:24 pm

Are you using MAGMA, the computer algebra system:
http://magma.maths.usyd.edu.au/magma/

Or MAGMA, the linear algebra C/C++ library?
http://icl.cs.utk.edu/magma/

This forum is for the later, the linear algebra C/C++ library.

-mark
mgates3
 
Posts: 738
Joined: Fri Jan 06, 2012 2:13 pm


Return to User discussion

Who is online

Users browsing this forum: No registered users and 2 guests

cron