OSDN Git Service

basic_vector
authoro_ggy <o_ggy@users.sourceforge.jp>
Thu, 15 Apr 2010 15:58:46 +0000 (00:58 +0900)
committeryasutomo <o_ggy@users.sourceforge.jp>
Thu, 15 Apr 2010 15:58:46 +0000 (00:58 +0900)
21 files changed:
INSTALL [new file with mode: 0644]
Makefile [new file with mode: 0644]
Makefile.app.inc [new file with mode: 0644]
Makefile.lib.inc [new file with mode: 0644]
Makefile.vars [new file with mode: 0644]
Makefile.vars.in [new file with mode: 0644]
configure [new file with mode: 0755]
gitpush.sh [new file with mode: 0755]
src/Makefile [new file with mode: 0644]
src/Makefile.bak [new file with mode: 0644]
src/libmof.a [new file with mode: 0644]
src/mof/base/mofdef.hpp [new file with mode: 0644]
src/mof/base/tstring.hpp [new file with mode: 0644]
src/mof/math/basic_vector.hpp [new file with mode: 0644]
src/mof/util/foreach.hpp [new file with mode: 0644]
test [deleted file]
test/Makefile [new file with mode: 0644]
test/Makefile.bak [new file with mode: 0644]
test/mof/math/vectorx_test.cpp [new file with mode: 0644]
test/mof/math/vectorx_test.o [new file with mode: 0644]
test/vectorx_test [new file with mode: 0755]

