without cache, I CTRL-C after a minute... with cache, it finished up to 4, 19 in 0m0.013s
source code
/************ ACKERMAN **************/
#define enable_global_cache
#ifdef enable_global_cache
int **global_ack_cache;
$ ulimit -s | |
99999 | |
$ time ./a.out | |
result of ackerman(0, 0) => 1. | |
result of ackerman(0, 1) => 2. | |
result of ackerman(0, 2) => 3. | |
result of ackerman(0, 3) => 4. | |
result of ackerman(0, 4) => 5. |
without cache, I CTRL-C after a minute... with cache, it finished up to 4, 19 in 0m0.013s
source code
/************ ACKERMAN **************/
#define enable_global_cache
#ifdef enable_global_cache
int **global_ack_cache;
mathieu@Miyauchi-QC-PC:/mnt/btr/homes/mathieu/projects/somekool/playgrounds/c$ make && time ./a.out | |
computing ack(0, 0); | |
result of ackerman(0, 0) => 1. | |
computing ack(0, 1); | |
result of ackerman(0, 1) => 2. | |
computing ack(0, 2); | |
result of ackerman(0, 2) => 3. | |
computing ack(0, 3); | |
result of ackerman(0, 3) => 4. |
require 'formula' | |
class KdeBaseapps < Formula | |
url 'ftp://ftp.kde.org/pub/kde/stable/4.7.4/src/kde-baseapps-4.7.4.tar.bz2' | |
homepage 'http://kde.org/' | |
md5 'd44310cad99a9afb757ff13f24eeae32' | |
depends_on 'cmake' => :build | |
depends_on 'automoc4' => :build |
==> Downloading ftp://ftp.kde.org/pub/kde/stable/4.7.4/src/kde-baseapps-4.7.4.tar.bz2 | |
File already downloaded in /Users/mjobin/Library/Caches/Homebrew | |
/usr/bin/tar xf /Users/mjobin/Library/Caches/Homebrew/kde-baseapps-4.7.4.tar.bz2 | |
==> cmake .. -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/kdelibs/4.7.4 -DBUILD_doc=FALSE -DBUNDLE_INSTALL_DIR=/usr/local/Cellar/kde-baseapps/4.7.4/bin | |
cmake .. -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/kdelibs/4.7.4 -DBUILD_doc=FALSE -DBUNDLE_INSTALL_DIR=/usr/local/Cellar/kde-baseapps/4.7.4/bin | |
-- The C compiler identification is GNU | |
-- The CXX compiler identification is GNU | |
-- Checking whether C compiler has -isysroot | |
-- Checking whether C compiler has -isysroot - yes | |
-- Checking whether C compiler supports OSX deployment target flag |
==> cmake . -DCMAKE_INSTALL_PREFIX='/usr/local/Cellar/soprano/2.7.3' -DCMAKE_BUILD_TYPE=None -Wno-dev -DSOPRANO_DISABLE_RAPTOR_PARSER=ON -DSOPRANO_DISABLE_RAPTOR_SERIALIZER=ON -DSOPRANO_DISABLE_REDLAND_BACK | |
==> make install | |
[ 0%] [ 1%] [ 1%] [ 2%] [ 3%] [ 3%] [ 4%] Generating asyncquery.moc | |
[ 5%] Generating model.moc | |
Generating pluginmanager.moc | |
Generating filtermodel.moc | |
Generating storagemodel.moc | |
Generating inferencemodel.moc | |
Generating nrlmodel.moc | |
Generating mutexmodel.moc |