Skip to content

Commit

Permalink
Squashed 'moose-core/' changes from a15a538..c2c32b9
Browse files Browse the repository at this point in the history
c2c32b9 Before tagging runing with clang.
1cc19f1 updated runtime to annotation field in moose
3ad9558 runTime and solver type is read from xml file to moose, cleaning in names
5de1f05 function output to pool object set's "setN" as input is "nOut"
ae24a3d Merge branch 'master' of https://github.com/BhallaLab/moose-core
7b43f70 Fixed Function unzombification for increment messages. Added update for time in Zombie Functions.
f4310e6 for now function output connected to pool via setConc message, but there is "increment" which depend on the function input this will be fixed later
f286dca removed writekkit.py duplicate file
6d299eb replace all the obj under /kinetics or /kinetics/group which is required by genesis format
a6dad52 Merge branch 'master' of https://github.com/BhallaLab/moose-core
0ddbd21 Gsolve updates to monitor number of reac events. Stoich updates to avoid crashes when handling edge cases without objects in model.
2ab410d function can be connected to pool,bufpool and reaction
086ef95 using networkX spring_layout rather than grapviz dot layout
0000d51 Ids begining with numbers needed to processed with dash for sbml compartability,No substrate, no product enzymes are not written down, function are now placed under compartment and for backwarcs compartability with genesis they are placed under BufPool
f0f1444 Merge branch 'master' of github.com:BhallaLab/moose-core
e0c6c1a Allow failure with clang. I could not reproduce the error on my local machine.
9e4db61 First skeleton changes to the Gsolver to track the number of reaction firings for each reaction. Also some fixes to the SeqSynHandler.
cff32e4 Fixes to include path of muparsers. This is passing on openSUSE.
2117969 Added missing SeqSynHandler source file to CMake.
58ddb2b Added SeqSynHandler class to deal with single-neuron sequence recognition models
1e42ece Merge branch 'master' of https://github.com/BhallaLab/moose-core
659a908 Fixes for Ksolve accuracy, and some ReadKkit edge cases
7c3e72e small correction
0d7f908 clean up for Annotation, plots, reactions, enz
a2f6a95 Merge branch 'master' of http://github.com/BhallaLab/moose-core
fb70792 empty reaction are not written,units corrections, plot paths are written from compartment level unlike before from model level
a1593e9 Disabled pip install python-sbml with clang.
13acd0f Disabled SBML test for time being till issue #145 and #152 are resolved.
f3b42fd Merge branch 'master' of https://github.com/BhallaLab/moose-core
b16311e Fixed unicode conversion for docstrings Put in sorting of fields in showfields.
793ae62 Added pygraphviz to pip3 install list. pygraphviz is a dependency for SBML.
396e607 Both python2-networkx and python3-networkx can't be installed simultaneously. Fixes that on travis.
ac02cea Added python-networkx to python3 dependency. Test run on travis.
dd4fc4e Removed option WITH_SBML deprecated warning [skip ci]
c6c60e6 Removed c++ sbml support code. Test run on travis.
c73e4cd Removed C++ sbml code.
68ea7c2 Changed SBML script to make them compatible with python3.
8614680 Fixed Leakage class
8b15511 Merge branch 'master' of https://github.com/BhallaLab/moose-core
24a01e8 Added ICa for NMDA channel to known plot variables for rdesigneur
52ae361 Fix to issue #147.
c251c0d reaction rateLaw and enz's km is corrected
a03cb6a initial concentration is set if hasOnlySubstanceUnit=false with correct units
7018230 Fixes for SynChan modulation, added a couple of synaptic channel prototypes
66bfcff Upi fixed the scaling factor
b6532e8 Merge branch 'master' of http://github.com/BhallaLab/moose-core
b7a3ad4 MMEnz is created
37c5312 Deprecating sbml related code on travis. Don't download SBML debian package and install.
791762a plots populated to moose if defined in the sBML file
b05a983 Adding python-networkx as dependency in travis.     python-networkx seems to be required to run SBML related code (needs confirmation?)     python-networkx is a dependency for moose-gui.
76c5381 print statement needed paranthese
d52bd19 fixed a work around for small bug in the draw_grapviz function in networkx-1.11 which no longer import toplevel namespace, readSBML:cleanup
2fd15b6 updated to read SBML file into moose
422bbc0 One of the testcase where model loaded in moose are written to SBML file
dbc5412 Removing sbml build from cmake. SBML test is failing.
8876581 Merge branch 'master' of https://github.com/BhallaLab/moose-core
66f55c2 A check made to see if python-libsbml modules is installed if yes then reading and writing to SBML is done, else a warning message to install module is done
073ef60 Merge pull request #144 from dilawar/master
94b686a Fix to BhallaLab/moose-core#143.
b460557 Removing c++ depenedency of libsbml and its files
fea73c3 Merge pull request #141 from subhacom/master
7644e69 Fixed adding spike generators in ReadCell dotp.
3928fae Merge remote-tracking branch 'upstream/master'
5822181 Merge branch 'master' of https://github.com/subhacom/moose-core
79d5a5c Updated generated neuroml2 module and test file.
5a4197c Merge branch 'master' of https://github.com/BhallaLab/moose-core
06aea5b SBML is removed from the make file
2a5bc46 Merge branch 'master' of https://github.com/BhallaLab/moose-core
1a55310 Fixes for enzyme rate scaling when reading kkit files
8f44029 Merge pull request #140 from dilawar/master
f9e8720 Merge branch 'master' of github.com:BhallaLab/moose-core
1aee89a When WITH_SBML=OFF is given from command line, do not compile its support.
c959613 Merge branch 'master' of https://github.com/BhallaLab/moose-core
00a9171 Fixed access functions for kinetic objects and solvers
d70da97 some more colors to ignore which are light
4d89fd6 color if not defined in genesis then random color from pyqt Qcolor matplotlib files are taken as saved, matplotlib
5ecd2b1 all the co-ordinate are calculated and pass from kkit to this file and only we run in commandline then auto-coordinates are calculated with appropriate zoom factor
27bfae9 using graphviz_layout instead of pygraphviz_layout to get the position for auto-coordinates for layout the moodels
1f93ddb Removing pygraphviz lib dependency and using pygraphviz_layout to get the position of spring_layout
2c421a0 readSBML gets x and y co-ordinates from the file and loads it
eba7d75 cleanup in layout co-ordinates to save the model from moose to genesis
17863ee Layout co-ordinates from GUI is saved into SBML file, 2.Automatic Layout done using pyqgraphviz when model saved from command line to SBML file. InitialConc are saved with mole as default units
395daa7 Fix for muParser for C++ 10
ef2196e Adding quot operator in muparser.
6deb249 Merge branch 'master' of github.com:BhallaLab/moose-core
a6f8bab Updates to rdesigneur
b922890 Fix dependency on hdf5
6f7e46d cleanup
b943072 added networkx's Graph for layout the co-ordinates when model is save to SBML at commandline, if model saved at GUI level then pyqt's scenepos which is used for layout in GUI, those co-ordinates are used
8b1a05d Co-ordinates,group,textcolor and background color are written to SBML file in Annotation field
2718470 auto co-ordinates if one saves model from commandline and also cleanup with co-ordinates for genesis
41b6bfb color index is cleanedup according to genesis requirement and co-ordinates calculation is removed, since I am sending ScenePos
ce6b740 cleanup in writing genesis file with scene co-ordinates and few other clean up
8f2a3e1 Added compiler macros for AppleClang.
076ecf6 libsbml-5.9.0 is not available on brew. Build breaks with sbml 5.11.0
2976483 Fix apple build. adding -stdlib=libc++ to cmake.
530d69b Merge branch 'master' of https://github.com/BhallaLab/moose-core
d8cd4bd Updated python setup script to include streaming classes
5d6ee59 Actual fix for issue #110
5df0a7f Merge branch 'master' of https://github.com/BhallaLab/moose-core
39145e3 Merge branch 'master' of https://github.com/BhallaLab/moose-core
2634422 Merge branch 'master' of https://github.com/subhacom/moose-core
ddbdd8c Removed mgui and moogli from Python setup.py
c2fa2cf Added hsolve test comparing to NEURON

