Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0a1b7fd

Browse files
authored
Merge pull request#396 from RcppCore/feature/reorg_headers_pt2
Reorganise internal headers -- part 2
2 parentsf239392 +eeebcdb commit0a1b7fd

23 files changed

+1582
-1513
lines changed

‎ChangeLog‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,45 @@
1+
2022-10-20 Dirk Eddelbuettel <edd@debian.org>
2+
3+
* DESCRIPTION (Version): Roll minor version
4+
5+
* inst/include/RcppArmadillo.h: Use new paths
6+
* inst/include/RcppArmadillo.h: Idem
7+
* inst/include/RcppArmadillo/LightL Idem
8+
* inst/include/RcppArmadillo/Lighter: Idem
9+
* inst/include/RcppArmadillo/Lightest: Idem
10+
11+
* inst/include/RcppArmadillo/interface/RcppArmadilloAs.h: New
12+
location, and updated accordingly
13+
* inst/include/RcppArmadillo/interface/RcppArmadilloForward.h: Idem
14+
* inst/include/RcppArmadillo/interface/RcppArmadilloSugar.h: Idem
15+
* inst/include/RcppArmadillo/interface/RcppArmadilloWrap.h: Idem
16+
17+
* inst/include/RcppArmadilloAs.h: New stub
18+
* inst/include/RcppArmadilloForward.h: Idem
19+
* inst/include/RcppArmadilloSugar.h: Idem
20+
* inst/include/RcppArmadilloWrap.h: Idem
21+
22+
2022-10-19 Dirk Eddelbuettel <edd@debian.org>
23+
24+
* DESCRIPTION (Version): Roll minor version
25+
26+
* inst/include/RcppArmadillo/rng/Alt_R_RNG.h: New location
27+
* inst/include/RcppArmadillo/config/RcppArmadilloConfigGenerated.h.in: Idem
28+
* inst/include/RcppArmadillo/config/RcppArmadilloConfig.h: Idem
29+
30+
* inst/include/RcppArmadilloForward.h: Updated accordingly
31+
* inst/include/RcppArmadilloConfig.h: Idem
32+
* configure.ac: Idem
33+
* configure: Idem
34+
* cleanupp: Idem
35+
36+
* inst/tinytest/test_sparseConversion.R: Update one conversion as
37+
suggested by the Matrix team
38+
139
2022-10-14 Dirk Eddelbuettel <edd@debian.org>
240

41+
* DESCRIPTION (Version): Roll minor version
42+
343
* inst/include/RcppArmadillo/RcppArmadillo: Header accessing
444
Rcpp/Rcpp, and not imposing column-as-matrix return
545
* inst/include/RcppArmadillo/Light: Header accessing Rcpp/Light, idem

‎DESCRIPTION‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Package: RcppArmadillo
22
Type: Package
33
Title: 'Rcpp' Integration for the 'Armadillo' Templated Linear Algebra Library
4-
Version: 0.11.4.1.0.3
5-
Date: 2022-10-14
4+
Version: 0.11.4.1.0.5
5+
Date: 2022-10-20
66
Author: Dirk Eddelbuettel, Romain Francois, Doug Bates, Binxiang Ni, and Conrad Sanderson
77
Maintainer: Dirk Eddelbuettel <edd@debian.org>
88
Description: 'Armadillo' is a templated C++ linear algebra library (by Conrad

‎cleanup‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ rm -f config.log config.status confdefs.h \
1717
vignettes/*~ \
1818
*/*~*~ \
1919
inst/include/RcppArmadilloLapack.h \
20-
inst/include/RcppArmadillo/internal/RcppArmadilloConfigGenerated.h \
20+
inst/include/RcppArmadillo/config/RcppArmadilloConfigGenerated.h \
2121
src/Makevars \
2222
vignettes/jss.bst vignettes/pinp.cls
2323

‎configure‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3407,7 +3407,7 @@ ARMA_HAVE_OPENMP="${arma_have_openmp}"
34073407
34083408
OPENMP_FLAG="${openmp_flag}"
34093409
3410-
ac_config_files="$ac_config_files inst/include/RcppArmadillo/internal/RcppArmadilloConfigGenerated.h src/Makevars"
3410+
ac_config_files="$ac_config_files inst/include/RcppArmadillo/config/RcppArmadilloConfigGenerated.h src/Makevars"
34113411
34123412
cat>confcache<<\_ACEOF
34133413
# This file is a shell script that caches the results of configure
@@ -4109,7 +4109,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
41094109
for ac_config_target in$ac_config_targets
41104110
do
41114111
case$ac_config_target in
4112-
"inst/include/RcppArmadillo/internal/RcppArmadilloConfigGenerated.h") CONFIG_FILES="$CONFIG_FILES inst/include/RcppArmadillo/internal/RcppArmadilloConfigGenerated.h" ;;
4112+
"inst/include/RcppArmadillo/config/RcppArmadilloConfigGenerated.h") CONFIG_FILES="$CONFIG_FILES inst/include/RcppArmadillo/config/RcppArmadilloConfigGenerated.h" ;;
41134113
"src/Makevars") CONFIG_FILES="$CONFIG_FILES src/Makevars" ;;
41144114
41154115
*) as_fn_error$?"invalid argument:\`$ac_config_target'" "$LINENO" 5;;

