Skip to content

Commit 68b88c1

Browse files
committed
Merge branch 'master' into heterogeneous-Lambdify
2 parents a1987d8 + 78800c4 commit 68b88c1

16 files changed

+293
-105
lines changed

.travis.yml

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ addons:
1111
sources:
1212
- ubuntu-toolchain-r-test
1313
packages:
14-
- libgmp-dev
15-
- libmpfr-dev
16-
- libmpc-dev
1714
- binutils-dev
1815
- g++-4.7
1916

@@ -55,34 +52,20 @@ matrix:
5552
apt:
5653
sources:
5754
- ubuntu-toolchain-r-test
58-
- boost-latest
59-
- george-edison55-precise-backports
6055
packages:
61-
- libgmp-dev
62-
- libmpfr-dev
6356
- binutils-dev
64-
- libboost-serialization1.55-dev
65-
- libboost-iostreams1.55-dev
6657
- g++-4.8
67-
- cmake
68-
- cmake-data
6958
- env: BUILD_TYPE="Debug" WITH_BFD="yes" PYTHON_VERSION="3.5" WITH_LLVM="yes"
7059
compiler: clang
7160
os: linux
7261
addons:
7362
apt:
7463
sources:
7564
- ubuntu-toolchain-r-test
76-
- llvm-toolchain-precise-3.8
77-
- george-edison55-precise-backports
7865
packages:
7966
- clang
8067
- libstdc++-4.8-dev
81-
- libgmp-dev
8268
- binutils-dev
83-
- llvm-3.8-dev
84-
- cmake
85-
- cmake-data
8669
- env: BUILD_TYPE="Release" PYTHON_VERSION="2.7"
8770
compiler: clang
8871
os: linux
@@ -109,22 +92,25 @@ matrix:
10992
install:
11093
- export PYTHON_SOURCE_DIR=`pwd`
11194
- export TEST_CPP="no"
95+
- export MAKEFLAGS="-j2"
11296

11397
- git clone https://github.com/symengine/symengine symengine-cpp
11498
- cd symengine-cpp
11599
- export SOURCE_DIR=`pwd`
116100
- git checkout `cat ../symengine_version.txt`
117-
118-
# Setup travis for C++ library
119-
- if [[ "${WITH_SAGE}" != "yes" ]]; then source bin/install_travis.sh; fi
101+
- cd ..
120102

121103
# Setup travis for Python wrappers
122-
- cd $PYTHON_SOURCE_DIR
123104
- source bin/install_travis.sh
124105

106+
# Setup travis for C++ library
107+
- cd $SOURCE_DIR
108+
- if [[ "${WITH_SAGE}" != "yes" ]]; then source bin/install_travis.sh; fi
109+
125110
# Build C++ library
126-
- cd symengine-cpp
111+
- cd $SOURCE_DIR
127112
- bin/test_travis.sh
113+
- unset MAKEFLAGS
128114

129115
script:
130116
# Build Python wrappers and test

bin/install_travis.sh

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,11 @@
11
#!/usr/bin/env bash
22

33
if [[ "${WITH_SAGE}" != "yes" ]]; then
4-
if [[ "${TRAVIS_OS_NAME}" != "osx" ]]; then
5-
wget https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh;
6-
else
7-
wget https://repo.continuum.io/miniconda/Miniconda-latest-MacOSX-x86_64.sh -O miniconda.sh;
8-
fi
9-
bash miniconda.sh -b -p $our_install_dir/miniconda;
10-
export PATH="$our_install_dir/miniconda/bin:$PATH";
11-
hash -r;
12-
conda config --set always_yes yes --set changeps1 no;
13-
conda update -q conda;
14-
conda info -a;
15-
CONDA_PKGS="pip cython sympy nose pytest"
4+
# symengine's bin/install_travis.sh will install miniconda
5+
conda_pkgs="python=${PYTHON_VERSION} pip cython sympy nose pytest"
166
if [[ "${WITH_NUMPY}" == "yes" ]]; then
17-
CONDA_PKGS="${CONDA_PKGS} numpy";
7+
conda_pkgs="${conda_pkgs} numpy";
188
fi
19-
conda create -q -n test-environment python="${PYTHON_VERSION}" ${CONDA_PKGS};
20-
source activate test-environment;
219
else
2210
wget -O- https://dl.dropboxusercontent.com/u/46807346/sage-6.9-x86_64-Linux-Ubuntu_12.04_64_bit.tar.gz | tar xz
2311
SAGE_ROOT=`pwd`/sage-6.9-x86_64-Linux

