[Assorted-commits] SF.net SVN: assorted: [476] rand-dist
Brought to you by:
yangzhang
From: <yan...@us...> - 2008-02-21 19:54:30
|
Revision: 476 http://assorted.svn.sourceforge.net/assorted/?rev=476&view=rev Author: yangzhang Date: 2008-02-21 11:54:29 -0800 (Thu, 21 Feb 2008) Log Message: ----------- added start of rand-dist Added Paths: ----------- rand-dist/ rand-dist/trunk/ rand-dist/trunk/src/ rand-dist/trunk/src/Makefile rand-dist/trunk/src/randdist.cc Added: rand-dist/trunk/src/Makefile =================================================================== --- rand-dist/trunk/src/Makefile (rev 0) +++ rand-dist/trunk/src/Makefile 2008-02-21 19:54:29 UTC (rev 476) @@ -0,0 +1,2 @@ +CFLAGS := -Wall -O3 +all: randdist Added: rand-dist/trunk/src/randdist.cc =================================================================== --- rand-dist/trunk/src/randdist.cc (rev 0) +++ rand-dist/trunk/src/randdist.cc 2008-02-21 19:54:29 UTC (rev 476) @@ -0,0 +1,25 @@ +#include <iostream> +#include <vector> +#include <commons/rand.h> + +using namespace std; +using namespace commons; + +int +main(int argc, char **argv) +{ + if (argc < 3) { + fprintf(stderr, "randdist SIZE COUNT\n"); + return 1; + } + + const int size = atoi(argv[1]); + const int count = atoi(argv[2]); + + vector<int> xs(size); + for (int i = 0; i < count; i++) { + xs[i] = r(); + } + + return 0; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |