Mercurial > hg > octave-lyh
comparison liboctave/CMatrix.cc @ 2800:9aeba8e006a4
[project @ 1997-03-09 09:50:20 by jwe]
author | jwe |
---|---|
date | Sun, 09 Mar 1997 09:50:39 +0000 |
parents | d477bceb9e2a |
children | 33486d9e2d00 |
comparison
equal
deleted
inserted
replaced
2799:d77a29e4387f | 2800:9aeba8e006a4 |
---|---|
998 | 998 |
999 for (int j = 0; j < nsamples; j++) | 999 for (int j = 0; j < nsamples; j++) |
1000 F77_FCN (cfftb, CFFTB) (npts, &tmp_data[npts*j], pwsave); | 1000 F77_FCN (cfftb, CFFTB) (npts, &tmp_data[npts*j], pwsave); |
1001 | 1001 |
1002 for (int j = 0; j < npts*nsamples; j++) | 1002 for (int j = 0; j < npts*nsamples; j++) |
1003 tmp_data[j] = tmp_data[j] / (double) npts; | 1003 tmp_data[j] = tmp_data[j] / npts; |
1004 | 1004 |
1005 return retval; | 1005 return retval; |
1006 } | 1006 } |
1007 | 1007 |
1008 ComplexMatrix | 1008 ComplexMatrix |
1098 | 1098 |
1099 for (int j = 0; j < nsamples; j++) | 1099 for (int j = 0; j < nsamples; j++) |
1100 F77_FCN (cfftb, CFFTB) (npts, &tmp_data[npts*j], pwsave); | 1100 F77_FCN (cfftb, CFFTB) (npts, &tmp_data[npts*j], pwsave); |
1101 | 1101 |
1102 for (int j = 0; j < npts*nsamples; j++) | 1102 for (int j = 0; j < npts*nsamples; j++) |
1103 tmp_data[j] = tmp_data[j] / (double) npts; | 1103 tmp_data[j] = tmp_data[j] / npts; |
1104 | 1104 |
1105 npts = nc; | 1105 npts = nc; |
1106 nsamples = nr; | 1106 nsamples = nr; |
1107 nn = 4*npts+15; | 1107 nn = 4*npts+15; |
1108 | 1108 |
1120 prow[i] = tmp_data[i*nr + j]; | 1120 prow[i] = tmp_data[i*nr + j]; |
1121 | 1121 |
1122 F77_FCN (cfftb, CFFTB) (npts, prow, pwsave); | 1122 F77_FCN (cfftb, CFFTB) (npts, prow, pwsave); |
1123 | 1123 |
1124 for (int i = 0; i < npts; i++) | 1124 for (int i = 0; i < npts; i++) |
1125 tmp_data[i*nr + j] = prow[i] / (double) npts; | 1125 tmp_data[i*nr + j] = prow[i] / npts; |
1126 } | 1126 } |
1127 | 1127 |
1128 return retval; | 1128 return retval; |
1129 } | 1129 } |
1130 | 1130 |
1577 ColumnVector work (nc); | 1577 ColumnVector work (nc); |
1578 double inf_norm | 1578 double inf_norm |
1579 = F77_FCN (zlange, ZLANGE) ("I", nc, nc, m.fortran_vec (), nc, | 1579 = F77_FCN (zlange, ZLANGE) ("I", nc, nc, m.fortran_vec (), nc, |
1580 work.fortran_vec ()); | 1580 work.fortran_vec ()); |
1581 | 1581 |
1582 int sqpow = (int) (inf_norm > 0.0 | 1582 int sqpow = (inf_norm > 0.0 |
1583 ? (1.0 + log (inf_norm) / log (2.0)) | 1583 ? static_cast<int> (1.0 + log (inf_norm) / log (2.0)) : 0); |
1584 : 0.0); | |
1585 | 1584 |
1586 // Check whether we need to square at all. | 1585 // Check whether we need to square at all. |
1587 | 1586 |
1588 if (sqpow < 0) | 1587 if (sqpow < 0) |
1589 sqpow = 0; | 1588 sqpow = 0; |