System of linear equations Cholesky method
Code: "jplasma_Cholesky.py". Programming language: Python DMelt Version 1.4. Last modified: 06/09/2018. License: Pro
https://datamelt.org/code/cache/jplasma_Cholesky_5756.py
To run this script using the DMelt IDE, copy the above URL link to the menu [File]→[Read script from URL] of the DMelt IDE.


from  edu.emory.mathcs.jplasma.tdouble import Dplasma;
from  edu.emory.mathcs.utils import ConcurrencyUtils;
from jarray import *
from java.lang import Math

M=15;	N=10;	NRHS=5;
A=zeros(M*N, 'd'); 	B=zeros(M*NRHS,'d')

for i in range(M):
	for j in range(N):
		A[M*j + i] = 0.5 - Math.random()

for i  in range(M):
	for  j  in range (NRHS):
		B[M * j + i] = Math.random()

ConcurrencyUtils.setNumberOfThreads(4) # (Optional step) Set the maximum number of threads
Dplasma.plasma_Init(M, N, NRHS)               #  Plasma Initialize
Dplasma.plasma_set_int(Dplasma.PLASMA_CONCURRENCY, 2)
INFO = Dplasma.plasma_DPOSV(Dplasma.PlasmaUpper, N, NRHS, A, 0, N, B, 0, N);
Dplasma.plasma_Finalize()
if INFO < 0:
            print "-- Error in DgelsExample example !"
else:
            print  "-- Run successful !"
           


You see the box below because you did not login.