Skip to content

Commit

Permalink
playing to see why segfault happens. It is probably memory limitation…
Browse files Browse the repository at this point in the history
…. If I use ulimit, it works...
  • Loading branch information
dkaramit committed Jun 12, 2021
1 parent fd2cd71 commit 7782c69
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 28 deletions.
10 changes: 3 additions & 7 deletions example_sadET.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
template<typename T1, typename T2>
inline auto f(const T1 &x,const T2 &y) {

return sadET::exp(-x*(y-1));//+sadET::log(3*x*+3*x*pow(4,x))*sadET::sin(y*2);
return sadET::exp(-x*(y-1))+sadET::log(3*x*+3*x*pow(4,x))*sadET::sin(y*2);
}


Expand Down Expand Up @@ -38,14 +38,10 @@ int main(){
}
}

/*you can set the input and evaluate it using evaulate() or operator()()*/
// f.setInput(0.25,3.2125);
// cout<< f() <<endl;

/*notice that it takes a lot of time to comiple the following, but is evaluated instantly!*/
/*notice that it takes a lot of time to comiple the following, but is evaluated quicly!*/

auto res=f(x,y).derivative(1).derivative(0).derivative(1).derivative(0).derivative(1).derivative(0).derivative(1);
// auto res=(x).derivative(1).derivative(1).derivative(1).derivative(1).derivative(1).derivative(1);
auto res=f(x,y).derivative(1).derivative(0).derivative(1).derivative(0);
cout<<res<<endl;


Expand Down
2 changes: 1 addition & 1 deletion include/NumericBinaryOperators/Division.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include<NumericBinaryOperators/Addition.hpp>
#include<NumericBinaryOperators/Multiplication.hpp>
#include<NumericBinaryOperators/Subtraction.hpp>
#include<NumericUnaryOperators/NumericUnaryOperators.hpp>
#include<NumericUnaryOperators/Negative.hpp>

namespace sadET{

Expand Down
1 change: 0 additions & 1 deletion include/NumericBinaryOperators/NumericBinaryOperators.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include<cmath>

#include<misc.hpp>
#include<NumericUnaryOperators/NumericUnaryOperators.hpp>

namespace sadET{

Expand Down
2 changes: 1 addition & 1 deletion include/NumericBinaryOperators/Power.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
#include<NumericBinaryOperators/NumericBinaryOperators.hpp>
#include<NumericBinaryOperators/Addition.hpp>
#include<NumericBinaryOperators/Multiplication.hpp>
#include<NumericUnaryOperators/NumericUnaryOperators.hpp>
#include<NumericUnaryOperators/Negative.hpp>
#include<NumericUnaryOperators/Log.hpp>

namespace sadET{

Expand Down
13 changes: 0 additions & 13 deletions include/NumericUnaryOperators/NumericUnaryOperators.hpp

This file was deleted.

1 change: 0 additions & 1 deletion include/sadET.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include<NumericBinaryOperators/Power.hpp>


#include<NumericUnaryOperators/NumericUnaryOperators.hpp>
#include<NumericUnaryOperators/Negative.hpp>
#include<NumericUnaryOperators/Exp.hpp>
#include<NumericUnaryOperators/Log.hpp>
Expand Down
7 changes: 3 additions & 4 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,20 @@ IncludeHPP = $(shell find include/ -type f -name '*.hpp')
LONG=

CC=g++
OPT=-O2
OPT=-O3
STD=-std=c++17

FLG=-I$(IncludeDir) $(OPT) $(STD) -DLONG=$(LONG)

FLG=-I$(IncludeDir) $(OPT) $(STD) -DLONG=$(LONG) -Wall

all: example_sadET.run test_sadET.run

example_sadET.run: makefile $(IncludeHPP) example_sadET.cpp

$(CC) -o example_sadET.run $(FLG) example_sadET.cpp

test_sadET.run: makefile $(IncludeHPP) test_sadET.cpp
$(CC) -o test_sadET.run $(FLG) test_sadET.cpp


clean:
rm example_sadET.run || true
rm test_sadET.run || true

0 comments on commit 7782c69

Please sign in to comment.