git-subtree-dir: moose-core
git-subtree-split: c2c32b97caecd422d6bc9398094073ce9f1b7492
  • Loading branch information
Dilawar Singh committed Nov 7, 2016
1 parent 2af833a commit 9658097
Show file tree
Hide file tree
Showing 69 changed files with 6,932 additions and 9,614 deletions.
33 changes: 18 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,40 +20,43 @@ env:
- CTEST_MODEL=Nightly
cache: apt

matrix:
allow_failures:
#matrix:
# allow_failures:
# - clang

before_script:
- sudo apt-get install -qq libxml2-dev libbz2-dev
- sudo apt-get install -qq libhdf5-serial-dev
- sudo apt-get install -qq make cmake
- sudo apt-get install -qq python-numpy python-matplotlib
- sudo apt-get install -qq python3-numpy python3-matplotlib python3-dev
- sudo apt-get install -qq python-numpy python-matplotlib python-networkx
- sudo apt-get install -qq python3-numpy python3-matplotlib python3-dev
- sudo apt-get install -qq libboost-all-dev
- sudo apt-get install -qq libgsl0-dev

before_install:
- sbmlurl="http://sourceforge.net/projects/sbml/files/libsbml/5.9.0/stable/Linux/64-bit/libSBML-5.9.0-Linux-x64.deb"
- wget "$sbmlurl" -O libsbml.deb && sudo dpkg -i libsbml.deb
- sudo apt-get install -f
- sudo apt-get install -qq python-pip python3-pip
- sudo apt-get install -qq libgraphviz-dev
- # sudo pip install python-libsbml
- # sudo pip3 install python-libsbml
- # sudo pip3 install pygraphviz

