Skip to content

Commit 40ad30e

Browse files
committed
commit to add package files
initial commit for package files
1 parent e21da16 commit 40ad30e

File tree

600 files changed

+228371
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

600 files changed

+228371
-0
lines changed

DESCRIPTION

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Package: ceres
2+
Type: Package
3+
Title: What the Package Does in One 'Title Case' Line
4+
Version: 1.0
5+
Date: 2020-07-01
6+
Author: Your Name
7+
Maintainer: Your Name <[email protected]>
8+
Description: One paragraph description of what the package does as one
9+
or more full sentences.
10+
License: GPL (>= 2)
11+
Imports: Rcpp (>= 1.0.4), RcppEigen
12+
LinkingTo: Rcpp, RcppEigen

NAMESPACE

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
useDynLib(ceres, .registration=TRUE)
2+
exportPattern("^[[:alpha:]]+")
3+
importFrom(Rcpp, evalCpp)

R/RcppExports.R

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Generated by using Rcpp::compileAttributes() -> do not edit by hand
2+
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
3+
4+
ceres_helloworld <- function() {
5+
.Call(`_ceres_ceres_helloworld`)
6+
}
7+
8+
rcpp_hello_world <- function() {
9+
.Call(`_ceres_rcpp_hello_world`)
10+
}
11+

ceres.Rproj

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Version: 1.0
2+
3+
RestoreWorkspace: Default
4+
SaveWorkspace: Default
5+
AlwaysSaveHistory: Default
6+
7+
EnableCodeIndexing: Yes
8+
UseSpacesForTab: No
9+
NumSpacesForTab: 4
10+
Encoding: UTF-8
11+
12+
RnwWeave: Sweave
13+
LaTeX: pdfLaTeX
14+
15+
BuildType: Package
16+
PackageUseDevtools: Yes
17+
PackageInstallArgs: --no-multiarch --with-keep.source

configure.ac

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
## -*- mode: autoconf; autoconf-indentation: 4; -*-
2+
##
3+
## ceres configure.ac
4+
##
5+
## ceres -- R interface to ceres-solver
6+
##
7+
## Copyright (C) 2022 Satyaprakash Nayak
8+
##
9+
## This file is licensed under the GPL-2 or later just like most of my
10+
## Open Source code, and is granted an exemption (should it be needed)
11+
## for inclusion into ceres
12+
13+
# require at least autoconf 2.69
14+
AC_PREREQ([2.69])
15+
AC_INIT([ceres],[0.0.1])
16+
17+
## Set R_HOME, respecting an environment variable if set
18+
: ${R_HOME=$(R RHOME)}
19+
if test -z "${R_HOME}"; then
20+
AC_MSG_ERROR([Could not determine R_HOME.])
21+
fi
22+
23+
CXX=`"${R_HOME}/bin/R" CMD config CXX`
24+
if test -z "${CXX}"; then
25+
AC_MSG_ERROR([No C++ compiler available])
26+
fi
27+
CXXFLAGS=`"${R_HOME}/bin/R" CMD config CXXFLAGS`
28+
CPPFLAGS=`"${R_HOME}/bin/R" CMD config CPPFLAGS`
29+
CXX11FLAGS=`"${R_HOME}/bin/R" CMD config CXX11FLAGS`
30+
AC_LANG(C++)
31+
AC_REQUIRE_CPP
32+
AC_PROG_CXX
33+
34+
## Default to build from source
35+
need_to_build="yes"
36+
37+
##### But: Can we use pkg-config?
38+
###AC_PATH_PROG(have_pkg_config, pkg-config, no)
39+
##### If yes, also check for whether pkg-config knows nlopt
40+
###if test x"${have_pkg_config}" != x"no"; then
41+
### AC_MSG_CHECKING([if pkg-config knows NLopt])
42+
### if pkg-config --exists nlopt; then
43+
### AC_MSG_RESULT([yes])
44+
### ## Since nlopt has been found, test for minimal version requirement
45+
### AC_MSG_CHECKING([for pkg-config checking NLopt version])
46+
### if pkg-config --atleast-version=2.7.0 nlopt; then
47+
### AC_MSG_RESULT([>= 2.7.0])
48+
### nlopt_include=$(pkg-config --cflags nlopt)
49+
### nlopt_libs=$(pkg-config --libs nlopt)
50+
### AC_SUBST([NLOPT_INCLUDE], "${nlopt_include}")
51+
### AC_SUBST([NLOPT_LIBS], "${nlopt_libs}")
52+
### need_to_build="no"
53+
### else
54+
### AC_MSG_RESULT([insufficient: NLopt 2.7.0 or later is preferred.])
55+
### fi
56+
### else
57+
### AC_MSG_RESULT([no])
58+
### fi
59+
###fi
60+
61+
## So do we need to build
62+
if test x"${need_to_build}" != x"no"; then
63+
AC_PATH_PROG(have_cmake, cmake, no)
64+
if test x"${have_cmake}" == x"no"; then
65+
. src/scripts/cmake_config.sh
66+
if test -z "${CMAKE_BIN}"; then
67+
## also error to end configure here
68+
AC_MSG_ERROR([Could not find 'cmake'.])
69+
fi
70+
fi
71+
## 'uname -m' on M1 give x86_64 which is ... not helping
72+
machine=`"${R_HOME}/bin/Rscript" -e 'cat(Sys.info()[["machine"]])'`
73+
AC_MSG_RESULT([using ceres via local cmake build on ${machine} ])
74+
tools/cmake_call.sh
75+
## cmake_call.sh installs into ceres/lib, headers are copied
76+
ceres_include=""
77+
ceres_libs="ceres/lib/libceres.a"
78+
fi
79+
80+
## Now use all the values
81+
AC_SUBST([CERES_CPPFLAGS],["$ceres_include"])
82+
AC_SUBST([CERES_LIBS],["$ceres_libs"])
83+
AC_CONFIG_FILES([src/Makevars])
84+
AC_OUTPUT