diff --git a/INSTALL b/INSTALL
new file mode 100644 (file)
index 0000000..5c90f16
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,4 @@
+./configure --with-boost
+make depend
+make
+make test
diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..bd5e222
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,35 @@
+include Makefile.vars
+
+.PHONY: all clean distclean test
+
+TARGETS = \
+       src test
+
+all:
+       @for i in $(TARGETS); do \
+               if ! $(MAKE) $(MAKEOPTS) -C $${i} all; then exit 1; fi \
+       done
+
+clean:
+       @for i in $(TARGETS); do \
+               if ! $(MAKE) $(MAKEOPTS) -C $${i} clean; then exit 1; fi \
+       done
+
+distclean:
+       @for i in $(TARGETS); do \
+               if ! $(MAKE) $(MAKEOPTS) -C $${i} distclean; then exit 1; fi \
+       done
+
+depend:
+       @for i in $(TARGETS); do \
+               if ! $(MAKE) $(MAKEOPTS) -C $${i} depend; then exit 1; fi \
+       done
+
+test:
+       @if ! $(MAKE) $(MAKEOPTS) -C test test; then exit1; fi
+
+Makefile.vars: Makefile.vars.in
+       ./configure
+
+# vim: syntax=make ts=4 sts=0 sw=4
+
diff --git a/Makefile.app.inc b/Makefile.app.inc
new file mode 100644 (file)
index 0000000..4b1ae24
--- /dev/null
@@ -0,0 +1,36 @@
+# ¥È¥Ã¥×¥Ç¥£¥ì¥¯¥È¥ê¤Î¶¦ÄÌ Makefile¡¥
+# ³Æ¥×¥í¥°¥é¥à¤Î Makefile ¤Î¤¦¤Á¡¤¶¦Ä̤˽ñ¤«¤ì¤ëÉôʬ¤ò¤³¤Î¥Õ¥¡¥¤¥ë¤Ë¤Ò¤È¤Þ¤È
+# ¤á¤Ë¤·¤Æ¤¤¤ë¡¥
+#
+# Ä̾ï¤Ï½ñ¤­´¹¤¨¤ëɬÍפϤʤ¤¡¥
+#
+
+include ../Makefile.vars
+
+.SUFFIXES:     .d
+
+# ¥½¡¼¥¹¥Õ¥¡¥¤¥ë̾¤«¤é¥ª¥Ö¥¸¥§¥¯¥È¥Õ¥¡¥¤¥ë¤Î̾Á°¤òÆÀ¤ë
+# (GNU make ¤ÎÁȤ߹þ¤ß´Ø¿ô patsubst ¤ò»ÈÍѤ·¤Æ¡¤³ÈÄ¥»Ò¤ò .o ¤Ë¼è¤ê´¹¤¨¤Æ¤¤¤ë
+# ¤À¤±)
+OBJS = $(patsubst %.cpp,%.o,$(patsubst %.c,%.o,$(SOURCES)))
+
+all:   $(TARGET)
+
+$(TARGET):     $(OBJS) ../src/libmof.a
+       $(CXX) -o $(TARGET) $(OBJS)  $(LIBS) 
+
+clean:
+       rm -f $(OBJS) $(test_OBJS)
+
+distclean:     clean
+       rm -f $(TARGET) $(test_TARGET)
+
+.cpp.o:
+       $(CXX) -c -o $@ $(CXXFLAGS) $<
+
+.c.o:
+       $(CC) -c -o $@ $(CFLAGS) $<
+
+
+# vim: syntax=make
+
diff --git a/Makefile.lib.inc b/Makefile.lib.inc
new file mode 100644 (file)
index 0000000..78c0c20
--- /dev/null
@@ -0,0 +1,37 @@
+# ¥È¥Ã¥×¥Ç¥£¥ì¥¯¥È¥ê¤Î¶¦ÄÌ Makefile¡¥
+# ³Æ¥×¥í¥°¥é¥à¤Î Makefile ¤Î¤¦¤Á¡¤¶¦Ä̤˽ñ¤«¤ì¤ëÉôʬ¤ò¤³¤Î¥Õ¥¡¥¤¥ë¤Ë¤Ò¤È¤Þ¤È
+# ¤á¤Ë¤·¤Æ¤¤¤ë¡¥
+#
+# Ä̾ï¤Ï½ñ¤­´¹¤¨¤ëɬÍפϤʤ¤¡¥
+#
+
+include ../Makefile.vars
+
+.SUFFIXES:     .d
+.PHONY: all clean distclean install uninstall test
+
+# ¥½¡¼¥¹¥Õ¥¡¥¤¥ë̾¤«¤é¥ª¥Ö¥¸¥§¥¯¥È¥Õ¥¡¥¤¥ë¤Î̾Á°¤òÆÀ¤ë
+# (GNU make ¤ÎÁȤ߹þ¤ß´Ø¿ô patsubst ¤ò»ÈÍѤ·¤Æ¡¤³ÈÄ¥»Ò¤ò .o ¤Ë¼è¤ê´¹¤¨¤Æ¤¤¤ë
+# ¤À¤±)
+OBJS = $(patsubst %.cpp,%.o,$(patsubst %.c,%.o,$(SOURCES)))
+
+all: $(TARGET)
+
+%.o: %.cpp
+       $(CXX) -c -o $@ $(CXXFLAGS) $<
+
+%.o: %.c
+       $(CC) -c -o $@ $(CFLAGS) $<
+
+$(TARGET): $(OBJS)
+       ar rv $(TARGET) $(OBJS)
+       ranlib $(TARGET)
+
+clean:
+       rm -f $(OBJS) 
+
+distclean:     clean
+       rm -f $(TARGET) 
+
+# vim: syntax=make
+
diff --git a/Makefile.vars b/Makefile.vars
new file mode 100644 (file)
index 0000000..84da9cd
--- /dev/null
@@ -0,0 +1,18 @@
+# configure \e$B<B9T;~$K!$%"%C%H%^!<%/$G0O$^$l$?ItJ,$,K\Ev$NCM$KCV49$5$l$k!%\e(B
+
+PREFIX = /home/yasutomo
+INSTALL_BINDIR = $(PREFIX)/bin
+INSTALL_LIBDIR = $(PREFIX)/lib
+INSTALL_INCDIR = $(PREFIX)/include
+
+INSTALL = install
+
+CC = gcc
+CFLAGS = -g -O0 -DDEBUG -UNDEBUG -pipe -ansi -pedantic -Wall -W
+CXX = g++
+CXXFLAGS = -g -O0 -DDEBUG -UNDEBUG -pipe -std=c++98 -pedantic -Wall -W
+LD = g++
+LDFLAGS = 
+boost_CXXFLAGS = -I/home/yasutomo/boost_1_41_0/
+boost_LIBS = -L/home/yasutomo/boost_1_41_0//stage/lib
+
diff --git a/Makefile.vars.in b/Makefile.vars.in
new file mode 100644 (file)
index 0000000..a52838e
--- /dev/null
@@ -0,0 +1,18 @@
+# configure \e$B<B9T;~$K!$%"%C%H%^!<%/$G0O$^$l$?ItJ,$,K\Ev$NCM$KCV49$5$l$k!%\e(B
+
+PREFIX = @PREFIX@
+INSTALL_BINDIR = $(PREFIX)/bin
+INSTALL_LIBDIR = $(PREFIX)/lib
+INSTALL_INCDIR = $(PREFIX)/include
+
+INSTALL = @INSTALL@
+
+CC = @CC@
+CFLAGS = @CFLAGS@
+CXX = @CXX@
+CXXFLAGS = @CXXFLAGS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+boost_CXXFLAGS = @boost_CXXFLAGS@
+boost_LIBS = @boost_LIBS@
+
diff --git a/configure b/configure
new file mode 100755 (executable)
index 0000000..a12560e
--- /dev/null
+++ b/configure
@@ -0,0 +1,109 @@
+#! /bin/sh
+
+# オプションの既定値
+PREFIX=${PREFIX:-$HOME}
+CXX=${CXX:-g++}
+CC=${CC:-gcc}
+LD=${LD:-g++}
+CFLAGS=${CFLAGS:--pipe -ansi -pedantic -Wall -W}
+CXXFLAGS=${CXXFLAGS:--pipe -std=c++98 -pedantic -Wall -W}
+INSTALL=${INSTALL:-install}
+enable_debug=yes
+enable_exception=no
+
+# 使用法の説明
+usage()
+{
+cat <<EOF
+
+Usage: $0 [options]
+
+Options:
+  -h, -help               このヘルプを表示
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+                          [$HOME]
+  --with-x[=path]         X11 ライブラリのインストール先を path に指定
+  --with-boost[=path]     boost ライブラリのインストール先を path に指定
+  --enable-debug          デバッグモードを有効にする (デフォルト)
+  --disable-debug         デバッグモードを無効にする
+
+EOF
+       exit 0
+}
+
+# コマンドラインオプションの解析
+for arg in "$@"; do
+       case $arg in
+       -prefix=* | --prefix=*)
+               PREFIX=`expr "$arg" : '[^=]*=\(.*\)'`
+               ;;
+
+    -with-boost | -with-boost=* | --with-boost | --with-boost=*)
+               boost_PREFIX=`expr "$arg" : '[^=]*=\(.*\)'`
+               ;;
+    
+       -enable-debug | --enable-debug)
+               enable_debug=yes
+               ;;
+
+       -disable-debug | --disable-debug)
+               enable_debug=no
+               ;;
+
+       -enable-debug=* | --enable-debug=*)
+               enable_debug=`expr "$arg" : '[^=]*=\(.*\)'`
+               ;;
+
+       -h | -help | --help)
+               usage
+               ;;
+
+       *)
+               echo "Unknown option $arg"
+               exit 1
+               ;;
+       esac
+done
+
+# boost_PREFIX が空文字列のときは,/usr を代入する.
+if [ -z "$boost_PREFIX" ]; then
+       boost_PREFIX="/usr"
+fi
+boost_LIBS="-L${boost_PREFIX}/stage/lib"
+boost_CXXFLAGS="-I${boost_PREFIX}"
+
+# デバッグ時は最適化を無効にして,デバッグ時のマクロを定義する
+# 非デバッグ時は最適化を有効にして,非デバッグ時のマクロを定義する
+if [ "$enable_debug" = "yes" ]; then
+       CXXFLAGS="-g -O0 -DDEBUG -UNDEBUG $CXXFLAGS"
+       CFLAGS="-g -O0 -DDEBUG -UNDEBUG $CFLAGS"
+else
+       CXXFLAGS="-O2 -UDEBUG -DNDEBUG $CXXFLAGS"
+       CFLAGS="-O2 -UDEBUG -DNDEBUG $CFLAGS"
+fi
+
+# Makefile.vars.in から Makefile.vars を生成
+INPUT="Makefile.vars.in"
+OUTPUT="Makefile.vars"
+echo "$INPUT から $OUTPUT を生成します."
+
+sed \
+       -e 's:@PREFIX@:'"$PREFIX"':g' \
+       -e 's:@INSTALL@:'"$INSTALL"':g' \
+       -e 's:@CC@:'"$CC"':g' \
+       -e 's:@CFLAGS@:'"$CFLAGS"':g' \
+       -e 's:@CXX@:'"$CXX"':g' \
+       -e 's:@CXXFLAGS@:'"$CXXFLAGS"':g' \
+       -e 's:@LD@:'"$LD"':g' \
+       -e 's:@LDFLAGS@:'"$LDFLAGS"':g' \
+       -e 's:@boost_CXXFLAGS@:'"$boost_CXXFLAGS"':g' \
+       -e 's:@boost_LIBS@:'"$boost_LIBS"':g' $INPUT > $OUTPUT
+
+echo
+echo "コンパイル設定:"
+echo "  boostライブラリの場所: $boost_PREFIX"
+echo "  デバッグ: $enable_debug"
+echo
+echo "設定が完了しました.make を実行してください."
+echo
+
diff --git a/gitpush.sh b/gitpush.sh
new file mode 100755 (executable)
index 0000000..101e2b5
--- /dev/null
@@ -0,0 +1 @@
+git push o_ggy@git.sourceforge.jp:/gitroot/moflib/moflib.git master
diff --git a/src/Makefile b/src/Makefile
new file mode 100644 (file)
index 0000000..e88c7cd
--- /dev/null
@@ -0,0 +1,44 @@
+# ¥é¥¤¥Ö¥é¥êÍѤΠMakefile¡¥
+# TARGET, SOURCES, HEADER_CXXFLAGS, CXXFLAGS, LIBS ¤Î¤ß¤ò½ñ¤­´¹¤¨¤ë¤À¤±¤Ç¤è¤¤
+#
+# all, clean, distclean, install, uninstall ¤Ê¤É¤Ï¤É¤Î Makefile ¤Ç¤â¶¦Ä̤ÊÆâ
+# ÍƤ¬½ñ¤«¤ì¤ë¤Î¤Ç¡¤../Makefile.lib.inc ¤È¤¤¤¦¥Õ¥¡¥¤¥ë¤Ë¤Ò¤È¤Þ¤È¤á¤Ë¤·¤Æ¤¤¤ë¡¥
+#
+
+# ¥³¥ó¥Ñ¥¤¥ë¡¦·ë¹ç¤·¤Æºî¤é¤ì¤ëºÇ½ªÅª¤Ê¥é¥¤¥Ö¥é¥ê¥Õ¥¡¥¤¥ë¤Î̾Á°
+TARGET = libmof.a
+
+
+SOURCES = \
+
+
+
+HEADERS = \
+       mof/base/mofdef.hpp \
+       mof/base/tstring.hpp \
+       mof/util/foreach.hpp \
+       mof/math/basic_vector.hpp 
+
+
+# ¶¦Ä̤ÎMake ¥·¥¹¥Æ¥à¤ò»È¤¦¤Î¤Ç¡¤¤³¤Î¾ì½ê¤Ç¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ë¡¥
+include ../Makefile.lib.inc
+
+
+
+# ¥³¥ó¥Ñ¥¤¥é¤ËÅϤ¹¥Õ¥é¥°¤Î¤¦¤Á¡¤¥¤¥ó¥¯¥ë¡¼¥É¥Ñ¥¹Éôʬ(-I ¥ª¥×¥·¥ç¥ó)¤À¤±¤ò½ñ
+# ¤¤¤¿¤â¤Î
+HEADER_CXXFLAGS = $(boost_CXXFLAGS) -I. 
+
+# ¥³¥ó¥Ñ¥¤¥é¤ËÅϤ¹Â¾¤Î¥Õ¥é¥°
+# (+= ¤Çʸ»úÎó¤òÄɲ乤ë¤è¤¦¤Ë½ñ¤¯¤Î¤ò˺¤ì¤º¤Ë)
+CXXFLAGS += $(HEADER_CXXFLAGS)
+
+# ¥ê¥ó¥¯»þ¤ËɬÍפʥ饤¥Ö¥é¥ê¤È¥é¥¤¥Ö¥é¥ê¤Î¥Ñ¥¹¤ò¤³¤³¤Ë½ñ¤¯
+# (+= ¤Çʸ»úÎó¤òÄɲ乤ë¤è¤¦¤Ë½ñ¤¯¤Î¤ò˺¤ì¤º¤Ë)
+LIBS += \
+       $(boost_LIBS)  -lboost_thread -lboost_test_exec_monitor
+       
+
+depend:
+       makedepend -- $(include) -- $(SOURCES)
+# DO NOT DELETE
diff --git a/src/Makefile.bak b/src/Makefile.bak
new file mode 100644 (file)
index 0000000..e88c7cd
--- /dev/null
@@ -0,0 +1,44 @@
+# ¥é¥¤¥Ö¥é¥êÍѤΠMakefile¡¥
+# TARGET, SOURCES, HEADER_CXXFLAGS, CXXFLAGS, LIBS ¤Î¤ß¤ò½ñ¤­´¹¤¨¤ë¤À¤±¤Ç¤è¤¤
+#
+# all, clean, distclean, install, uninstall ¤Ê¤É¤Ï¤É¤Î Makefile ¤Ç¤â¶¦Ä̤ÊÆâ
+# ÍƤ¬½ñ¤«¤ì¤ë¤Î¤Ç¡¤../Makefile.lib.inc ¤È¤¤¤¦¥Õ¥¡¥¤¥ë¤Ë¤Ò¤È¤Þ¤È¤á¤Ë¤·¤Æ¤¤¤ë¡¥
+#
+
+# ¥³¥ó¥Ñ¥¤¥ë¡¦·ë¹ç¤·¤Æºî¤é¤ì¤ëºÇ½ªÅª¤Ê¥é¥¤¥Ö¥é¥ê¥Õ¥¡¥¤¥ë¤Î̾Á°
+TARGET = libmof.a
+
+
+SOURCES = \
+
+
+
+HEADERS = \
+       mof/base/mofdef.hpp \
+       mof/base/tstring.hpp \
+       mof/util/foreach.hpp \
+       mof/math/basic_vector.hpp 
+
+
+# ¶¦Ä̤ÎMake ¥·¥¹¥Æ¥à¤ò»È¤¦¤Î¤Ç¡¤¤³¤Î¾ì½ê¤Ç¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ë¡¥
+include ../Makefile.lib.inc
+
+
+
+# ¥³¥ó¥Ñ¥¤¥é¤ËÅϤ¹¥Õ¥é¥°¤Î¤¦¤Á¡¤¥¤¥ó¥¯¥ë¡¼¥É¥Ñ¥¹Éôʬ(-I ¥ª¥×¥·¥ç¥ó)¤À¤±¤ò½ñ
+# ¤¤¤¿¤â¤Î
+HEADER_CXXFLAGS = $(boost_CXXFLAGS) -I. 
+
+# ¥³¥ó¥Ñ¥¤¥é¤ËÅϤ¹Â¾¤Î¥Õ¥é¥°
+# (+= ¤Çʸ»úÎó¤òÄɲ乤ë¤è¤¦¤Ë½ñ¤¯¤Î¤ò˺¤ì¤º¤Ë)
+CXXFLAGS += $(HEADER_CXXFLAGS)
+
+# ¥ê¥ó¥¯»þ¤ËɬÍפʥ饤¥Ö¥é¥ê¤È¥é¥¤¥Ö¥é¥ê¤Î¥Ñ¥¹¤ò¤³¤³¤Ë½ñ¤¯
+# (+= ¤Çʸ»úÎó¤òÄɲ乤ë¤è¤¦¤Ë½ñ¤¯¤Î¤ò˺¤ì¤º¤Ë)
+LIBS += \
+       $(boost_LIBS)  -lboost_thread -lboost_test_exec_monitor
+       
+
+depend:
+       makedepend -- $(include) -- $(SOURCES)
+# DO NOT DELETE
diff --git a/src/libmof.a b/src/libmof.a
new file mode 100644 (file)
index 0000000..8b277f0
--- /dev/null
@@ -0,0 +1 @@
+!<arch>
diff --git a/src/mof/base/mofdef.hpp b/src/mof/base/mofdef.hpp
new file mode 100644 (file)
index 0000000..e58470a
--- /dev/null
@@ -0,0 +1,9 @@
+#pragma once
+#include <cstddef>
+
+
+namespace mof
+{
+       typedef float real;
+
+}// namespace mof
diff --git a/src/mof/base/tstring.hpp b/src/mof/base/tstring.hpp
new file mode 100644 (file)
index 0000000..b8eab20
--- /dev/null
@@ -0,0 +1,13 @@
+#pragma once
+
+#include <string>
+#ifndef MSVC
+typedef TCHAR char;
+#else
+#include <tchar.h>
+#endif
+
+namespace mof
+{
+       typedef std::basic_string<TCHAR> tstring;
+}// namespace mof
diff --git a/src/mof/math/basic_vector.hpp b/src/mof/math/basic_vector.hpp
new file mode 100644 (file)
index 0000000..c298788
--- /dev/null
@@ -0,0 +1,28 @@
+#pragma once
+#include <mof/base/mofdef.hpp>
+
+namespace mof
+{
+namespace math
+{
+       template <size_t Dim>
+       class basic_vector
+       {
+       protected:
+               real components_[Dim];  
+       public:
+
+               basic_vector<Dim> operator+(const basic_vector<Dim>& rhs)
+               {
+                       basic_vector<Dim> retval;
+                       for (size_t i = 0; i < Dim; ++i)retval.components_[i] = components_[i] + rhs.components_[i];
+                       return retval;
+               }
+
+               real& operator[](size_t index){ return components_[index]; }
+               const real& operator[](size_t index) const { return components_[index]; }
+       };
+
+
+}// namespace math
+}// namespace mof
diff --git a/src/mof/util/foreach.hpp b/src/mof/util/foreach.hpp
new file mode 100644 (file)
index 0000000..d6ed9d4
--- /dev/null
@@ -0,0 +1,3 @@
+#pragma once
+#include <boost/foreach.hpp>
+#define foreach BOOST_FOREACH
diff --git a/test b/test
deleted file mode 100644 (file)
index 9daeafb..0000000
--- a/test
+++ /dev/null
@@ -1 +0,0 @@
-test
diff --git a/test/Makefile b/test/Makefile
new file mode 100644 (file)
index 0000000..f766d4e
--- /dev/null
@@ -0,0 +1,44 @@
+# ³Æ¥é¥¤¥Ö¥é¥êÍѤΠMakefile¡¥
+# TARGET, SOURCES, HEADER_CXXFLAGS, CXXFLAGS, LIBS ¤Î¤ß¤ò½ñ¤­´¹¤¨¤ë¤À¤±¤Ç¤è¤¤
+#
+# all, clean, distclean, install, uninstall ¤Ê¤É¤Ï¤É¤Î Makefile ¤Ç¤â¶¦Ä̤ÊÆâ
+# ÍƤ¬½ñ¤«¤ì¤ë¤Î¤Ç¡¤../Makefile.inc ¤È¤¤¤¦¥Õ¥¡¥¤¥ë¤Ë¤Ò¤È¤Þ¤È¤á¤Ë¤·¤Æ¤¤¤ë¡¥
+#
+
+# ¥³¥ó¥Ñ¥¤¥ë¡¦·ë¹ç¤·¤Æºî¤é¤ì¤ëºÇ½ªÅª¤Ê¥é¥¤¥Ö¥é¥ê¥Õ¥¡¥¤¥ë¤Î̾Á°
+TARGET = \
+       vectorx_test
+
+SOURCES = \
+       mof/math/vectorx_test.cpp 
+
+
+HEADERS = \
+
+
+# ¥³¥ó¥Ñ¥¤¥é¤ËÅϤ¹¥Õ¥é¥°¤Î¤¦¤Á¡¤¥¤¥ó¥¯¥ë¡¼¥É¥Ñ¥¹Éôʬ(-I ¥ª¥×¥·¥ç¥ó)¤À¤±¤ò½ñ
+# ¤¤¤¿¤â¤Î
+HEADER_CXXFLAGS = $(boost_CXXFLAGS) -I. -I../src
+
+# ¸¦µæ¼¼¤ÇÅý°ì¤µ¤ì¤¿ Make ¥·¥¹¥Æ¥à¤ò»È¤¦¤Î¤Ç¡¤¤³¤Î¾ì½ê¤Ç¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ë¡¥
+include ../Makefile.app.inc
+
+# ¥³¥ó¥Ñ¥¤¥é¤ËÅϤ¹Â¾¤Î¥Õ¥é¥°
+# (+= ¤Çʸ»úÎó¤òÄɲ乤ë¤è¤¦¤Ë½ñ¤¯¤Î¤ò˺¤ì¤º¤Ë)
+CXXFLAGS += $(HEADER_CXXFLAGS) -I../src
+
+# ¥ê¥ó¥¯»þ¤ËɬÍפʥ饤¥Ö¥é¥ê¤È¥é¥¤¥Ö¥é¥ê¤Î¥Ñ¥¹¤ò¤³¤³¤Ë½ñ¤¯
+# (+= ¤Çʸ»úÎó¤òÄɲ乤ë¤è¤¦¤Ë½ñ¤¯¤Î¤ò˺¤ì¤º¤Ë)
+LIBS += \
+       $(boost_LIBS)  -lboost_thread -lboost_filesystem\
+       -L../src  -lmof 
+
+test:
+       @if ! ./vectorx_test; then exit1; fi
+
+depend:
+       makedepend -Y $(HEADER_CXXFLAGS) -- $(SOURCES)
+# DO NOT DELETE
+
+mof/math/vectorx_test.o: ../src/mof/math/basic_vector.hpp
+mof/math/vectorx_test.o: ../src/mof/base/mofdef.hpp
diff --git a/test/Makefile.bak b/test/Makefile.bak
new file mode 100644 (file)
index 0000000..c6c3e3e
--- /dev/null
@@ -0,0 +1,40 @@
+# ³Æ¥é¥¤¥Ö¥é¥êÍѤΠMakefile¡¥
+# TARGET, SOURCES, HEADER_CXXFLAGS, CXXFLAGS, LIBS ¤Î¤ß¤ò½ñ¤­´¹¤¨¤ë¤À¤±¤Ç¤è¤¤
+#
+# all, clean, distclean, install, uninstall ¤Ê¤É¤Ï¤É¤Î Makefile ¤Ç¤â¶¦Ä̤ÊÆâ
+# ÍƤ¬½ñ¤«¤ì¤ë¤Î¤Ç¡¤../Makefile.inc ¤È¤¤¤¦¥Õ¥¡¥¤¥ë¤Ë¤Ò¤È¤Þ¤È¤á¤Ë¤·¤Æ¤¤¤ë¡¥
+#
+
+# ¥³¥ó¥Ñ¥¤¥ë¡¦·ë¹ç¤·¤Æºî¤é¤ì¤ëºÇ½ªÅª¤Ê¥é¥¤¥Ö¥é¥ê¥Õ¥¡¥¤¥ë¤Î̾Á°
+TARGET = vectorx_test
+
+SOURCES = \
+       mof/math/vectorx_test.cpp 
+
+
+HEADERS = \
+
+
+# ¥³¥ó¥Ñ¥¤¥é¤ËÅϤ¹¥Õ¥é¥°¤Î¤¦¤Á¡¤¥¤¥ó¥¯¥ë¡¼¥É¥Ñ¥¹Éôʬ(-I ¥ª¥×¥·¥ç¥ó)¤À¤±¤ò½ñ
+# ¤¤¤¿¤â¤Î
+HEADER_CXXFLAGS = $(boost_CXXFLAGS) -I. -I../src
+
+# ¸¦µæ¼¼¤ÇÅý°ì¤µ¤ì¤¿ Make ¥·¥¹¥Æ¥à¤ò»È¤¦¤Î¤Ç¡¤¤³¤Î¾ì½ê¤Ç¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ë¡¥
+include ../Makefile.app.inc
+
+# ¥³¥ó¥Ñ¥¤¥é¤ËÅϤ¹Â¾¤Î¥Õ¥é¥°
+# (+= ¤Çʸ»úÎó¤òÄɲ乤ë¤è¤¦¤Ë½ñ¤¯¤Î¤ò˺¤ì¤º¤Ë)
+CXXFLAGS += $(HEADER_CXXFLAGS) -I../src
+
+# ¥ê¥ó¥¯»þ¤ËɬÍפʥ饤¥Ö¥é¥ê¤È¥é¥¤¥Ö¥é¥ê¤Î¥Ñ¥¹¤ò¤³¤³¤Ë½ñ¤¯
+# (+= ¤Çʸ»úÎó¤òÄɲ乤ë¤è¤¦¤Ë½ñ¤¯¤Î¤ò˺¤ì¤º¤Ë)
+LIBS += \
+       $(boost_LIBS)  -lboost_thread -lboost_filesystem\
+       -L../src  -lmof 
+
+depend:
+       makedepend -Y $(HEADER_CXXFLAGS) -- $(SOURCES)
+# DO NOT DELETE
+
+mof/math/vectorx_test.o: ../src/mof/math/basic_vector.hpp
+mof/math/vectorx_test.o: ../src/mof/base/mofdef.hpp
diff --git a/test/mof/math/vectorx_test.cpp b/test/mof/math/vectorx_test.cpp
new file mode 100644 (file)
index 0000000..e906bd5
--- /dev/null
@@ -0,0 +1,12 @@
+#include <mof/math/basic_vector.hpp>
+#include <iostream>
+
+int main()
+{
+       mof::math::basic_vector<2> v, w;
+       v[0] = 1;
+       w[0] = 2;
+       v = v + w;
+       std::cout << "test success" << std::endl;
+       return 0;
+}
diff --git a/test/mof/math/vectorx_test.o b/test/mof/math/vectorx_test.o
new file mode 100644 (file)
index 0000000..ad2201f
Binary files /dev/null and b/test/mof/math/vectorx_test.o differ
diff --git a/test/vectorx_test b/test/vectorx_test
new file mode 100755 (executable)
index 0000000..5357883
Binary files /dev/null and b/test/vectorx_test differ