install:
- echo "nothing to do here"

script:
- sudo ldconfig /usr/lib64
- # First test is normal make scripts. (outdated).
- make
- # Now test the cmake with gsl
- ## CMAKE based flow
- mkdir -p _GSL_BUILD && cd _GSL_BUILD && cmake -DDEBUG=ON -DPYTHON_EXECUTABLE=/usr/bin/python ..
- make && ctest --output-on-failure
- cd .. # Build with python3.
- mkdir -p _GSL_BUILD2 && cd _GSL_BUILD2 && cmake -DDEBUG=ON -DPYTHON_EXECUTABLE=/usr/bin/python3 ..
- make && ctest --output-on-failure
- cd .. # Now with boost.
- mkdir -p _BOOST_BUILD && cd _BOOST_BUILD && cmake -DWITH_BOOST=ON -DDEBUG=ON -DPYTHON_EXECUTABLE=/usr/bin/python ..
- make && ctest --output-on-failure
- cd .. # Now with boost and python3.
- cd ..
- echo "Python3 support. Removed python2-networkx and install python3"
- sudo apt-get remove -qq python-networkx
- sudo apt-get install -qq python3-networkx
- mkdir -p _GSL_BUILD2 && cd _GSL_BUILD2 && cmake -DDEBUG=ON -DPYTHON_EXECUTABLE=/usr/bin/python3 ..
- make && ctest --output-on-failure
- cd .. # Now with BOOST and python3
- mkdir -p _BOOST_BUILD2 && cd _BOOST_BUILD2 && cmake -DWITH_BOOST=ON -DDEBUG=ON -DPYTHON_EXECUTABLE=/usr/bin/python3 ..
- make && ctest --output-on-failure
- cd ..
Expand Down
67 changes: 0 additions & 67 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,19 +83,11 @@ option(WITH_MPI "Enable Openmpi support" OFF)
option(WITH_BOOST "Use boost library instead of GSL" OFF)
option(WITH_GSL "Use gsl-library. Alternative is WITH_BOOST" ON)

# If SBML is available, it will automaticall enable the support. If ON, then
# libSBML must be present.
option(WITH_SBML "Enable SBML support. Automatically detected." OFF)

