The R Project SVN R

Rev

Rev 88200 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 88200 Rev 89120
Line 1... Line 1...
1
 
1
 
2
R Under development (unstable) (2023-10-11 r85316) -- "Unsuffered Consequences"
2
R Under development (unstable) (2025-12-07 r89119) -- "Unsuffered Consequences"
3
Copyright (C) 2023 The R Foundation for Statistical Computing
3
Copyright (C) 2025 The R Foundation for Statistical Computing
4
Platform: x86_64-pc-linux-gnu
4
Platform: x86_64-pc-linux-gnu
5
 
5
 
6
R is free software and comes with ABSOLUTELY NO WARRANTY.
6
R is free software and comes with ABSOLUTELY NO WARRANTY.
7
You are welcome to redistribute it under certain conditions.
7
You are welcome to redistribute it under certain conditions.
8
Type 'license()' or 'licence()' for distribution details.
8
Type 'license()' or 'licence()' for distribution details.
Line 432... Line 432...
432
> A <- a + 0i
432
> A <- a + 0i
433
> A_b <- solve(A, b) # platform dependent result (e.g. OPENBLAS ..)
433
> A_b <- solve(A, b) # platform dependent result (e.g. OPENBLAS ..)
434
> stopifnot(is.na(A_b))
434
> stopifnot(is.na(A_b))
435
> ## IGNORE_RDIFF_BEGIN
435
> ## IGNORE_RDIFF_BEGIN
436
> A_b
436
> A_b
437
        11 12
437
        11       12
438
a NaN+NaNi NA
438
a NaN+NaNi NaN+NaNi
439
b NaN+NaNi NA
439
b NaN+NaNi NaN+NaNi
440
c NaN+NaNi NA
440
c NaN+NaNi NaN+NaNi
441
> rbind(re = Re(A_b[,2]), im = Im(A_b[,2])) # often was "all NA", now typically "re=NA, im=NaN"
441
> rbind(re = Re(A_b[,2]), im = Im(A_b[,2])) # often was "all NA", now typically "re=NA, im=NaN"
442
     a   b   c
442
     a   b   c
443
re  NA  NA  NA
443
re NaN NaN NaN
444
im NaN NaN NaN
444
im NaN NaN NaN
445
> ## IGNORE_RDIFF_END
445
> ## IGNORE_RDIFF_END
446
> 
446
> 
447
> 
447
> 
448
> ## PR#18541 by Mikael Jagan -- chol()  error & warning message:
448
> ## PR#18541 by Mikael Jagan -- chol()  error & warning message:
449
> x <- diag(-1, 5L)
449
> x <- diag(-1, 5L)
450
> (chF <- tryCmsg(chol(x, pivot = FALSE))) # dpotrf
450
> (chF <- tryCmsg(chol(x, pivot = FALSE))) # dpotrf - warning
451
[1] "the leading minor of order 1 is not positive"
451
[1] "the leading minor of order 1 is not positive"
452
> (chT <- withCallingHandlers(warning = function(w) ..W <<- conditionMessage(w),
452
> chT <- withCallingHandlers(warning = function(w) ..W <<- conditionMessage(w),
453
+                 chol(x, pivot = TRUE ))) # dpstrf
453
+                 chol(x, pivot = TRUE )) # dpstrf  - warning
-
 
454
Warning message:
-
 
455
In chol.default(x, pivot = TRUE) :
-
 
456
  the matrix is either rank-deficient or not positive definite
-
 
457
> ## IGNORE_RDIFF_BEGIN
-
 
458
> chT  # matrix typically == x + pivot and rank (checked below)
454
     [,1] [,2] [,3] [,4] [,5]
459
     [,1] [,2] [,3] [,4] [,5]
455
[1,]   -1    0    0    0    0
460
[1,]   -1    0    0    0    0
456
[2,]    0   -1    0    0    0
461
[2,]    0   -1    0    0    0
457
[3,]    0    0   -1    0    0
462
[3,]    0    0   -1    0    0
458
[4,]    0    0    0   -1    0
463
[4,]    0    0    0   -1    0
459
[5,]    0    0    0    0   -1
464
[5,]    0    0    0    0   -1
460
attr(,"pivot")
465
attr(,"pivot")
461
[1] 1 2 3 4 5
466
[1] 1 2 3 4 5
462
attr(,"rank")
467
attr(,"rank")
463
[1] 0
468
[1] 0
464
Warning message:
469
> ## IGNORE_RDIFF_END
465
In chol.default(x, pivot = TRUE) :
-
 
466
  the matrix is either rank-deficient or not positive definite
-
 
467
> stopifnot(exprs = {
470
> stopifnot(exprs = {
468
+     grepl(" minor .* not positive$", chF) # was "not positive *definite*
471
+     grepl(" minor .* not positive$", chF) # was "not positive *definite*
469
+     grepl("rank-deficient or not positive definite$", ..W) # was "indefinite*
472
+     grepl("rank-deficient or not positive definite$", ..W) # was "indefinite*
470
+     ## platform dependent, Mac has several NaN's  chT == -diag(5)
473
+     ## platform dependent, Mac has several NaN's  chT == -diag(5)
-
 
474
+    identical(
-
 
475
+     attr(chT, "pivot"), 1:5)
471
+     attr(chT, "rank") %in% 0:1
476
+     attr(chT, "rank") %in% 0:1
472
+ })
477
+ })
473
> 
478
>