symengine/lib/pywrapper.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ bool PyNumber::is_negative() const {
6363
bool PyNumber::is_positive() const {
6464
return PyObject_RichCompareBool(pyobject_, pymodule_->get_zero(), Py_GT) == 1;
6565
}
66+
//! \return true if complex
67+
bool PyNumber::is_complex() const {
68+
return false;
69+
}
6670

6771
//! Addition
6872
RCP<const Number> PyNumber::add(const Number &other) const {

symengine/lib/symengine.pxd

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ cdef extern from "<symengine/basic.h>" namespace "SymEngine":
256256
bool is_a_ComplexMPC "SymEngine::is_a<SymEngine::ComplexMPC>"(const Basic &b) nogil
257257
bool is_a_Log "SymEngine::is_a<SymEngine::Log>"(const Basic &b) nogil
258258
bool is_a_PyNumber "SymEngine::is_a<SymEngine::PyNumber>"(const Basic &b) nogil
259+
bool is_a_ATan2 "SymEngine::is_a<SymEngine::ATan2>"(const Basic &b) nogil
259260

260261
RCP[const Basic] expand(RCP[const Basic] &o) nogil except +
261262

@@ -273,6 +274,10 @@ cdef extern from "<symengine/symbol.h>" namespace "SymEngine":
273274

274275
cdef extern from "<symengine/number.h>" namespace "SymEngine":
275276
cdef cppclass Number(Basic):
277+
bool is_positive() nogil
278+
bool is_negative() nogil
279+
bool is_zero() nogil
280+
bool is_complex() nogil
276281
pass
277282
cdef cppclass NumberWrapper(Basic):
278283
pass
@@ -413,6 +418,7 @@ cdef extern from "<symengine/functions.h>" namespace "SymEngine":
413418
cdef RCP[const Basic] function_symbol(string name, const vec_basic &arg) nogil except+
414419
cdef RCP[const Basic] abs(RCP[const Basic] &arg) nogil except+
415420
cdef RCP[const Basic] gamma(RCP[const Basic] &arg) nogil except+
421+
cdef RCP[const Basic] atan2(RCP[const Basic] &num, RCP[const Basic] &den) nogil except+
416422

417423
cdef cppclass Function(Basic):
418424
pass
@@ -508,6 +514,9 @@ cdef extern from "<symengine/functions.h>" namespace "SymEngine":
508514
cdef cppclass Gamma(Function):
509515
pass
510516

517+
cdef cppclass ATan2(Function):
518+
pass
519+
511520
IF HAVE_SYMENGINE_MPFR:
512521
cdef extern from "mpfr.h":
513522
ctypedef struct __mpfr_struct:

symengine/lib/symengine/pywrapper.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ class PyNumber : public NumberWrapper {
8080
virtual bool is_negative() const;
8181
//! \return true if positive
8282
virtual bool is_positive() const;
83+
//! \return true if complex
84+
virtual bool is_complex() const;
8385
//! return true if the number is an exact representation
8486
// false if the number is an approximation
8587
virtual bool is_exact() const { return true; };

symengine/lib/symengine_wrapper.pxd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,9 @@ cdef class Abs(Function):
121121
cdef class Gamma(Function):
122122
pass
123123

124+
cdef class ATan2(Function):
125+
pass
126+
124127
cdef class Derivative(Basic):
125128
pass
126129

0 commit comments

Comments
 (0)