# If GSL_STATIC_HOME is set, we use it to search for static gsl libs.
option(GSL_STATIC_HOME
"Path prefix where static gsl library can be found e.g. /opt/sw/gsl116 "
OFF
)
option(SBML_STATIC_HOME
"Path prefix where static sbml library can be found e.g. /opt/sbml/"
OFF
)
option(HDF5_STATIC_HOME
"Path prefix where static hdf5 library can be found e.g /opt/sw/hdf5 "
OFF
Expand Down Expand Up @@ -165,57 +157,6 @@ if(WITH_BOOST)
set(WITH_GSL OFF)
endif(WITH_BOOST)

# If this variable is used while packaging; we build this project using another
# cmake script and pass the location of SBML static library using this variable.
# Otherwise, this is useless. FIXME: This is not a clean solution.
if(SBML_STATIC_HOME)
include_directories(${SBML_STATIC_HOME}/include)
find_library(LIBSBML_LIBRARIES
NAMES libsbml-static.a libsbml.a
PATHS "${SBML_STATIC_HOME}/lib" "${SBML_STATIC_HOME}/lib64"
NO_DEFAULT_PATH
)
message(STATUS "- Using static version of LIBSBML_LIBRARIES: ${LIBSBML_LIBRARIES}")
if(LIBSBML_LIBRARIES)
message(STATUS "- Successfully located SBML static library: ${LIBSBML_LIBRARIES}")
ELSE()
message(FATAL_ERROR
"Can't find static libsbml libraries at path ${SBML_STATIC_HOME}"
)
endif()
set(LIBSBML_FOUND ON)
else(SBML_STATIC_HOME)
pkg_check_modules(LIBSBML libsbml)
if(NOT LIBSBML_FOUND)
message(STATUS "pkg-config could not find sbml. Fallback to default")
find_package(LIBSBML)
endif()
endif(SBML_STATIC_HOME)

if(LIBSBML_FOUND)
message(STATUS "LIBSBML found ${LIBSBML_LIBRARIES}")
include_directories(${LIBSBML_INCLUDE_DIRS})
pkg_check_modules(LibXML2 libxml-2.0)
if (!LibXML2_FOUND)
find_package(LibXML2 REQUIRED)
endif()
include_directories(${LibXML2_INCLUDE_DIRS})
else()
message(
"======================================================================\n"
"libsbml NOT found. \n\n"
"If you want to compile with SBML support, download and install \n"
"libsbml-5.9.0 from: \n"
"http://sourceforge.net/projects/sbml/files/libsbml/5.9.0/stable/ and\n"
"rerun cmake.\n\n"
"If you don't want SBML support then continue with `make`.\n\n"
"If you install libsbml to non-standard place, let the cmake know by\n"
"exporting environment variable SBML_DIR to the location.\n"
"=====================================================================\n"
)
SET(WITH_SBML OFF)
endif()

include_directories(msg basecode)

set_target_properties(libmoose PROPERTIES COMPILE_DEFINITIONS "MOOSE_LIB")
Expand Down Expand Up @@ -366,7 +307,6 @@ add_subdirectory(biophysics)
add_subdirectory(builtins)
add_subdirectory(utility)
add_subdirectory(mesh)
add_subdirectory(sbml)
add_subdirectory(mpi)
add_subdirectory(signeur)
add_subdirectory(ksolve)
Expand Down Expand Up @@ -400,13 +340,6 @@ elseif(HDF5_FOUND)
list(APPEND SYSTEM_SHARED_LIBS ${HDF5_LIBRARIES})
endif()

LIST(APPEND STATIC_LIBRARIES moose_sbml)
if(SBML_STATIC_HOME)
list(APPEND STATIC_LIBRARIES ${LIBSBML_LIBRARIES})
elseif(LIBSBML_FOUND)
list(APPEND SYSTEM_SHARED_LIBS ${LIBSBML_LIBRARIES})
endif()

if(WITH_GSL)
if(GSL_STATIC_HOME)
message(STATUS "Using STATIC gsl libraries: ${GSL_LIBRARIES}")
Expand Down
7 changes: 6 additions & 1 deletion CheckCXXCompiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ CHECK_CXX_COMPILER_FLAG( "-std=c++0x" COMPILER_SUPPORTS_CXX0X )
CHECK_CXX_COMPILER_FLAG( "-Wno-strict-aliasing" COMPILER_WARNS_STRICT_ALIASING )



# Turn warning to error: Not all of the options may be supported on all
# versions of compilers. be careful here.
add_definitions(-Wall
Expand All @@ -32,11 +31,17 @@ if(COMPILER_SUPPORTS_CXX11)
message(STATUS "Your compiler supports c++11 features. Enabling it")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
add_definitions( -DENABLE_CPP11 )
if(APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++" )
endif(APPLE)
elseif(COMPILER_SUPPORTS_CXX0X)
message(STATUS "Your compiler supports c++0x features. Enabling it")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
add_definitions( -DENABLE_CXX11 )
add_definitions( -DBOOST_NO_CXX11_SCOPED_ENUMS -DBOOST_NO_SCOPED_ENUMS )
if(APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++" )
endif(APPLE)
else()
add_definitions( -DBOOST_NO_CXX11_SCOPED_ENUMS -DBOOST_NO_SCOPED_ENUMS )
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support.")
Expand Down
14 changes: 2 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@

# Default values for flags. The operator ?= assigns the given value only if the
# variable is not already defined.
USE_SBML?=0
#USE_SBML?=0
USE_HDF5?=1
USE_CUDA?=0
USE_NEUROKIT?=0
Expand Down Expand Up @@ -230,16 +230,6 @@ else
LIBS+= -lm
endif

#harsha
# To use SBML, pass USE_SBML=1 in make command line
ifeq ($(USE_SBML),1)
LIBS+= -lsbml
CXXFLAGS+=-DUSE_SBML
LDFLAGS += -L/usr/lib64 -Wl,--rpath='/usr/lib64'
SBML_DIR = sbml
SBML_LIB = sbml/_sbml.o
endif

#Saeed
# To use CUDA, pass USE_CUDA=1 in make command line
ifeq ($(USE_CUDA),1)
Expand Down Expand Up @@ -371,7 +361,7 @@ export CXXFLAGS
export LD
export LIBS
export USE_GSL
export USE_SBML
#export USE_SBML

all: moose pymoose

Expand Down
16 changes: 8 additions & 8 deletions MooseTests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@ set_tests_properties(pymoose-ksolve-test
PROPERTIES ENVIRONMENT "PYTHONPATH=${PROJECT_BINARY_DIR}/python"
)

# Test basic SBML support.
ADD_TEST(NAME pymoose-test-basic-sbml-support
COMMAND ${TEST_COMMAND}
${PROJECT_SOURCE_DIR}/tests/python/test_sbml_support.py
)
set_tests_properties(pymoose-test-basic-sbml-support
PROPERTIES ENVIRONMENT "PYTHONPATH=${PROJECT_BINARY_DIR}/python"
)
## Test basic SBML support.
#ADD_TEST(NAME pymoose-test-basic-sbml-support
#COMMAND ${TEST_COMMAND}
#${PROJECT_SOURCE_DIR}/tests/python/test_sbml_support.py
#)
#set_tests_properties(pymoose-test-basic-sbml-support
#PROPERTIES ENVIRONMENT "PYTHONPATH=${PROJECT_BINARY_DIR}/python"
#)

# Test basic SBML support.
ADD_TEST(NAME pymoose-test-rng
Expand Down
2 changes: 1 addition & 1 deletion basecode/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ default: $(TARGET)

$(OBJ) : $(HEADERS) ../shell/Shell.h
Element.o: FuncOrder.h
testAsync.o: SparseMatrix.h SetGet.h ../scheduling/Clock.h ../biophysics/IntFire.h ../synapse/SynHandlerBase.h ../synapse/SimpleSynHandler.h ../synapse/Synapse.h ../randnum/RNG.h
testAsync.o: SparseMatrix.h SetGet.h ../scheduling/Clock.h ../biophysics/IntFire.h ../synapse/SynEvent.h ../synapse/SynHandlerBase.h ../synapse/SimpleSynHandler.h ../synapse/Synapse.h ../randnum/RNG.h
SparseMsg.o: SparseMatrix.h
SetGet.o: SetGet.h ../shell/Neutral.h
HopFunc.o: HopFunc.h ../mpi/PostMaster.h
Expand Down
2 changes: 2 additions & 0 deletions basecode/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ extern void testShell();
extern void testScheduling();
extern void testSchedulingProcess();
extern void testBuiltins();
extern void testSynapse();
extern void testBuiltinsProcess();

extern void testMpiScheduling();
Expand Down Expand Up @@ -342,6 +343,7 @@ void nonMpiTests( Shell* s )
MOOSE_TEST("testHsolve", testHSolve());
//MOOSE_TEST("testGeom", testGeom());
MOOSE_TEST("testMesh", testMesh());
MOOSE_TEST("testSynapse", testSynapse());
MOOSE_TEST( "testSigneur", testSigNeur());
#ifdef USE_SMOLDYN
//MOOSE_TEST(testSmoldyn());
Expand Down
1 change: 1 addition & 0 deletions basecode/testAsync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <queue>
#include "../biophysics/IntFire.h"
#include "../synapse/Synapse.h"
#include "../synapse/SynEvent.h"
#include "../synapse/SynHandlerBase.h"
#include "../synapse/SimpleSynHandler.h"
#include "SparseMatrix.h"
Expand Down
9 changes: 9 additions & 0 deletions biophysics/Leakage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,23 @@ Leakage::~Leakage()

void Leakage::vProcess( const Eref & e, ProcPtr p )
{
ChanCommon::vSetGk( e, this->vGetGbar( e ) * this->vGetModulation( e ));
updateIk();
sendProcessMsgs(e, p);
}

void Leakage::vReinit( const Eref & e, ProcPtr p )
{
ChanCommon::vSetGk( e, this->vGetGbar( e ) * this->vGetModulation( e ));
updateIk();
sendReinitMsgs(e, p);
}

void Leakage::vSetGbar( const Eref& e, double gbar )
{
ChanCommon::vSetGk( e, gbar * this->vGetModulation( e ) );
ChanCommon::vSetGbar( e, gbar );
}

//
// Leakage.cpp ends here
1 change: 1 addition & 0 deletions biophysics/Leakage.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class Leakage: public ChanCommon
~Leakage();
void vProcess( const Eref & e, ProcPtr p );
void vReinit( const Eref & e, ProcPtr p );
void vSetGbar( const Eref & e, double gbar );

static const Cinfo * initCinfo();
};
Expand Down
2 changes: 1 addition & 1 deletion biophysics/ReadCell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ bool ReadCell::addSpikeGen(
shell_->doAddMsg(
"Single",
compt,
"VmSrc",
"VmOut",
chan,
"Vm"
);
Expand Down
6 changes: 6 additions & 0 deletions biophysics/SynChan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,16 @@ void SynChan::normalizeGbar()
/// Update alpha function terms for synaptic channel.
double SynChan::calcGk()
{
/*
X_ = getModulation() * activation_ * xconst1_ + X_ * xconst2_;
Y_ = X_ * yconst1_ + Y_ * yconst2_;
activation_ = 0.0;
return Y_ * norm_;
*/
X_ = activation_ * xconst1_ + X_ * xconst2_;
Y_ = X_ * yconst1_ + Y_ * yconst2_;
activation_ = 0.0;
return Y_ * norm_ * getModulation();
}

void SynChan::vProcess( const Eref& e, ProcPtr info )
Expand Down
1 change: 1 addition & 0 deletions external/muparser/include/muParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ namespace mu
static value_type Rint(value_type);
static value_type Sign(value_type);
static value_type Fmod(value_type, value_type);
static value_type Quot(value_type, value_type);

// Random between a and b, with fixed seed.
static value_type Rand2(value_type, value_type, value_type);
Expand Down
2 changes: 2 additions & 0 deletions external/muparser/src/muParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ namespace mu
value_type Parser::Exp(value_type v) { return MathImpl<value_type>::Exp(v); }
value_type Parser::Abs(value_type v) { return MathImpl<value_type>::Abs(v); }
value_type Parser::Fmod(value_type v1, value_type v2) { return fmod(v1, v2); }
value_type Parser::Quot(value_type v1, value_type v2) { return (int)(v1 / v2); }

// If no seed is given,
value_type Parser::Rand( value_type seed )
Expand Down Expand Up @@ -336,6 +337,7 @@ namespace mu
DefineFun(_T("avg"), Avg);
DefineFun(_T("min"), Min);
DefineFun(_T("max"), Max);
DefineFun(_T("quot"), Quot);
}
}

Expand Down
6 changes: 4 additions & 2 deletions external/muparser/src/muParserTokenReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,10 @@ namespace mu
#else
ParserTokenReader* ptr = new ParserTokenReader(*this);
ptr->SetParent( a_pParent );
delete ptr;
return NULL;
return ptr;
// Upi Bhalla 13 June 2016: I think the original two lines below are wrong
// delete ptr;
// return NULL;
#endif

}
Expand Down
Loading

0 comments on commit 9658097

Please sign in to comment.