Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Sylvain Jasson
gmp
Commits
a9faf567
Commit
a9faf567
authored
Feb 23, 2022
by
Antoine Lucas
Browse files
version 0.6-4
parent
b9840fc4
Changes
4
Hide whitespace changes
Inline
Side-by-side
DESCRIPTION
View file @
a9faf567
Package: gmp
Version: 0.6-
3
Date: 202
1
-0
8-12
Version: 0.6-
4
Date: 202
2
-0
2-23
Title: Multiple Precision Arithmetic
Author: Antoine Lucas, Immanuel Scholz, Rainer Boehme <rb-gmp@reflex-studio.de>,
Sylvain Jasson <Sylvain.Jasson@inrae.fr>,
...
...
TODO
View file @
a9faf567
* Remove full path in `configure.ac` script, with example of Rmpfr configure. -*-org-*-
* Bug Fixes
** TODO Logical ops should work: 0=FALSE NA=NA, <any_else>=TRUE
*** !as.bigz(0:3) crashes R badly (!!), but should return !(0:3) (logical vector).
terminate called after throwing an instance of 'std::length_error'
what(): vector::_M_default_append \\ ...R: line 141: 25400 Aborted (core dumped)
*** as.bigz(0:3) | as.bigz(0) etc should return logical as with regular numbers in R
** DONE Logical ops should work: 0=FALSE NA=NA, <any_else>=TRUE
*** DONE !as.bigz(0:3) crashes R badly (!!), but should return !(0:3) (logical vector).
*** DONE as.bigz(0:3) | as.bigz(0) etc should return logical as with regular numbers in R
** TODO `format()` currently works via as.character(.), particularly unsatisfying for bigz.
**
TO
DO Not working column assignment : A[,j] <- vec does nothing, not warn, nothing -- but A[i,] <- val works ??
**
TO
DO m <- matrix(1:6, 2); Z <- as.bigz(m); str(Z) fails because e.g. Z[5] fails, contrary m[5]
** DO
NE
Not working column assignment : A[,j] <- vec does nothing, not warn, nothing -- but A[i,] <- val works ??
** DO
NE
m <- matrix(1:6, 2); Z <- as.bigz(m); str(Z) fails because e.g. Z[5] fails, contrary m[5]
** TODO asNumeric(x) : the generic must get a "..." argument, so can use "rounding mode" in Rmpfr
** DONE URGENT / BAD : Segfaults, Wrong Results, etc
**
TO
DO completely *wrong* pmin() and pmax(<bigq>, <number>): uses Numerator in comparison ???
** DO
NE
completely *wrong* pmin() and pmax(<bigq>, <number>): uses Numerator in comparison ???
*** TODO: Find the *underlying* reason where pmin() goes wrong w/o warning!
** TODO Missing bigq %% and %/% [was 'Not working Arithmetic']
*** TODO bigq %% and %/% are not even defined (but are for 'numeric')!
...
...
@@ -75,8 +73,8 @@ This is completely analogous to
One possibility: Using +- <LARGE>/1 for "bigq", as +- <LARGE> for "bigz"
** Matrix things
***
TO
DO want *different* M[1,] and M[1] for big[zq] matrices
***
TO
DO 3*M and M*3 are not the same: the first forgets the "nrow"
*** DO
NE
want *different* M[1,] and M[1] for big[zq] matrices
*** DO
NE
3*M and M*3 are not the same: the first forgets the "nrow"
*** DONE x <- as.bigz(2:5); x[1] <- -1; x # -- a matrix !! >> no longer
*** DONE qq <- as.bigz(2:5)/7; qq[1] <- -1; qq # -- a matrix !!
*** abs(.) or sign(<big..matrix>) {and probably many others!}
...
...
tests/gmp-test.R
View file @
a9faf567
...
...
@@ -87,10 +87,11 @@ sapply(unaryfunctionid, numericFunName)
ex
<-
expression
(
23
,
as.bigz
(
23
),
as.bigq
(
23
),
c
(
3
,
23
),
as.bigz
(
c
(
3
,
23
)),
as.bigq
(
c
(
3
,
23
)),
"25"
,
2.3
,
-4
,
4L
,
0
,
as.bigz
(
34
),
as.bigq
(
32
,
7
),
as.bigz
(
31
,
45
),
NULL
,
NA
,
-3L
)
## TODO: as.bigz(3)^700
x
<-
lapply
(
ex
,
eval
)
## Those "numbers" in x for which arithmetic should also work in double precision:
## not modulo-arithmetic, not larger than double.prec
useN
<-
sapply
(
x
,
function
(
.
)
is.null
(
.
)
||
is.na
(
.
)
||
(
is.finite
(
as.numeric
(
.
))
&&
(
!
inherits
(
.
,
"bigz"
)
||
is.null
(
modulus
(
.
)))))
useN
<-
sapply
(
x
,
function
(
u
)
is.null
(
u
[
1
]
)
||
is.na
(
u
[
1
]
)
||
(
is.finite
(
as.numeric
(
u
[
1
]
))
&&
(
!
inherits
(
u
[
1
]
,
"bigz"
)
||
is.null
(
modulus
(
u
[
1
]
)))))
## names(x) <- sapply(ex, format)
## shorter & easier:
names
(
x
)
<-
sapply
(
x
,
formatN
)
...
...
tests/gmp-test.Rout.save
View file @
a9faf567
...
...
@@ -119,10 +119,11 @@ The following objects are masked from 'package:base':
> ex <- expression(23,as.bigz(23),as.bigq(23),c(3,23),as.bigz(c(3,23)),as.bigq(c(3,23)), "25", 2.3, -4, 4L, 0, as.bigz(34),
+ as.bigq(32,7), as.bigz(31,45), NULL,NA, -3L)## TODO: as.bigz(3)^700
> x <- lapply(ex, eval)
>
> ## Those "numbers" in x for which arithmetic should also work in double precision:
> ## not modulo-arithmetic, not larger than double.prec
> useN <- sapply(x, function(
.
) is.null(
.
) || is.na(
.
) ||
+ (is.finite(as.numeric(
.
)) && (!inherits(
.
, "bigz") || is.null(modulus(
.
)))))
> useN <- sapply(x, function(
u
) is.null(
u[1]
) || is.na(
u[1]
) ||
+ (is.finite(as.numeric(
u[1]
)) && (!inherits(
u[1]
, "bigz") || is.null(modulus(
u[1]
)))))
> ## names(x) <- sapply(ex, format)
> ## shorter & easier:
> names(x) <- sapply(x, formatN)
...
...
@@ -1348,4 +1349,4 @@ Big Integer ('bigz') object of length 2:
>
> proc.time()
user system elapsed
0.75
8
0.069 0.8
26
0.75
6
0.069 0.8
19
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment