4 posts
• Page **1** of **1**

How do I create an nxn matrix whose entries are all 1's ?

- gerstein
**Posts:**2**Joined:**Mon Apr 25, 2016 10:19 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:

On the GPU, MAGMA has a similar function, magmablas_[sdcz]laset.

http://icl.cs.utk.edu/projectsfiles/mag ... 663900ae83

-mark

- 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:**765**Joined:**Fri Jan 06, 2012 2:13 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

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

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:**765**Joined:**Fri Jan 06, 2012 2:13 pm

4 posts
• Page **1** of **1**

Users browsing this forum: Bing [Bot] and 2 guests