‎configure.ac‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,5 +207,5 @@ fi
207207
AC_SUBST([ARMA_LAPACK],["${arma_lapack}"])
208208
AC_SUBST([ARMA_HAVE_OPENMP],["${arma_have_openmp}"])
209209
AC_SUBST([OPENMP_FLAG],["${openmp_flag}"])
210-
AC_CONFIG_FILES([inst/include/RcppArmadillo/internal/RcppArmadilloConfigGenerated.h src/Makevars])
210+
AC_CONFIG_FILES([inst/include/RcppArmadillo/config/RcppArmadilloConfigGenerated.h src/Makevars])
211211
AC_OUTPUT

‎inst/include/RcppArmadillo.h‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@
2626
#endif
2727

2828
// Set up actual #include <armadillo> after first #include <RcppArmadilloConfig> and more config
29-
#include<RcppArmadilloForward.h>
29+
#include<RcppArmadillo/interface/RcppArmadilloForward.h>
3030

3131
// Now automatically include Rcpp as well
3232
#include<Rcpp.h>
3333

3434
// Remaining RcppArmadillo code
35-
#include<RcppArmadilloWrap.h>
36-
#include<RcppArmadilloAs.h>
37-
#include<RcppArmadilloSugar.h>
35+
#include<RcppArmadillo/interface/RcppArmadilloWrap.h>
36+
#include<RcppArmadillo/interface/RcppArmadilloAs.h>
37+
#include<RcppArmadillo/interface/RcppArmadilloSugar.h>
3838

3939
#endif
Lines changed: 2 additions & 149 deletions
Original file line numberDiff line numberDiff line change
@@ -1,151 +1,4 @@
1-
// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*-
2-
//
3-
// Copyright (C) 2013-2014 Conrad Sanderson
4-
// Copyright (C) 2013-2014 NICTA (www.nicta.com.au)
5-
//
6-
// This Source Code Form is subject to the terms of the Mozilla Public
7-
// License, v. 2.0. If a copy of the MPL was not distributed with this
8-
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
9-
//
10-
// This file is based on Conrad's default generators and as such licensed under both
11-
// the MPL 2.0 for his as well as the GNU GPL 2.0 or later for my modification to it.
121

13-
// Copyright (C) 2014 Dirk Eddelbuettel
14-
//
15-
// This file is part of RcppArmadillo.
16-
//
17-
// RcppArmadillo is free software: you can redistribute it and/or modify it
18-
// under the terms of the GNU General Public License as published by
19-
// the Free Software Foundation, either version 2 of the License, or
20-
// (at your option) any later version.
21-
//
22-
// RcppArmadillo is distributed in the hope that it will be useful, but
23-
// WITHOUT ANY WARRANTY; without even the implied warranty of
24-
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25-
// GNU General Public License for more details.
26-
//
27-
// You should have received a copy of the GNU General Public License
28-
// along with RcppArmadillo. If not, see <http://www.gnu.org/licenses/>.
2+
// This file support the legacy location and includes from the new location
293

