18 #include "frobeniusupdate.h"
42 pastix_complex64_t *valptr = (pastix_complex64_t*)bcsc->Lvalues;
45 for( bloc=0; bloc < bcsc->cscfnbr; bloc++ )
47 for( j=0; j < bcsc->cscftab[bloc].colnbr; j++ )
49 for( i = bcsc->cscftab[bloc].coltab[j]; i < bcsc->cscftab[bloc].coltab[j+1]; i++ )
51 temp = cabs(valptr[i]);
86 pastix_complex64_t *valptr;
89 if( bcsc->Uvalues != NULL )
93 valptr = (pastix_complex64_t*)(bcsc->Uvalues);
94 for( bloc=0; bloc<bcsc->cscfnbr; bloc++ )
96 for( j=0; j<bcsc->cscftab[bloc].colnbr; j++ )
99 for( i = bcsc->cscftab[bloc].coltab[j]; i < bcsc->cscftab[bloc].coltab[j+1]; i++ )
101 sum += cabs(valptr[i]);
111 valptr = (pastix_complex64_t*)bcsc->Lvalues;
113 MALLOC_INTERN( sumrow, bcsc->gN,
double);
114 memset( sumrow, 0, bcsc->gN *
sizeof(
double) );
116 for( bloc=0; bloc < bcsc->cscfnbr; bloc++ )
118 for( j=0; j < bcsc->cscftab[bloc].colnbr; j++ )
120 for( i = bcsc->cscftab[bloc].coltab[j]; i < bcsc->cscftab[bloc].coltab[j+1]; i++ )
122 sumrow[ bcsc->rowtab[i] ] += cabs(valptr[i]);
127 for( i=0; i<bcsc->gN; i++)
134 memFree_null( sumrow );
162 pastix_complex64_t *valptr = (pastix_complex64_t*)bcsc->Lvalues;
163 double sum, norm = 0.;
166 for( bloc=0; bloc<bcsc->cscfnbr; bloc++ )
168 for( j=0; j<bcsc->cscftab[bloc].colnbr; j++ )
171 for( i = bcsc->cscftab[bloc].coltab[j]; i < bcsc->cscftab[bloc].coltab[j+1]; i++ )
173 sum += cabs(valptr[i]);
207 double *valptr = (
double*)bcsc->Lvalues;
210 for( bloc=0; bloc < bcsc->cscfnbr; bloc++ )
212 for( j=0; j < bcsc->cscftab[bloc].colnbr; j++ )
214 for( i = bcsc->cscftab[bloc].coltab[j]; i < bcsc->cscftab[bloc].coltab[j+1]; i++, valptr++ )
216 frobenius_update( 1, &scale, &sum, valptr);
217 #if defined(PRECISION_z) || defined(PRECISION_c)
219 frobenius_update( 1, &scale, &sum, valptr);
225 norm = scale*sqrt(sum);
253 const pastix_bcsc_t *bcsc )
280 fprintf(stderr,
"bcsc_znorm: invalid norm type\n");
BEGIN_C_DECLS typedef int pastix_int_t
double bcsc_znorm_one(const pastix_bcsc_t *bcsc)
Compute the norm 1 of a bcsc matrix. Norm 1 is equal to the maximum value of the sum of the absolute ...
double bcsc_znorm_max(const pastix_bcsc_t *bcsc)
Compute the max norm of a bcsc matrix.
double bcsc_znorm_frobenius(const pastix_bcsc_t *bcsc)
Compute the frobenius norm of a bcsc matrix.
double bcsc_znorm_inf(const pastix_bcsc_t *bcsc)
Compute the infinity norm of a bcsc matrix. The infinity norm is equal to the maximum value of the su...
double bcsc_znorm(pastix_normtype_t ntype, const pastix_bcsc_t *bcsc)
Compute the norm of an bcsc matrix.
enum pastix_normtype_e pastix_normtype_t
Norms.