int correctDigit(const char *orifile, const char *recofile)
{
	FILE *fp1 = fopen(orifile, "r");
	FILE *fp2 = fopen(recofile, "r");

	int ret = 0;
	char str1[50], str2[50];
	while (fscanf(fp1, "%s", str1) == 1) {
		fscanf(fp2, "%s", str2);
		ret += correctChar(str1, str2);
	}

	fclose(fp1);
	fclose(fp2);
	return ret;
}
bool RMatrix::operator () (const LongInt& i, RVector& w, const LongInt& j, const RVector& v)
 {
    bool value = true;

    integer incx = 1;
    integer m    = numberOfRows();
    integer n    = numberOfColumns();
    integer lda  = m;

    // dgemv (  correctChar(), &m, &n, (LongReal*) &(Complex::complexUnit), (LongReal*) (&_pelm[0]), 
    //         &lda, (LongReal*) &v(j), &incx, (LongReal*) &(Complex::complexUnit), 
    //         (LongReal*) &w(i), &incx
    //       );
    TensorCalculus::Blas<double>::gemv(*correctChar(), m, n, 1.0, &_pelm[0], 
            lda, &v(j), incx, 1.0, &w(i), incx);

    clearTranspose();
   return value;
 }
RVector RMatrix :: operator * (const RVector& v)
 {
    integer incx = 1;
    integer m    = attr_numberOfRows;
    integer n    = attr_numberOfColumns;
    integer lda  = attr_numberOfRows;
    
	RVector result (attr_numberOfRows);

	// dgemv ( correctChar(), &m, &n, (LongReal*) &(Complex::complexUnit), (LongReal*) (&_pelm[0]), 
        //     &lda, (LongReal*) &v(0), &incx, (LongReal*) &(Complex::complexNull), 
        //     (LongReal*)&result(0), &incx
        //   );
	TensorCalculus::Blas<double>::gemv ( *correctChar(), m, n, 1.0, (&_pelm[0]), 
            lda, &v(0), incx, 0.0, &result(0), incx);

        clearTranspose();
   return result;
 }