30-
31-
// NB This files use R's uniform generator and can be compiled only when the R
32-
// headers are available as is the case for RcppArmadillo.
33-
//
34-
// Also note that you MUST set / reset the R RNG state. When using RcppArmadillo
35-
// via Rcpp Atttributes or the inline package, the RNGScope object is added which
36-
// ensure this automatically. Should you build by hand, and omit both RNGScope as
37-
// as manual calls to GetRNGState() and PutRNGState() you may get unstable results.
38-
//
39-
// See http://cran.r-project.org/doc/manuals/r-devel/R-exts.html#Random-numbers
40-
41-
classarma_rng_alt {
42-
public:
43-
44-
typedefunsignedint seed_type;
45-
46-
inlinestaticvoidset_seed(const seed_type val);
47-
48-
arma_inlinestaticintrandi_val();
49-
arma_inlinestaticdoublerandu_val();
50-
inlinestaticdoublerandn_val();
51-
52-
template<typename eT>
53-
inlinestaticvoidrandn_dual_val(eT& out1, eT& out2);
54-
55-
template<typename eT>
56-
inlinestaticvoidrandi_fill(eT* mem,const uword N,constint a,constint b);
57-
58-
inlinestaticintrandi_max_val();
59-
};
60-
61-
inlinevoidarma_rng_alt::set_seed(const arma_rng_alt::seed_type val) {
62-
// null-op, cannot set seed in R from C level code
63-
// see http://cran.r-project.org/doc/manuals/r-devel/R-exts.html#Random-numbers
64-
//
65-
// std::srand(val);
66-
(void) val;// to suppress a -Wunused warning
67-
//
68-
staticint havewarned =0;
69-
if (havewarned++ ==0) {
70-
::Rf_warning("When called from R, the RNG seed has to be set at the R level via set.seed()");
71-
}
72-
}
73-
74-
arma_inlineintarma_rng_alt::randi_val() {
75-
return ::Rf_runif(0, RAND_MAX);//std::rand();
76-
}
77-
78-
arma_inlinedoublearma_rng_alt::randu_val() {
79-
returndouble(::Rf_runif(0,1));
80-
//return double( double(std::rand()) * ( double(1) / double(RAND_MAX) ) );
81-
}
82-
83-
inlinedoublearma_rng_alt::randn_val() {
84-
// polar form of the Box-Muller transformation:
85-
// http://en.wikipedia.org/wiki/Box-Muller_transformation
86-
// http://en.wikipedia.org/wiki/Marsaglia_polar_method
87-
88-
double tmp1;
89-
double tmp2;
90-
double w;
91-
92-
do {
93-
tmp1 =double(2) *double(::Rf_runif(0,1)) -double(1);
94-
tmp2 =double(2) *double(::Rf_runif(0,1)) -double(1);
95-
//tmp1 = double(2) * double(std::rand()) * (double(1) / double(RAND_MAX)) - double(1);
96-
//tmp2 = double(2) * double(std::rand()) * (double(1) / double(RAND_MAX)) - double(1);
97-
98-
w = tmp1*tmp1 + tmp2*tmp2;
99-
}while ( w >=double(1) );
100-
101-
returndouble( tmp1 *std::sqrt( (double(-2) *std::log(w)) / w) );
102-
}
103-
104-
template<typename eT>
105-
inlinevoidarma_rng_alt::randn_dual_val(eT& out1, eT& out2) {
106-
// make sure we are internally using at least floats
107-
typedeftypename promote_type<eT,float>::result eTp;
108-
109-
eTp tmp1;
110-
eTp tmp2;
111-
eTp w;
112-
113-
do {
114-
tmp1 =eTp(2) *eTp(::Rf_runif(0, RAND_MAX)) * (eTp(1) /eTp(RAND_MAX)) -eTp(1);
115-
tmp2 =eTp(2) *eTp(::Rf_runif(0, RAND_MAX)) * (eTp(1) /eTp(RAND_MAX)) -eTp(1);
116-
//tmp1 = eTp(2) * eTp(std::rand()) * (eTp(1) / eTp(RAND_MAX)) - eTp(1);
117-
//tmp2 = eTp(2) * eTp(std::rand()) * (eTp(1) / eTp(RAND_MAX)) - eTp(1);
118-
119-
w = tmp1*tmp1 + tmp2*tmp2;
120-
}while ( w >=eTp(1) );
121-
122-
const eTp k =std::sqrt( (eTp(-2) *std::log(w)) / w);
123-
124-
out1 =eT(tmp1*k);
125-
out2 =eT(tmp2*k);
126-
}
127-
128-
129-
130-
template<typename eT>
131-
inlinevoidarma_rng_alt::randi_fill(eT* mem,const uword N,constint a,constint b) {
132-
if( (a ==0) && (b == RAND_MAX) ) {
133-
for(uword i=0; i<N; ++i) {
134-
mem[i] = ::Rf_runif(0, RAND_MAX);
135-
//mem[i] = std::rand();
136-
}
137-
}else {
138-
const uword length = b - a +1;
139-
140-
constdouble scale =double(length) /double(RAND_MAX);
141-
142-
for(uword i=0; i<N; ++i) {
143-
mem[i] = (std::min)( b, (int(double(::Rf_runif(0,RAND_MAX)) * scale ) + a) );
144-
//mem[i] = (std::min)( b, (int( double(std::rand()) * scale ) + a) );
145-
}
146-
}
147-
}
148-
149-
inlineintarma_rng_alt::randi_max_val() {
150-
return RAND_MAX;
151-
}
4+
#include"RcppArmadillo/rng/Alt_R_RNG.h"

