@@ -188,7 +188,7 @@ extern "C" {
188
188
// Math Functions //
189
189
// //////////////////
190
190
191
- namespace nm {
191
+ namespace nm {
192
192
namespace math {
193
193
194
194
/*
@@ -335,18 +335,18 @@ namespace nm {
335
335
for (int row = k + 1 ; row < M; ++row) {
336
336
typename MagnitudeDType<DType>::type big;
337
337
big = magnitude ( matrix[M*row + k] ); // element below the temp pivot
338
-
338
+
339
339
if ( big > akk ) {
340
340
interchange = row;
341
- akk = big;
341
+ akk = big;
342
342
}
343
- }
343
+ }
344
344
345
345
if (interchange != k) { // check if rows need flipping
346
346
DType temp;
347
347
348
348
for (int col = 0 ; col < M; ++col) {
349
- NM_SWAP (matrix[interchange*M + col], matrix[k*M + col], temp);
349
+ NM_SWAP (matrix[interchange*M + col], matrix[k*M + col], temp);
350
350
}
351
351
}
352
352
@@ -360,7 +360,7 @@ namespace nm {
360
360
DType pivot = matrix[k * (M + 1 )];
361
361
matrix[k * (M + 1 )] = (DType)(1 ); // set diagonal as 1 for in-place inversion
362
362
363
- for (int col = 0 ; col < M; ++col) {
363
+ for (int col = 0 ; col < M; ++col) {
364
364
// divide each element in the kth row with the pivot
365
365
matrix[k*M + col] = matrix[k*M + col] / pivot;
366
366
}
@@ -369,7 +369,7 @@ namespace nm {
369
369
if (kk == k) continue ;
370
370
371
371
DType dum = matrix[k + M*kk];
372
- matrix[k + M*kk] = (DType)(0 ); // prepare for inplace inversion
372
+ matrix[k + M*kk] = (DType)(0 ); // prepare for inplace inversion
373
373
for (int col = 0 ; col < M; ++col) {
374
374
matrix[M*kk + col] = matrix[M*kk + col] - matrix[M*k + col] * dum;
375
375
}
@@ -384,7 +384,7 @@ namespace nm {
384
384
385
385
for (int row = 0 ; row < M; ++row) {
386
386
NM_SWAP (matrix[row * M + row_index[k]], matrix[row * M + col_index[k]],
387
- temp);
387
+ temp);
388
388
}
389
389
}
390
390
}
@@ -410,14 +410,14 @@ namespace nm {
410
410
DType sum_of_squares, *p_row, *psubdiag, *p_a, scale, innerproduct;
411
411
int i, k, col;
412
412
413
- // For each column use a Householder transformation to zero all entries
413
+ // For each column use a Householder transformation to zero all entries
414
414
// below the subdiagonal.
415
- for (psubdiag = a + nrows, col = 0 ; col < nrows - 2 ; psubdiag += nrows + 1 ,
415
+ for (psubdiag = a + nrows, col = 0 ; col < nrows - 2 ; psubdiag += nrows + 1 ,
416
416
col++) {
417
417
// Calculate the signed square root of the sum of squares of the
418
418
// elements below the diagonal.
419
419
420
- for (p_a = psubdiag, sum_of_squares = 0.0 , i = col + 1 ; i < nrows;
420
+ for (p_a = psubdiag, sum_of_squares = 0.0 , i = col + 1 ; i < nrows;
421
421
p_a += nrows, i++) {
422
422
sum_of_squares += *p_a * *p_a;
423
423
}
@@ -447,7 +447,7 @@ namespace nm {
447
447
*p_a -= u[k] * innerproduct;
448
448
}
449
449
}
450
-
450
+
451
451
// Postmultiply QA by Q
452
452
for (p_row = a, i = 0 ; i < nrows; p_row += nrows, i++) {
453
453
for (innerproduct = 0.0 , k = col + 1 ; k < nrows; k++) {
@@ -485,7 +485,7 @@ namespace nm {
485
485
B[0 ] = A[lda+1 ] / det;
486
486
B[1 ] = -A[1 ] / det;
487
487
B[ldb] = -A[lda] / det;
488
- B[ldb+1 ] = - A[0 ] / det;
488
+ B[ldb+1 ] = A[0 ] / det;
489
489
490
490
} else if (M == 3 ) {
491
491
// Calculate the exact determinant.
@@ -1313,7 +1313,7 @@ void nm_math_hessenberg(VALUE a) {
1313
1313
NULL , NULL , // does not support Complex
1314
1314
NULL // no support for Ruby Object
1315
1315
};
1316
-
1316
+
1317
1317
ttable[NM_DTYPE (a)](NM_SHAPE0 (a), NM_STORAGE_DENSE (a)->elements );
1318
1318
}
1319
1319
/*
0 commit comments