Commit 255bcfde authored by davidkep's avatar davidkep

fix forward definitions

parent e0241597
......@@ -17,6 +17,11 @@
#endif
#include <nsoptim_forward.hpp>
#include <nsoptim/armadillo.hpp>
#include <nsoptim/rcpp_integration.hpp>
#include <nsoptim/objective.hpp>
#include <nsoptim/container.hpp>
#include <nsoptim/optimizer.hpp>
#endif // NSOPTIM_HPP_
......@@ -19,7 +19,7 @@
#ifdef HAVE_RCPP
// For RCPP
# include <RcppArmadilloForward.h>
# include <RcppArmadillo.h>
#else
// For stand-alone
# include <armadillo>
......
//
// armadillo_forward.hpp
// nsoptim
//
// Created by David Kepplinger on 2018-11-30.
// Copyright © 2018 David Kepplinger. All rights reserved.
//
#ifndef NSOPTIM_ARMADILLO_FORWARD_HPP_
#define NSOPTIM_ARMADILLO_FORWARD_HPP_
#define ARMA_USE_CXX11 1
#define ARMA_DONT_USE_OPENMP 1
#ifdef __clang__
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Weverything"
#endif
#ifdef HAVE_RCPP
// For RCPP
# include <RcppArmadilloForward.h>
#else
// For stand-alone
# include <armadillo>
#endif // HAVE_RCPP
#ifdef __clang__
# pragma clang diagnostic pop
#endif
#endif // NSOPTIM_ARMADILLO_FORWARD_HPP_
//
// forward.hpp
// nsoptim
//
// Created by David Kepplinger on 2018-11-30.
// Copyright © 2018 David Kepplinger. All rights reserved.
//
#ifndef NSOPTIM_CONTAINER_FORWARD_HPP_
#define NSOPTIM_CONTAINER_FORWARD_HPP_
#include <nsoptim/config.hpp>
#include <nsoptim/armadillo_forward.hpp>
namespace nsoptim {
//! Full definition at nsoptim/container/regression_coefficients.hpp
template <class T> class RegressionCoefficients;
//! Full definition at nsoptim/container/regression_coefficients.hpp
template <class T> class RegressionCoefficients;
//! Full definition at nsoptim/container/data.hpp
class PredictorResponseData;
namespace _metrics_internal {
//! Full definition at nsoptim/container/metrics.hpp
template<int> class Metrics;
} // namespace _metrics_internal
//! Export the correct Metrics collection based on the configuration.
using Metrics = _metrics_internal::Metrics<NSOPTIM_METRICS_LEVEL>;
} // namespace nsoptim
#endif // NSOPTIM_CONTAINER_FORWARD_HPP_
......@@ -45,7 +45,6 @@ struct MetricsContainer {
MetricList<std::string> str_;
};
//! An iterator that iterates sequentially over two std::forward_list objects.
namespace _metrics_internal {
template<typename T>
class MetricsIterator : public std::iterator<std::forward_iterator_tag, const Metric<T>> {
......@@ -478,9 +477,6 @@ class Metrics<2> {
std::forward_list<Metrics> sub_metrics_;
};
} // namespace _metrics_internal
//! Export the correct Metrics collection based on the configuration.
using Metrics = _metrics_internal::Metrics<NSOPTIM_METRICS_LEVEL>;
} // namespace nsoptim
#endif // NSOPTIM_CONTAINER_METRICS_HPP_
//
// forward.hpp
// nsoptim
//
// Created by David Kepplinger on 2018-11-30.
// Copyright © 2018 David Kepplinger. All rights reserved.
//
#ifndef NSOPTIM_OBJECTIVE_FORWARD_HPP_
#define NSOPTIM_OBJECTIVE_FORWARD_HPP_
#include <nsoptim/config.hpp>
#include <nsoptim/armadillo_forward.hpp>
namespace nsoptim {
//! Full definition at nsoptim/objective/ls_regression_loss.hpp
class WeightedLsRegressionLoss;
class LsRegressionLoss;
//! Full definition at nsoptim/objective/en_penalty.hpp
class EnPenalty;
class LassoPenalty;
class RidgePenalty;
//! Full definition at nsoptim/objective/adaptive_en_penalty.hpp
class AdaptiveEnPenalty;
class AdaptiveLassoPenalty;
} // namespace nsoptim
#endif // NSOPTIM_OBJECTIVE_FORWARD_HPP_
......@@ -9,20 +9,9 @@
#ifndef NSOPTIM_RCPP_INTEGRATION_HPP_
#define NSOPTIM_RCPP_INTEGRATION_HPP_
#include <nsoptim_forward.hpp>
#include <nsoptim/armadillo.hpp>
#ifdef HAVE_RCPP
#ifdef __clang__
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Weverything"
#endif
#include <RcppArmadillo.h>
#ifdef __clang__
# pragma clang diagnostic pop
#endif
namespace Rcpp {
//! Wrap a sparse vector into a Matrix::sparseVector object
template <typename T>
......
......@@ -10,10 +10,9 @@
#define NSOPTIM_FORWARD_HPP_
#include <nsoptim/config.hpp>
#include <nsoptim/armadillo.hpp>
#include <nsoptim/objective.hpp>
#include <nsoptim/container.hpp>
#include <nsoptim/optimizer.hpp>
#include <nsoptim/armadillo_forward.hpp>
#include <nsoptim/container/forward.hpp>
#include <nsoptim/objective/forward.hpp>
#ifdef HAVE_RCPP
namespace Rcpp {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment