Skip to content

Commit

Permalink
fix compilation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
alejandrofontan committed Sep 17, 2024
1 parent 1f60227 commit aaea0a8
Show file tree
Hide file tree
Showing 6 changed files with 129 additions and 225 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ ${SETUP_PY_TEXT}
#
list(APPEND BOOST_COMPONENTS python27)
endif()
else()
list(APPEND BOOST_COMPONENTS python38)
else()
list(APPEND BOOST_COMPONENTS python39)
endif()
find_package(Boost REQUIRED COMPONENTS ${BOOST_COMPONENTS})

Expand All @@ -109,7 +109,15 @@ ${SETUP_PY_TEXT}
ENDIF()
ENDIF()
ENDIF(APPLE)


GET_FILENAME_COMPONENT(REAL_PYTHON_INCLUDE ${PYTHON_INCLUDE_DIRS} REALPATH)
FIND_PATH(NUMPY_INCLUDE_DIR arrayobject.h
${PYTHON_INCLUDE_DIRS}/site-packages/numpy/core/include/numpy
)
IF(NOT ${NUMPY_INCLUDE_DIR} MATCHES NOTFOUND)
INCLUDE_DIRECTORIES(${NUMPY_INCLUDE_DIR})
INCLUDE_DIRECTORIES(${NUMPY_INCLUDE_DIR}/..)
ENDIF()

# message("Target files: ${ARGN}")
# Create the target and assign source files
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#endif

#include <boost/archive/basic_archive.hpp>
#include <boost/detail/endian.hpp>
#include "endian.h"


namespace boost {
Expand Down
103 changes: 103 additions & 0 deletions Schweizer-Messer/sm_boost/include/boost/portable_binary_oarchive.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// portable_binary_oarchive.cpp

// (C) Copyright 2002-7 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

// See http://www.boost.org for updates, documentation, and revision history.

#include <ostream>
#include "endian.h"
#include <boost/portable_binary_oarchive.hpp>

namespace boost {
namespace archive {

void
portable_binary_oarchive::save_impl(
const boost::intmax_t l,
const char /* maxsize */
){
char size = 0;

if(l == 0){
this->primitive_base_t::save(size);
return;
}

boost::intmax_t ll;
bool negative = (l < 0);
if(negative)
ll = -l;
else
ll = l;

do{
ll >>= CHAR_BIT;
++size;
}while(ll != 0);

this->primitive_base_t::save(
static_cast<char>(negative ? -size : size)
);

if(negative)
ll = -l;
else
ll = l;
char * cptr = reinterpret_cast<char *>(& ll);
#ifdef BOOST_BIG_ENDIAN
cptr += (sizeof(boost::intmax_t) - size);
if(m_flags & endian_little)
reverse_bytes(size, cptr);
#else
if(m_flags & endian_big)
reverse_bytes(size, cptr);
#endif
this->primitive_base_t::save_binary(cptr, size);
}

void
portable_binary_oarchive::init(unsigned int flags) {
if(m_flags == (endian_big | endian_little)){
boost::serialization::throw_exception(
portable_binary_oarchive_exception()
);
}
if(0 == (flags & boost::archive::no_header)){
// write signature in an archive version independent manner
const std::string file_signature(
boost::archive::BOOST_ARCHIVE_SIGNATURE()
);
* this << file_signature;
// write library version
const boost::archive::library_version_type v(
boost::archive::BOOST_ARCHIVE_VERSION()
);
* this << v;
}
save(static_cast<unsigned char>(m_flags >> CHAR_BIT));
}

} // namespace archive
} // namespace boost
#include <boost/archive/impl/archive_serializer_map.ipp>
#include <boost/archive/impl/basic_binary_oprimitive.ipp>

namespace boost {
namespace archive {

namespace detail {
template class archive_serializer_map<portable_binary_oarchive>;
}

template class basic_binary_oprimitive<
portable_binary_oarchive,
std::ostream::char_type,
std::ostream::traits_type
> ;

} // namespace archive
} // namespace boost
211 changes: 0 additions & 211 deletions Schweizer-Messer/sm_boost/include/boost/portable_binary_oarchive.hpp

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,21 @@ template <class T> class BiFunction {

boost::python::object getBiFunction(const bsplines::BSpline * bs, double t)
{
typedef Eigen::CwiseNullaryOp <BiVector, Eigen::VectorXd> T;
return boost::python::make_function(boost::bind(&BiFunction<T>::getBi, BiFunction<T>(bs->getBiVector(t)), _1)
, boost::python::default_call_policies(), boost::mpl::vector2<double,int>()
);
typedef Eigen::CwiseNullaryOp <BiVector, Eigen::VectorXd> T;
return boost::python::make_function(boost::bind(&BiFunction<T>::getBi, BiFunction<T>(bs->getBiVector(t)),
boost::placeholders::_1), boost::python::default_call_policies(), boost::mpl::vector2<double, int>());
}
boost::python::object getCumulativeBiFunction(const bsplines::BSpline * bs, double t)

boost::python::object getCumulativeBiFunction(const bsplines::BSpline* bs, double t)
{
typedef Eigen::CwiseNullaryOp <BiVector, Eigen::VectorXd> T;
return boost::python::make_function(boost::bind(&BiFunction<T>::getBi, BiFunction<T>(bs->getCumulativeBiVector(t)), _1)
, boost::python::default_call_policies(), boost::mpl::vector2<double,int>()
);
typedef Eigen::CwiseNullaryOp <BiVector, Eigen::VectorXd> T;

auto wrapped_function = [bs, t](int arg1) -> double {
BiFunction<T> bifunc(bs->getCumulativeBiVector(t));
return bifunc.getBi(arg1); // Call getBi with the int argument
};

return boost::python::make_function(wrapped_function, boost::python::default_call_policies(), boost::mpl::vector2<double, int>());
}

void import_bspline_python()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ namespace {
template<>
struct IntType< long >
{
static const int intType = CHOLMOD_INTLONG;
static const int intType = CHOLMOD_LONG;
};
template<>
struct IntType< int >
Expand Down

0 comments on commit aaea0a8

Please sign in to comment.