‎inst/include/RcppArmadillo/Light‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@
3131
#defineRCPP_ARMADILLO_RETURN_ANYVEC_AS_VECTOR
3232

3333
// Set up actual #include <armadillo> after first #include <RcppArmadilloConfig> and more config
34-
#include<RcppArmadilloForward.h>
34+
#include<RcppArmadillo/interface/RcppArmadilloForward.h>
3535

3636
// Automatically include Rcpp as well -- but only the 'light' mode sans modules
3737
#include<Rcpp/Light>
3838

3939
// Remaining RcppArmadillo code
40-
#include<RcppArmadilloWrap.h>
41-
#include<RcppArmadilloAs.h>
42-
#include<RcppArmadilloSugar.h>
40+
#include<RcppArmadillo/interface/RcppArmadilloWrap.h>
41+
#include<RcppArmadillo/interface/RcppArmadilloAs.h>
42+
#include<RcppArmadillo/interface/RcppArmadilloSugar.h>
4343

4444
#endif

‎inst/include/RcppArmadillo/Lighter‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@
3131
#defineRCPP_ARMADILLO_RETURN_ANYVEC_AS_VECTOR
3232

3333
// Set up actual #include <armadillo> after first #include <RcppArmadilloConfig> and more config
34-
#include<RcppArmadilloForward.h>
34+
#include<RcppArmadillo/interface/RcppArmadilloForward.h>
3535

3636
// Automatically include Rcpp as well -- but only the 'lighter' mode sans modules and rtti
3737
#include<Rcpp/Lighter>
3838

3939
// Remaining RcppArmadillo code
40-
#include<RcppArmadilloWrap.h>
41-
#include<RcppArmadilloAs.h>
42-
#include<RcppArmadilloSugar.h>
40+
#include<RcppArmadillo/interface/RcppArmadilloWrap.h>
41+
#include<RcppArmadillo/interface/RcppArmadilloAs.h>
42+
#include<RcppArmadillo/interface/RcppArmadilloSugar.h>
4343

4444
#endif

‎inst/include/RcppArmadillo/Lightest‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@
3131
#defineRCPP_ARMADILLO_RETURN_ANYVEC_AS_VECTOR
3232

3333
// Set up actual #include <armadillo> after first #include <RcppArmadilloConfig> and more config
34-
#include<RcppArmadilloForward.h>
34+
#include<RcppArmadillo/interface/RcppArmadilloForward.h>
3535

3636
// Automatically include Rcpp as well -- but only the 'lightest' mode sans modules, rtti, sugar
3737
#include<Rcpp/Lightest>
3838

3939
// Remaining RcppArmadillo code
40-
#include<RcppArmadilloWrap.h>
41-
#include<RcppArmadilloAs.h>
42-
#include<RcppArmadilloSugar.h>
40+
#include<RcppArmadillo/interface/RcppArmadilloWrap.h>
41+
#include<RcppArmadillo/interface/RcppArmadilloAs.h>
42+
#include<RcppArmadillo/interface/RcppArmadilloSugar.h>
4343

4444
#endif

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp