nrm2= PyPBLAS.pvnrm2(x)
La función "PyPBLAS.pvnrm2" calcula la norma de un vector x. Este vector de
entrada x deberá ser del tipo PyACTS por lo que habrá que utilizar las funciones
que convierten de otros tipos a PyACTS.
Las características de cada uno de los parámetros son las siguientes:
Parametros de Entrada
Parametros de Salida
x.
from PyACTS import *
import PyPBLAS
from RandomArray import *
from Numeric import *
#Dimension of Arrays
n=4
#Initiliaze the Grid
PyACTS.gridinit()
if PyACTS.iread==1:
print "Example of using PyPBLAS: PvNRM2"
print "Parameters:N=",n,";Grid:",PyACTS.nprow,"*",PyACTS.npcol
print "Block's size:",PyACTS.mb,"*",PyACTS.nb
x=2*ones([n,1],Float)
print "x'=",transpose(x)
else:
x,y=None,None
#We convert Numeric Array to PyACTS.Scalapack Array
ACTS_lib=1 # 1=Scalapack
x=Num2PyACTS(x,ACTS_lib)
#We call PyPblas Routine
nrm2= PyPBLAS.pvnrm2(x)
if PyACTS.iread==1:
print "PvNRM2=",nrm2
PyACTS.gridexit()
from PyACTS import *
import PyPBLAS
from RandomArray import *
from Numeric import *
#Dimension of Arrays
n=4
#Initiliaze the Grid
PyACTS.gridinit()
if PyACTS.iread==1:
print "Example of using PyPBLAS: PvNRM2"
print "Parameters:N=",n,";Grid:",PyACTS.nprow,"*",PyACTS.npcol
print "Block's size:",PyACTS.mb,"*",PyACTS.nb
x=2*ones([n,1],Float)
print "x'=",transpose(x)
else:
x,y=None,None
#We convert Numeric Array to PyACTS.Scalapack Array
ACTS_lib=1 # 1=Scalapack
x=Num2PyACTS(x,ACTS_lib)
#We call PyPblas Routine
nrm2= PyPBLAS.pvnrm2(x)
if PyACTS.iread==1:
print "PvNRM2=",nrm2
PyACTS.gridexit()
See Sobre este documento... para sugerencias en cambios.