inst/include/Eigen/Cholesky

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// This file is part of Eigen, a lightweight C++ template library
2+
// for linear algebra.
3+
//
4+
// This Source Code Form is subject to the terms of the Mozilla
5+
// Public License v. 2.0. If a copy of the MPL was not distributed
6+
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
7+
8+
#ifndef EIGEN_CHOLESKY_MODULE_H
9+
#define EIGEN_CHOLESKY_MODULE_H
10+
11+
#include "Core"
12+
#include "Jacobi"
13+
14+
#include "src/Core/util/DisableStupidWarnings.h"
15+
16+
/** \defgroup Cholesky_Module Cholesky module
17+
*
18+
*
19+
*
20+
* This module provides two variants of the Cholesky decomposition for selfadjoint (hermitian) matrices.
21+
* Those decompositions are also accessible via the following methods:
22+
* - MatrixBase::llt()
23+
* - MatrixBase::ldlt()
24+
* - SelfAdjointView::llt()
25+
* - SelfAdjointView::ldlt()
26+
*
27+
* \code
28+
* #include <Eigen/Cholesky>
29+
* \endcode
30+
*/
31+
32+
#include "src/Cholesky/LLT.h"
33+
#include "src/Cholesky/LDLT.h"
34+
#ifdef EIGEN_USE_LAPACKE
35+
#ifdef EIGEN_USE_MKL
36+
#include "mkl_lapacke.h"
37+
#else
38+
#include "src/misc/lapacke.h"
39+
#endif
40+
#include "src/Cholesky/LLT_LAPACKE.h"
41+
#endif
42+
43+
#include "src/Core/util/ReenableStupidWarnings.h"
44+
45+
#endif // EIGEN_CHOLESKY_MODULE_H

inst/include/Eigen/CholmodSupport

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// This file is part of Eigen, a lightweight C++ template library
2+
// for linear algebra.
3+
//
4+
// This Source Code Form is subject to the terms of the Mozilla
5+
// Public License v. 2.0. If a copy of the MPL was not distributed
6+
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
7+
8+
#ifndef EIGEN_CHOLMODSUPPORT_MODULE_H
9+
#define EIGEN_CHOLMODSUPPORT_MODULE_H
10+
11+
#include "SparseCore"
12+
13+
#include "src/Core/util/DisableStupidWarnings.h"
14+
15+
extern "C" {
16+
#include <cholmod.h>
17+
}
18+
19+
/** \ingroup Support_modules
20+
* \defgroup CholmodSupport_Module CholmodSupport module
21+
*
22+
* This module provides an interface to the Cholmod library which is part of the <a href="http://www.suitesparse.com">suitesparse</a> package.
23+
* It provides the two following main factorization classes:
24+
* - class CholmodSupernodalLLT: a supernodal LLT Cholesky factorization.
25+
* - class CholmodDecomposiiton: a general L(D)LT Cholesky factorization with automatic or explicit runtime selection of the underlying factorization method (supernodal or simplicial).
26+
*
27+
* For the sake of completeness, this module also propose the two following classes:
28+
* - class CholmodSimplicialLLT
29+
* - class CholmodSimplicialLDLT
30+
* Note that these classes does not bring any particular advantage compared to the built-in
31+
* SimplicialLLT and SimplicialLDLT factorization classes.
32+
*
33+
* \code
34+
* #include <Eigen/CholmodSupport>
35+
* \endcode
36+
*
37+
* In order to use this module, the cholmod headers must be accessible from the include paths, and your binary must be linked to the cholmod library and its dependencies.
38+
* The dependencies depend on how cholmod has been compiled.
39+
* For a cmake based project, you can use our FindCholmod.cmake module to help you in this task.
40+
*
41+
*/
42+
43+
#include "src/CholmodSupport/CholmodSupport.h"
44+
45+
#include "src/Core/util/ReenableStupidWarnings.h"
46+
47+
#endif // EIGEN_CHOLMODSUPPORT_MODULE_H
48+

0 commit comments

Comments
 (0)