-performance test
+matrix multipla test
+matrix devide test
+debug print test
+make_rotation make_scaling ***
+test for above
+sample for matrix
+doxygen
+delete matrix array
--- /dev/null
+#pragma once
+#include <mof/base/mofdef.hpp>
+#include <boost/operators.hpp>
+#include <ostream>
+
+namespace mof
+{
+namespace math
+{
+
+ template <size_t Dim> struct row_of_matrix;
+
+ /**
+ * @brief 同次座標変換行列テンプレートクラス
+ * @note このテンプレートから直接特殊化することは想定していない.
+ * あくまでmatrixxを実装するための補助テンプレートである.
+ * このクラスは不変クラスである.
+ * @tparam Dim 行列の次元(要素数はこの数値の2乗)
+ * @tparam Derived 特殊化されたテンプレートの派生クラス(matrixx)の型
+ * @tparam Coordinate 対応するベクトルクラス(vectorx)の型
+ */
+ template <size_t Dim, typename Derived, typename Coordinate>
+ class basic_matrix
+ : boost::addable< Derived
+ , boost::addable2< Derived, float
+ , boost::subtractable< Derived
+ , boost::subtractable2< Derived, float
+ , boost::multipliable< Derived
+ , boost::multipliable2< Derived, float
+ , boost::equality_comparable< Derived
+ > > > > > > >
+ {
+ protected:
+//{{{ last_index
+ /**
+ * @brief elements_の最後の添字を得る
+ */
+ size_t last_index() const
+ {
+ return (Dim + 1) * (Dim + 1);
+ }
+//}}}
+ float elements_[(Dim + 1) * (Dim + 1)];///< 要素の配列
+ public:
+//{{{ array
+/*
+ struct array
+ {
+ float arr_[(Dim + 1) * (Dim + 1) - 1];
+
+ float& operator[](size_t index)
+ {
+ return arr_[index];
+ }
+
+ };
+*/
+//}}}
+ // コンストラクタ,デストラクタはデフォルトのものを使う
+ // 代入演算子,コピーコンストラクタはデフォルトのものを使う
+//{{{ operator +=
+ Derived& operator+=(const Derived& rhs)
+ {
+ const size_t END = last_index() - 1;// 最後の要素は1で保存
+ for (size_t i = 0; i < END; ++i) {
+ elements_[i] += rhs.elements_[i];
+ }
+ return *reinterpret_cast<Derived*>(this);//thisがDerived型であることは保証されている.
+ }
+
+ Derived& operator+=(float rhs)
+ {
+ const size_t END = last_index() - 1;// 最後の要素は1で保存
+ for (size_t i = 0; i < END; ++i) {
+ elements_[i] += rhs;
+ }
+ return *reinterpret_cast<Derived*>(this);//thisがDerived型であることは保証されている.
+ }
+
+ friend Derived operator+(float rhs1, Derived& rhs2)
+ {
+ Derived retval;
+ const size_t END = last_index() - 1;// 最後の要素は1で保存
+ for (size_t i = 0; i < END; ++i) {
+ retval.elements_[i] = rhs1 + rhs2.elements_[i];
+ }
+ return retval;
+ }
+//}}}
+//{{{ operator -=
+ Derived& operator-=(const Derived& rhs)
+ {
+ const size_t END = last_index() - 1;// 最後の要素は1で保存
+ for (size_t i = 0; i < END; ++i) {
+ elements_[i] -= rhs.elements_[i];
+ }
+ return *reinterpret_cast<Derived*>(this);//thisがDerived型であることは保証されている.
+ }
+
+ Derived& operator-=(float rhs)
+ {
+ const size_t END = last_index() - 1;// 最後の要素は1で保存
+ for (size_t i = 0; i < END; ++i) {
+ elements_[i] -= rhs;
+ }
+ return *reinterpret_cast<Derived*>(this);//thisがDerived型であることは保証されている.
+ }
+
+ friend Derived operator-(float rhs1, Derived& rhs2)
+ {
+ Derived retval;
+ const size_t END = last_index() - 1;// 最後の要素は1で保存
+ for (size_t i = 0; i < END; ++i) {
+ retval.elements_[i] = rhs1 - rhs2.elements_[i];
+ }
+ return retval;
+ }
+//}}}
+//{{{ operator *=
+ Derived& operator*=(const Derived& rhs)
+ {
+ Derived retval;
+ for (size_t a = 0; a < last_index(); ++a) {
+ int b = a / Dim * Dim;
+ int c = a % Dim;
+ float sum = 0;
+ for (size_t i = 0; i < Dim; ++i) {
+ sum += elements_[b + i] * rhs.elements_[c + i * Dim];
+ }
+ retval.elements_[a] = sum;
+ }
+ *this = retval;
+ return *reinterpret_cast<Derived*>(this);//thisがDerived型であることは保証されている.
+ }
+
+ Derived& operator*=(float rhs)
+ {
+ const size_t END = last_index() - 1;// 最後の要素は1で保存
+ for (size_t i = 0; i < END; ++i) {
+ elements_[i] *= rhs;
+ }
+ return *reinterpret_cast<Derived*>(this);//thisがDerived型であることは保証されている.
+ }
+
+ Coordinate& operator*(const Coordinate& rhs)
+ {
+ Coordinate retval;
+ for (size_t a = 0; a < Dim; ++a) {
+ int b = a / Dim * Dim;
+ int c = a % Dim;
+ float sum = 0;
+ for (size_t i = 0; i < Dim; ++i) {
+ sum += elements_[b + i] * rhs[c + i];
+ }
+ retval.components_[a] = sum;
+ }
+ return retval;
+ }
+
+ friend Derived operator*(float rhs1, Derived& rhs2)
+ {
+ Derived retval;
+ const size_t END = last_index() - 1;// 最後の要素は1で保存
+ for (size_t i = 0; i < END; ++i) {
+ retval.elements_[i] = rhs1 * rhs2.elements_[i];
+ }
+ return retval;
+ }
+//}}}
+//{{{ operator /=
+ Derived& operator/=(float rhs)
+ {
+ const size_t END = last_index() - 1;// 最後の要素は1で保存
+ for (size_t i = 0; i < END; ++i) {
+ elements_[i] /= rhs;
+ }
+ return *reinterpret_cast<Derived*>(this);//thisがDerived型であることは保証されている.
+ }
+//}}}
+//{{{ operator ==
+ bool operator==(const Derived& rhs) const
+ {
+ const size_t END = last_index() - 1;// 最後の要素は1で保存
+ for (size_t i = 0; i < END; ++i) {
+ if (elements_[i] != rhs.elements_[i]) return false;
+ }
+ return true;
+ }
+//}}}
+//{{{ operator []
+ /**
+ * @note 補助クラスによってM[i][j]のように参照可能
+ * @note この方法による複数の要素への参照は非効率
+ */
+ row_of_matrix<Dim> operator [](size_t i) const
+ {
+ return row_of_matrix<Dim>(elements_, i);
+ }
+//}}}
+//{{{ operator <<
+ /**
+ * @brief デバッグ出力用ストリーム演算子
+ * @param [in] stream 出力ストリーム
+ * @param [in] rhs 出力対象となる行列オブジェクト
+ * @return 引数で与えられた出力ストリーム
+ */
+ friend std::ostream& operator<<
+ (
+ std::ostream& stream,
+ const Derived& rhs
+ )
+ {
+ for (size_t i = 0; i < Dim + 1; ++i) {
+ for (size_t j = 0; j < Dim + 1; ++j) {
+ if (j != 0) stream << ", ";
+ else if (j != Dim) stream << "\n";
+ stream << rhs.elements_[i * (Dim + 1) + j];
+ }
+ }
+ return stream;
+ }
+//}}}
+ };
+//{{{ row_of_matrix
+ /**
+ * @brief M[i][j]のように行列の要素を参照できるようにするための補助クラス
+ */
+ template <size_t Dim>
+ struct row_of_matrix
+ {
+ const float* elements_;
+ size_t row_index_;
+
+ row_of_matrix(const float* elements, size_t row_index)
+ : elements_(elements), row_index_(row_index)
+ {
+ }
+
+ float operator [](size_t index)
+ {
+ return elements_[row_index_ * (Dim + 1) + index];
+ }
+ };
+//}}}
+
+}// namespace math
+}// namespace mof
namespace math
{
/**
- * @brief å\9fºåº\95ベクトルテンプレートクラス
+ * @brief å\90\8c次å\88\97ベクトルテンプレートクラス
* @note このテンプレートから直接特殊化することは想定していない.
* あくまでvectorxを実装するための補助テンプレートである.
* このクラスは不変クラスである.
protected:
float components_[Dim];///< 要素の配列
public:
+//{{{ array
+ struct array
+ {
+ float arr_[Dim];
+
+ float& operator[](size_t index)
+ {
+ return arr_[index];
+ }
+
+ };
+//}}}
// コンストラクタ,デストラクタはデフォルトのものを使う
// 代入演算子,コピーコンストラクタはデフォルトのものを使う
//{{{ operator +=
return *reinterpret_cast<Derived*>(this);//thisがDerived型であることは保証されている.
}
- friend Derived operator/(float rhs1, Derived& rhs2)
- {
- Derived retval;
- for (size_t i = 0; i < Dim; ++i) retval.components_[i] = rhs1 / rhs2.components_[i];
- return retval;
- }
//}}}
//{{{ operator ==
bool operator==(const Derived& rhs) const
{
- for (size_t i = 0; i < Dim; ++i)
- {
+ for (size_t i = 0; i < Dim; ++i) {
if (components_[i] != rhs.components_[i]) return false;
}
return true;
}
//}}}
+//{{{ operator []
+ /**
+ * @note Dim+1番目の要素は常に1
+ * @param[in] index 添字
+ */
+ float operator[](size_t index) const
+ {
+ if (index < Dim) return components_[index];
+ else if (index == Dim) return 1;
+ // TODO exception
+ return 0;
+ }
+//}}}
//{{{ operator <<
/**
* @brief デバッグ出力用ストリーム演算子
- * @param [in] stream 出力ストリーム
- * @param [in] rhs 出力対象となるベクトルオブジェクト
+ * @param[in] stream 出力ストリーム
+ * @param[in] rhs 出力対象となるベクトルオブジェクト
* @return 引数で与えられた出力ストリーム
*/
friend std::ostream& operator<<
--- /dev/null
+/**
+ * @file 各次元の行列をまとめてインクルードするためのヘッダ
+ */
+#pragma once
+#include <mof/math/matrix2.hpp>
+#include <mof/math/matrix3.hpp>
--- /dev/null
+#pragma once
+#include <mof/math/basic_matrix.hpp>
+
+namespace mof
+{
+namespace math
+{
+ class vector2;
+
+ /**
+ * @brief 2次元同次座標変換行列クラス
+ */
+ class matrix2 : public basic_matrix<2, matrix2, vector2>
+ {
+ public:
+//{{{ constructor
+ /**
+ * @brief デフォルトコンストラクタ.最後の要素以外を0で初期化する.
+ */
+ matrix2()
+ {
+ for (size_t i = 0; i < last_index() - 1; ++i) {
+ elements_[i] = 0;
+ }
+ elements_[last_index() - 1] = 1;
+ }
+
+ /**
+ * @brief 指定した値で初期化する.
+ * @param[in] arr 初期化用配列
+ */
+/*
+ matrix2(const matrix2::array& arr)
+ {
+ for (size_t i = 0; i < last_index() - 1; ++i) {
+ elements_[i] = arr[i];
+ }
+ elements_[last_index() - 1] = 1;
+ }
+*/
+
+ /**
+ * @brief 指定した値で初期化する.
+ */
+ matrix2
+ (
+ float m11, float m12, float m13,
+ float m21, float m22, float m23,
+ float m31, float m32
+ )
+ {
+ const float* table[] =
+ {
+ &m11, &m12, &m13,
+ &m21, &m22, &m23,
+ &m31, &m32
+ };
+ for (size_t i = 0; i < last_index() - 1; ++i) {
+ elements_[i] = *table[i];
+ }
+ elements_[last_index() - 1] = 1;
+ }
+
+//}}}
+//{{{ copy constructor
+ matrix2(const matrix2& rhs)
+ {
+ for (size_t i = 0; i < last_index(); ++i) {
+ elements_[i] = rhs.elements_[i];
+ }
+ }
+//}}}
+//{{{ operator =
+ matrix2& operator = (const matrix2& rhs)
+ {
+ for (size_t i = 0; i < last_index(); ++i) {
+ elements_[i] = rhs.elements_[i];
+ }
+ return *this;
+ }
+//}}}
+ };
+
+}// namespace math
+}// namespace mof
--- /dev/null
+#pragma once
+#include <mof/math/basic_matrix.hpp>
+
+namespace mof
+{
+namespace math
+{
+ class vector3;
+
+ /**
+ * @brief 3次元同次座標変換行列クラス
+ */
+ class matrix3 : public basic_matrix<3, matrix3, vector3>
+ {
+ public:
+//{{{ constructor
+ /**
+ * @brief デフォルトコンストラクタ.最後の要素以外を0で初期化する.
+ */
+ matrix3()
+ {
+ for (size_t i = 0; i < last_index() - 1; ++i) {
+ elements_[i] = 0;
+ }
+ elements_[last_index() - 1] = 1;
+ }
+
+ /**
+ * @brief 指定した値で初期化する.
+ * @param[in] arr 初期化用配列
+ */
+/*
+ matrix3(const matrix3::array& arr)
+ {
+ for (size_t i = 0; i < last_index() - 1; ++i) {
+ elements_[i] = arr[i];
+ }
+ elements_[last_index() - 1] = 1;
+ }
+*/
+
+ /**
+ * @brief 指定した値で初期化する.
+ */
+ matrix3
+ (
+ float m11, float m12, float m13, float m14,
+ float m21, float m22, float m23, float m24,
+ float m31, float m32, float m33, float m34,
+ float m41, float m42, float m43
+ )
+ {
+ const float* table[] =
+ {
+ &m11, &m12, &m13, &m14,
+ &m21, &m22, &m23, &m24,
+ &m31, &m32, &m33, &m34,
+ &m41, &m42, &m43
+ };
+ for (size_t i = 0; i < last_index() - 1; ++i) {
+ elements_[i] = *table[i];
+ }
+ elements_[last_index() - 1] = 1;
+ }
+
+//}}}
+//{{{ copy constructor
+ matrix3(const matrix3& rhs)
+ {
+ for (size_t i = 0; i < last_index(); ++i) {
+ elements_[i] = rhs.elements_[i];
+ }
+ }
+//}}}
+//{{{ operator =
+ /**
+ * @note コピーのパフォーマンスのためにこの関数の定義は重要
+ */
+ matrix3& operator = (const matrix3& rhs)
+ {
+ for (size_t i = 0; i < last_index(); ++i) {
+ elements_[i] = rhs.elements_[i];
+ }
+ return *this;
+ }
+//}}}
+ };
+
+}// namespace math
+}// namespace mof
namespace math
{
/**
- * @brief 2次元同次ベクトルクラス
+ * @brief 2次元同次列ベクトルクラス
*/
class vector2 : public basic_vector<2, vector2>
{
components_[0] = x;
components_[1] = y;
}
+
+ /**
+ * @brief 指定した値で初期化する.
+ * @param[in] arr 初期化用配列
+ */
+/*
+ vector2(const vector2::array& arr)
+ {
+ components_[0] = arr[0];
+ components_[1] = arr[1];
+ }
+*/
//}}}
//{{{ accessers
float x() const { return components_[0]; }
namespace math
{
/**
- * @brief 3次元同次ベクトルクラス
+ * @brief 3次元同次列ベクトルクラス
*/
class vector3 : public basic_vector<3, vector3>
{
components_[1] = y;
components_[2] = z;
}
+
+ /**
+ * @brief 指定した値で初期化する.
+ * @param[in] arr 初期化用配列
+ */
+/*
+ vector3(const vector3::array& arr)
+ {
+ components_[0] = arr[0];
+ components_[1] = arr[1];
+ components_[2] = arr[2];
+ }
+*/
+
//}}}
//{{{ accesser
float x() const { return components_[0]; }
if (MSVC)
set(CMAKE_CXX_FLAGS "/EHsc /nologo /W4 /WX")
elseif (CMAKE_COMPILER_IS_GNUCC)
- set(CMAKE_CXX_FLAGS "-Wall -Werror -O1 -DPSTSDK_VALIDATION_LEVEL_FULL -std=c++0x")
+ set(CMAKE_CXX_FLAGS " -Wall -O3 -DNDEBUG -std=c++0x")
#set(CMAKE_CXX_FLAGS "-Wall -Werror -g -DPSTSDK_VALIDATION_LEVEL_FULL -std=c++0x")
endif()
tchar.h
-
+../../include/mof/math/basic_matrix.hpp
+mof/base/mofdef.hpp
+-
+boost/operators.hpp
+-
+ostream
+-
+
../../include/mof/math/basic_vector.hpp
mof/base/mofdef.hpp
-
ostream
-
+../../include/mof/math/matrix.hpp
+mof/math/matrix2.hpp
+-
+mof/math/matrix3.hpp
+-
+
+../../include/mof/math/matrix2.hpp
+mof/math/basic_matrix.hpp
+-
+
+../../include/mof/math/matrix3.hpp
+mof/math/basic_matrix.hpp
+-
+
+../../include/mof/math/matrix_tmp.hpp
+mof/math/basic_matrix.hpp
+-
+
../../include/mof/math/vector.hpp
mof/math/vector2.hpp
-
/home/yasutomo/devel/moflib/sample/numeric/main.cpp
mof/math/vector.hpp
-
+mof/math/matrix.hpp
+-
+mof/math/matrix_tmp.hpp
+-
mof/util/multimedia_timer.hpp
-
iostream
numeric/CMakeFiles/numeric.dir/main.cpp.o
../../include/mof/base/mofdef.hpp
../../include/mof/base/tstring.hpp
+ ../../include/mof/math/basic_matrix.hpp
../../include/mof/math/basic_vector.hpp
+ ../../include/mof/math/matrix.hpp
+ ../../include/mof/math/matrix2.hpp
+ ../../include/mof/math/matrix3.hpp
+ ../../include/mof/math/matrix_tmp.hpp
../../include/mof/math/vector.hpp
../../include/mof/math/vector2.hpp
../../include/mof/math/vector3.hpp
numeric/CMakeFiles/numeric.dir/main.cpp.o: ../../include/mof/base/mofdef.hpp
numeric/CMakeFiles/numeric.dir/main.cpp.o: ../../include/mof/base/tstring.hpp
+numeric/CMakeFiles/numeric.dir/main.cpp.o: ../../include/mof/math/basic_matrix.hpp
numeric/CMakeFiles/numeric.dir/main.cpp.o: ../../include/mof/math/basic_vector.hpp
+numeric/CMakeFiles/numeric.dir/main.cpp.o: ../../include/mof/math/matrix.hpp
+numeric/CMakeFiles/numeric.dir/main.cpp.o: ../../include/mof/math/matrix2.hpp
+numeric/CMakeFiles/numeric.dir/main.cpp.o: ../../include/mof/math/matrix3.hpp
+numeric/CMakeFiles/numeric.dir/main.cpp.o: ../../include/mof/math/matrix_tmp.hpp
numeric/CMakeFiles/numeric.dir/main.cpp.o: ../../include/mof/math/vector.hpp
numeric/CMakeFiles/numeric.dir/main.cpp.o: ../../include/mof/math/vector2.hpp
numeric/CMakeFiles/numeric.dir/main.cpp.o: ../../include/mof/math/vector3.hpp
# Generated by "Unix Makefiles" Generator, CMake Version 2.8
# compile CXX with /usr/bin/c++
-CXX_FLAGS = -Wall -Werror -O1 -DPSTSDK_VALIDATION_LEVEL_FULL -std=c++0x -I/home/yasutomo/devel/moflib/sample/../include -I/home/yasutomo/devel/moflib/sample/BOOST_INCLUDE_DIR
+CXX_FLAGS = -Wall -O3 -DNDEBUG -std=c++0x -I/home/yasutomo/devel/moflib/sample/../include -I/home/yasutomo/devel/moflib/sample/BOOST_INCLUDE_DIR
CXX_DEFINES =
-/usr/bin/c++ -Wall -Werror -O1 -DPSTSDK_VALIDATION_LEVEL_FULL -std=c++0x CMakeFiles/numeric.dir/main.cpp.o -o /home/yasutomo/devel/moflib/bin/numeric -rdynamic -L/home/yasutomo/devel/moflib/sample/../lib -lrt -lmofutil -lmofmath -Wl,-rpath,/home/yasutomo/devel/moflib/sample/../lib
+/usr/bin/c++ -Wall -O3 -DNDEBUG -std=c++0x CMakeFiles/numeric.dir/main.cpp.o -o /home/yasutomo/devel/moflib/bin/numeric -rdynamic -L/home/yasutomo/devel/moflib/sample/../lib -lrt -lmofutil -lmofmath -Wl,-rpath,/home/yasutomo/devel/moflib/sample/../lib
#include <mof/math/vector.hpp>
+#include <mof/math/matrix.hpp>
+#include <mof/math/matrix_tmp.hpp>
#include <mof/util/multimedia_timer.hpp>
#include <iostream>
#include <memory>
-const int REPEAT_COUNT = 5000000;
+const int REPEAT_COUNT = 100000000;
namespace
{
}
};
//}}}
+//{{{ raw_type16
+ class raw_type16
+ {
+ float data[16];
+ };
+//}}}
+//{{{ raw_type3
+ class raw_type3
+ {
+ float data[3];
+ };
+//}}}
+ mof::math::vector2 unused1;// block compile optimation
+ mof::math::vector3 unused2;// block compile optimation
+ mof::math::matrix2 unused3;// block compile optimation
+ mof::math::matrix3 unused4;// block compile optimation
+ raw_type3 unused6;
+ raw_type16 unused7;
+ shared_type unused5; // block compile optimation
+//{{{ copy_test
+ template <typename T>
+ int copy_test(T& unused) {
+ using namespace mof::util;
+ T v;
+ multimedia_timer timer;
+ for (int i = 0; i < REPEAT_COUNT; i++) unused = v;
+ return timer.get_time_in_micro_sec();
+ }
+//}}}
}
int main()
{
using namespace std;
using namespace mof::math;
- using namespace mof::util;
cout << "***copy performance test***" << endl;
- {
- cout << "vector2 --- " ;
- vector2 v, w;
- multimedia_timer timer;
- for (int i = 0; i < REPEAT_COUNT; i++) {
- v = w;
- }
- cout << timer.get_time_in_micro_sec() << endl;
- }
+ cout << REPEAT_COUNT << " times repeating" << endl;
+
+ cout << "vector2 --- " ;
+ cout << copy_test<vector2>(unused1) << "[micro sec]" << endl;
+
+ cout << "vector3 --- " ;
+ cout << copy_test<vector3>(unused2) << "[micro sec]" << endl;
+
+ cout << "matrix2 --- " ;
+ cout << copy_test<matrix2>(unused3) << "[micro sec]" << endl;
- {
- cout << "vector3 --- " ;
- vector3 v, w;
- multimedia_timer timer;
- for (int i = 0; i < REPEAT_COUNT; i++) {
- v = w;
- }
- cout << timer.get_time_in_micro_sec() << endl;
- }
+ cout << "matrix3 --- " ;
+ cout << copy_test<matrix3>(unused4) << "[micro sec]" << endl;
+
+ cout << "raw type3 --- " ;
+ cout << copy_test<raw_type3>(unused6) << "[micro sec]" << endl;
+
+ cout << "raw type16 --- " ;
+ cout << copy_test<raw_type16>(unused7) << "[micro sec]" << endl;
+
+ cout << "shared type --- " ;
+ cout << copy_test<shared_type>(unused5) << "[micro sec]" << endl;
- {
- cout << "shared_ptr object --- " ;
- shared_type v, w;
- multimedia_timer timer;
- for (int i = 0; i < REPEAT_COUNT; i++) {
- v = w;
- }
- cout << timer.get_time_in_micro_sec() << endl;
- }
return 0;
# Dependency information for all targets:
SET(CMAKE_DEPEND_INFO_FILES
"mof/util/CMakeFiles/mofutil.dir/DependInfo.cmake"
+ "mof/math/CMakeFiles/matrix2_test.dir/DependInfo.cmake"
+ "mof/math/CMakeFiles/matrix3_test.dir/DependInfo.cmake"
"mof/math/CMakeFiles/mofmath.dir/DependInfo.cmake"
"mof/math/CMakeFiles/vector2_test.dir/DependInfo.cmake"
"mof/math/CMakeFiles/vector3_test.dir/DependInfo.cmake"
mof/util/CMakeFiles/mofutil.dir/all:
$(MAKE) -f mof/util/CMakeFiles/mofutil.dir/build.make mof/util/CMakeFiles/mofutil.dir/depend
$(MAKE) -f mof/util/CMakeFiles/mofutil.dir/build.make mof/util/CMakeFiles/mofutil.dir/build
- $(CMAKE_COMMAND) -E cmake_progress_report /home/yasutomo/devel/moflib/src/build_unix/CMakeFiles 2
+ $(CMAKE_COMMAND) -E cmake_progress_report /home/yasutomo/devel/moflib/src/build_unix/CMakeFiles 4
@echo "Built target mofutil"
.PHONY : mof/util/CMakeFiles/mofutil.dir/all
# Directory level rules for directory mof/math
# Convenience name for "all" pass in the directory.
+mof/math/all: mof/math/CMakeFiles/matrix2_test.dir/all
+mof/math/all: mof/math/CMakeFiles/matrix3_test.dir/all
mof/math/all: mof/math/CMakeFiles/mofmath.dir/all
mof/math/all: mof/math/CMakeFiles/vector2_test.dir/all
mof/math/all: mof/math/CMakeFiles/vector3_test.dir/all
.PHONY : mof/math/all
# Convenience name for "clean" pass in the directory.
+mof/math/clean: mof/math/CMakeFiles/matrix2_test.dir/clean
+mof/math/clean: mof/math/CMakeFiles/matrix3_test.dir/clean
mof/math/clean: mof/math/CMakeFiles/mofmath.dir/clean
mof/math/clean: mof/math/CMakeFiles/vector2_test.dir/clean
mof/math/clean: mof/math/CMakeFiles/vector3_test.dir/clean
.PHONY : mof/math/preinstall
#=============================================================================
+# Target rules for target mof/math/CMakeFiles/matrix2_test.dir
+
+# All Build rule for target.
+mof/math/CMakeFiles/matrix2_test.dir/all: mof/math/CMakeFiles/mofmath.dir/all
+ $(MAKE) -f mof/math/CMakeFiles/matrix2_test.dir/build.make mof/math/CMakeFiles/matrix2_test.dir/depend
+ $(MAKE) -f mof/math/CMakeFiles/matrix2_test.dir/build.make mof/math/CMakeFiles/matrix2_test.dir/build
+ $(CMAKE_COMMAND) -E cmake_progress_report /home/yasutomo/devel/moflib/src/build_unix/CMakeFiles 1
+ @echo "Built target matrix2_test"
+.PHONY : mof/math/CMakeFiles/matrix2_test.dir/all
+
+# Include target in all.
+all: mof/math/CMakeFiles/matrix2_test.dir/all
+.PHONY : all
+
+# Build rule for subdir invocation for target.
+mof/math/CMakeFiles/matrix2_test.dir/rule: cmake_check_build_system
+ $(CMAKE_COMMAND) -E cmake_progress_start /home/yasutomo/devel/moflib/src/build_unix/CMakeFiles 2
+ $(MAKE) -f CMakeFiles/Makefile2 mof/math/CMakeFiles/matrix2_test.dir/all
+ $(CMAKE_COMMAND) -E cmake_progress_start /home/yasutomo/devel/moflib/src/build_unix/CMakeFiles 0
+.PHONY : mof/math/CMakeFiles/matrix2_test.dir/rule
+
+# Convenience name for target.
+matrix2_test: mof/math/CMakeFiles/matrix2_test.dir/rule
+.PHONY : matrix2_test
+
+# clean rule for target.
+mof/math/CMakeFiles/matrix2_test.dir/clean:
+ $(MAKE) -f mof/math/CMakeFiles/matrix2_test.dir/build.make mof/math/CMakeFiles/matrix2_test.dir/clean
+.PHONY : mof/math/CMakeFiles/matrix2_test.dir/clean
+
+# clean rule for target.
+clean: mof/math/CMakeFiles/matrix2_test.dir/clean
+.PHONY : clean
+
+#=============================================================================
+# Target rules for target mof/math/CMakeFiles/matrix3_test.dir
+
+# All Build rule for target.
+mof/math/CMakeFiles/matrix3_test.dir/all: mof/math/CMakeFiles/mofmath.dir/all
+ $(MAKE) -f mof/math/CMakeFiles/matrix3_test.dir/build.make mof/math/CMakeFiles/matrix3_test.dir/depend
+ $(MAKE) -f mof/math/CMakeFiles/matrix3_test.dir/build.make mof/math/CMakeFiles/matrix3_test.dir/build
+ $(CMAKE_COMMAND) -E cmake_progress_report /home/yasutomo/devel/moflib/src/build_unix/CMakeFiles 2
+ @echo "Built target matrix3_test"
+.PHONY : mof/math/CMakeFiles/matrix3_test.dir/all
+
+# Include target in all.
+all: mof/math/CMakeFiles/matrix3_test.dir/all
+.PHONY : all
+
+# Build rule for subdir invocation for target.
+mof/math/CMakeFiles/matrix3_test.dir/rule: cmake_check_build_system
+ $(CMAKE_COMMAND) -E cmake_progress_start /home/yasutomo/devel/moflib/src/build_unix/CMakeFiles 2
+ $(MAKE) -f CMakeFiles/Makefile2 mof/math/CMakeFiles/matrix3_test.dir/all
+ $(CMAKE_COMMAND) -E cmake_progress_start /home/yasutomo/devel/moflib/src/build_unix/CMakeFiles 0
+.PHONY : mof/math/CMakeFiles/matrix3_test.dir/rule
+
+# Convenience name for target.
+matrix3_test: mof/math/CMakeFiles/matrix3_test.dir/rule
+.PHONY : matrix3_test
+
+# clean rule for target.
+mof/math/CMakeFiles/matrix3_test.dir/clean:
+ $(MAKE) -f mof/math/CMakeFiles/matrix3_test.dir/build.make mof/math/CMakeFiles/matrix3_test.dir/clean
+.PHONY : mof/math/CMakeFiles/matrix3_test.dir/clean
+
+# clean rule for target.
+clean: mof/math/CMakeFiles/matrix3_test.dir/clean
+.PHONY : clean
+
+#=============================================================================
# Target rules for target mof/math/CMakeFiles/mofmath.dir
# All Build rule for target.
mof/math/CMakeFiles/mofmath.dir/all:
$(MAKE) -f mof/math/CMakeFiles/mofmath.dir/build.make mof/math/CMakeFiles/mofmath.dir/depend
$(MAKE) -f mof/math/CMakeFiles/mofmath.dir/build.make mof/math/CMakeFiles/mofmath.dir/build
- $(CMAKE_COMMAND) -E cmake_progress_report /home/yasutomo/devel/moflib/src/build_unix/CMakeFiles 1
+ $(CMAKE_COMMAND) -E cmake_progress_report /home/yasutomo/devel/moflib/src/build_unix/CMakeFiles 3
@echo "Built target mofmath"
.PHONY : mof/math/CMakeFiles/mofmath.dir/all
mof/math/CMakeFiles/vector2_test.dir/all: mof/math/CMakeFiles/mofmath.dir/all
$(MAKE) -f mof/math/CMakeFiles/vector2_test.dir/build.make mof/math/CMakeFiles/vector2_test.dir/depend
$(MAKE) -f mof/math/CMakeFiles/vector2_test.dir/build.make mof/math/CMakeFiles/vector2_test.dir/build
- $(CMAKE_COMMAND) -E cmake_progress_report /home/yasutomo/devel/moflib/src/build_unix/CMakeFiles 3
+ $(CMAKE_COMMAND) -E cmake_progress_report /home/yasutomo/devel/moflib/src/build_unix/CMakeFiles 5
@echo "Built target vector2_test"
.PHONY : mof/math/CMakeFiles/vector2_test.dir/all
mof/math/CMakeFiles/vector3_test.dir/all: mof/math/CMakeFiles/mofmath.dir/all
$(MAKE) -f mof/math/CMakeFiles/vector3_test.dir/build.make mof/math/CMakeFiles/vector3_test.dir/depend
$(MAKE) -f mof/math/CMakeFiles/vector3_test.dir/build.make mof/math/CMakeFiles/vector3_test.dir/build
- $(CMAKE_COMMAND) -E cmake_progress_report /home/yasutomo/devel/moflib/src/build_unix/CMakeFiles 4
+ $(CMAKE_COMMAND) -E cmake_progress_report /home/yasutomo/devel/moflib/src/build_unix/CMakeFiles 6
@echo "Built target vector3_test"
.PHONY : mof/math/CMakeFiles/vector3_test.dir/all
+/home/yasutomo/devel/moflib/src/build_unix/mof/math/CMakeFiles/matrix2_test.dir
+/home/yasutomo/devel/moflib/src/build_unix/mof/math/CMakeFiles/matrix3_test.dir
/home/yasutomo/devel/moflib/src/build_unix/mof/math/CMakeFiles/mofmath.dir
/home/yasutomo/devel/moflib/src/build_unix/mof/util/CMakeFiles/mofutil.dir
/home/yasutomo/devel/moflib/src/build_unix/mof/math/CMakeFiles/vector2_test.dir
.PHONY : mofutil/fast
#=============================================================================
+# Target rules for targets named matrix2_test
+
+# Build rule for target.
+matrix2_test: cmake_check_build_system
+ $(MAKE) -f CMakeFiles/Makefile2 matrix2_test
+.PHONY : matrix2_test
+
+# fast build rule for target.
+matrix2_test/fast:
+ $(MAKE) -f mof/math/CMakeFiles/matrix2_test.dir/build.make mof/math/CMakeFiles/matrix2_test.dir/build
+.PHONY : matrix2_test/fast
+
+#=============================================================================
+# Target rules for targets named matrix3_test
+
+# Build rule for target.
+matrix3_test: cmake_check_build_system
+ $(MAKE) -f CMakeFiles/Makefile2 matrix3_test
+.PHONY : matrix3_test
+
+# fast build rule for target.
+matrix3_test/fast:
+ $(MAKE) -f mof/math/CMakeFiles/matrix3_test.dir/build.make mof/math/CMakeFiles/matrix3_test.dir/build
+.PHONY : matrix3_test/fast
+
+#=============================================================================
# Target rules for targets named mofmath
# Build rule for target.
@echo "... rebuild_cache"
@echo "... test"
@echo "... mofutil"
+ @echo "... matrix2_test"
+ @echo "... matrix3_test"
@echo "... mofmath"
@echo "... vector2_test"
@echo "... vector3_test"
--- /dev/null
+Start testing: Aug 17 13:29 PDT
+----------------------------------------------------------
+1/4 Testing: vector2_test
+1/4 Test: vector2_test
+Command: "/home/yasutomo/devel/moflib/src/mof/math/test/testbin/vector2_test"
+Directory: /home/yasutomo/devel/moflib/src/build_unix/mof/math
+"vector2_test" start time: Aug 17 13:29 PDT
+Output:
+----------------------------------------------------------
+<end of output>
+Test time = 0.00 sec
+----------------------------------------------------------
+Test Passed.
+"vector2_test" end time: Aug 17 13:29 PDT
+"vector2_test" time elapsed: 00:00:00
+----------------------------------------------------------
+
+2/4 Testing: vector3_test
+2/4 Test: vector3_test
+Command: "/home/yasutomo/devel/moflib/src/mof/math/test/testbin/vector3_test"
+Directory: /home/yasutomo/devel/moflib/src/build_unix/mof/math
+"vector3_test" start time: Aug 17 13:29 PDT
+Output:
+----------------------------------------------------------
+<end of output>
+Test time = 0.00 sec
+----------------------------------------------------------
+Test Passed.
+"vector3_test" end time: Aug 17 13:29 PDT
+"vector3_test" time elapsed: 00:00:00
+----------------------------------------------------------
+
+3/4 Testing: matrix2_test
+3/4 Test: matrix2_test
+Command: "/home/yasutomo/devel/moflib/src/mof/math/test/testbin/matrix2_test"
+Directory: /home/yasutomo/devel/moflib/src/build_unix/mof/math
+"matrix2_test" start time: Aug 17 13:29 PDT
+Output:
+----------------------------------------------------------
+1
+
+1, 2, 3
+4, 5, 6
+7, 8, 1
+<end of output>
+Test time = 0.00 sec
+----------------------------------------------------------
+Test Passed.
+"matrix2_test" end time: Aug 17 13:29 PDT
+"matrix2_test" time elapsed: 00:00:00
+----------------------------------------------------------
+
+4/4 Testing: matrix3_test
+4/4 Test: matrix3_test
+Command: "/home/yasutomo/devel/moflib/src/mof/math/test/testbin/matrix3_test"
+Directory: /home/yasutomo/devel/moflib/src/build_unix/mof/math
+"matrix3_test" start time: Aug 17 13:29 PDT
+Output:
+----------------------------------------------------------
+
+1, 2, 3, 4
+5, 6, 7, 8
+9, 10, 11, 12
+13, 14, 15, 1
+<end of output>
+Test time = 0.00 sec
+----------------------------------------------------------
+Test Passed.
+"matrix3_test" end time: Aug 17 13:29 PDT
+"matrix3_test" time elapsed: 00:00:00
+----------------------------------------------------------
+
+End testing: Aug 17 13:29 PDT
--- /dev/null
+4:matrix3_test
/home/yasutomo/devel/moflib/src/../include/mof/base/tstring.hpp
/home/yasutomo/devel/moflib/src/../include/mof/util/multimedia_timer.hpp
/home/yasutomo/devel/moflib/src/../include/mof/util/foreach.hpp
+/home/yasutomo/devel/moflib/src/../include/mof/math/matrix3.hpp
+/home/yasutomo/devel/moflib/src/../include/mof/math/matrix.hpp
/home/yasutomo/devel/moflib/src/../include/mof/math/basic_vector.hpp
/home/yasutomo/devel/moflib/src/../include/mof/math/vector3.hpp
+/home/yasutomo/devel/moflib/src/../include/mof/math/basic_matrix.hpp
+/home/yasutomo/devel/moflib/src/../include/mof/math/matrix2.hpp
/home/yasutomo/devel/moflib/src/../include/mof/math/vector.hpp
/home/yasutomo/devel/moflib/src/../include/mof/math/vector2.hpp
--- /dev/null
+#IncludeRegexLine: ^[ ]*#[ ]*(include|import)[ ]*[<"]([^">]+)([">])
+
+#IncludeRegexScan: ^.*$
+
+#IncludeRegexComplain: ^$
+
+#IncludeRegexTransform:
+
+../mof/base/mofdef.hpp
+cstddef
+-
+mof/base/tstring.hpp
+-
+
+../mof/base/tstring.hpp
+string
+-
+tchar.h
+-
+
+../mof/math/basic_matrix.hpp
+mof/base/mofdef.hpp
+-
+boost/operators.hpp
+-
+ostream
+-
+
+../mof/math/matrix2.hpp
+mof/math/basic_matrix.hpp
+-
+
+/home/yasutomo/devel/moflib/src/mof/math/test/matrix2_test.cpp
+mof/math/matrix2.hpp
+-
+iostream
+-
+sstream
+-
+
--- /dev/null
+# The set of languages for which implicit dependencies are needed:
+SET(CMAKE_DEPENDS_LANGUAGES
+ "CXX"
+ )
+# The set of files for implicit dependencies of each language:
+SET(CMAKE_DEPENDS_CHECK_CXX
+ "/home/yasutomo/devel/moflib/src/mof/math/test/matrix2_test.cpp" "/home/yasutomo/devel/moflib/src/build_unix/mof/math/CMakeFiles/matrix2_test.dir/test/matrix2_test.cpp.o"
+ )
+SET(CMAKE_CXX_COMPILER_ID "GNU")
+
+# Targets to which this target links.
+SET(CMAKE_TARGET_LINKED_INFO_FILES
+ "/home/yasutomo/devel/moflib/src/build_unix/mof/math/CMakeFiles/mofmath.dir/DependInfo.cmake"
+ )
--- /dev/null
+# CMAKE generated file: DO NOT EDIT!
+# Generated by "Unix Makefiles" Generator, CMake Version 2.8
+
+#=============================================================================
+# Special targets provided by cmake.
+
+# Disable implicit rules so canoncical targets will work.
+.SUFFIXES:
+
+# Remove some rules from gmake that .SUFFIXES does not remove.
+SUFFIXES =
+
+.SUFFIXES: .hpux_make_needs_suffix_list
+
+# Suppress display of executed commands.
+$(VERBOSE).SILENT:
+
+# A target that is always out of date.
+cmake_force:
+.PHONY : cmake_force
+
+#=============================================================================
+# Set environment variables for the build.
+
+# The shell in which to execute make rules.
+SHELL = /bin/sh
+
+# The CMake executable.
+CMAKE_COMMAND = /usr/bin/cmake
+
+# The command to remove a file.
+RM = /usr/bin/cmake -E remove -f
+
+# The top-level source directory on which CMake was run.
+CMAKE_SOURCE_DIR = /home/yasutomo/devel/moflib/src
+
+# The top-level build directory on which CMake was run.
+CMAKE_BINARY_DIR = /home/yasutomo/devel/moflib/src/build_unix
+
+# Include any dependencies generated for this target.
+include mof/math/CMakeFiles/matrix2_test.dir/depend.make
+
+# Include the progress variables for this target.
+include mof/math/CMakeFiles/matrix2_test.dir/progress.make
+
+# Include the compile flags for this target's objects.
+include mof/math/CMakeFiles/matrix2_test.dir/flags.make
+
+mof/math/CMakeFiles/matrix2_test.dir/test/matrix2_test.cpp.o: mof/math/CMakeFiles/matrix2_test.dir/flags.make
+mof/math/CMakeFiles/matrix2_test.dir/test/matrix2_test.cpp.o: ../mof/math/test/matrix2_test.cpp
+ $(CMAKE_COMMAND) -E cmake_progress_report /home/yasutomo/devel/moflib/src/build_unix/CMakeFiles $(CMAKE_PROGRESS_1)
+ @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Building CXX object mof/math/CMakeFiles/matrix2_test.dir/test/matrix2_test.cpp.o"
+ cd /home/yasutomo/devel/moflib/src/build_unix/mof/math && /usr/bin/c++ $(CXX_DEFINES) $(CXX_FLAGS) -o CMakeFiles/matrix2_test.dir/test/matrix2_test.cpp.o -c /home/yasutomo/devel/moflib/src/mof/math/test/matrix2_test.cpp
+
+mof/math/CMakeFiles/matrix2_test.dir/test/matrix2_test.cpp.i: cmake_force
+ @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/matrix2_test.dir/test/matrix2_test.cpp.i"
+ cd /home/yasutomo/devel/moflib/src/build_unix/mof/math && /usr/bin/c++ $(CXX_DEFINES) $(CXX_FLAGS) -E /home/yasutomo/devel/moflib/src/mof/math/test/matrix2_test.cpp > CMakeFiles/matrix2_test.dir/test/matrix2_test.cpp.i
+
+mof/math/CMakeFiles/matrix2_test.dir/test/matrix2_test.cpp.s: cmake_force
+ @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/matrix2_test.dir/test/matrix2_test.cpp.s"
+ cd /home/yasutomo/devel/moflib/src/build_unix/mof/math && /usr/bin/c++ $(CXX_DEFINES) $(CXX_FLAGS) -S /home/yasutomo/devel/moflib/src/mof/math/test/matrix2_test.cpp -o CMakeFiles/matrix2_test.dir/test/matrix2_test.cpp.s
+
+mof/math/CMakeFiles/matrix2_test.dir/test/matrix2_test.cpp.o.requires:
+.PHONY : mof/math/CMakeFiles/matrix2_test.dir/test/matrix2_test.cpp.o.requires
+
+mof/math/CMakeFiles/matrix2_test.dir/test/matrix2_test.cpp.o.provides: mof/math/CMakeFiles/matrix2_test.dir/test/matrix2_test.cpp.o.requires
+ $(MAKE) -f mof/math/CMakeFiles/matrix2_test.dir/build.make mof/math/CMakeFiles/matrix2_test.dir/test/matrix2_test.cpp.o.provides.build
+.PHONY : mof/math/CMakeFiles/matrix2_test.dir/test/matrix2_test.cpp.o.provides
+
+mof/math/CMakeFiles/matrix2_test.dir/test/matrix2_test.cpp.o.provides.build: mof/math/CMakeFiles/matrix2_test.dir/test/matrix2_test.cpp.o
+.PHONY : mof/math/CMakeFiles/matrix2_test.dir/test/matrix2_test.cpp.o.provides.build
+
+# Object files for target matrix2_test
+matrix2_test_OBJECTS = \
+"CMakeFiles/matrix2_test.dir/test/matrix2_test.cpp.o"
+
+# External object files for target matrix2_test
+matrix2_test_EXTERNAL_OBJECTS =
+
+../mof/math/test/testbin/matrix2_test: mof/math/CMakeFiles/matrix2_test.dir/test/matrix2_test.cpp.o
+../mof/math/test/testbin/matrix2_test: /home/yasutomo/devel/moflib/lib/libmofmath.a
+../mof/math/test/testbin/matrix2_test: mof/math/CMakeFiles/matrix2_test.dir/build.make
+../mof/math/test/testbin/matrix2_test: mof/math/CMakeFiles/matrix2_test.dir/link.txt
+ @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --red --bold "Linking CXX executable ../../../mof/math/test/testbin/matrix2_test"
+ cd /home/yasutomo/devel/moflib/src/build_unix/mof/math && $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/matrix2_test.dir/link.txt --verbose=$(VERBOSE)
+
+# Rule to build all files generated by this target.
+mof/math/CMakeFiles/matrix2_test.dir/build: ../mof/math/test/testbin/matrix2_test
+.PHONY : mof/math/CMakeFiles/matrix2_test.dir/build
+
+mof/math/CMakeFiles/matrix2_test.dir/requires: mof/math/CMakeFiles/matrix2_test.dir/test/matrix2_test.cpp.o.requires
+.PHONY : mof/math/CMakeFiles/matrix2_test.dir/requires
+
+mof/math/CMakeFiles/matrix2_test.dir/clean:
+ cd /home/yasutomo/devel/moflib/src/build_unix/mof/math && $(CMAKE_COMMAND) -P CMakeFiles/matrix2_test.dir/cmake_clean.cmake
+.PHONY : mof/math/CMakeFiles/matrix2_test.dir/clean
+
+mof/math/CMakeFiles/matrix2_test.dir/depend:
+ cd /home/yasutomo/devel/moflib/src/build_unix && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /home/yasutomo/devel/moflib/src /home/yasutomo/devel/moflib/src/mof/math /home/yasutomo/devel/moflib/src/build_unix /home/yasutomo/devel/moflib/src/build_unix/mof/math /home/yasutomo/devel/moflib/src/build_unix/mof/math/CMakeFiles/matrix2_test.dir/DependInfo.cmake --color=$(COLOR)
+.PHONY : mof/math/CMakeFiles/matrix2_test.dir/depend
+
--- /dev/null
+FILE(REMOVE_RECURSE
+ "CMakeFiles/matrix2_test.dir/test/matrix2_test.cpp.o"
+ "../../../mof/math/test/testbin/matrix2_test.pdb"
+ "../../../mof/math/test/testbin/matrix2_test"
+)
+
+# Per-language clean rules from dependency scanning.
+FOREACH(lang CXX)
+ INCLUDE(CMakeFiles/matrix2_test.dir/cmake_clean_${lang}.cmake OPTIONAL)
+ENDFOREACH(lang)
--- /dev/null
+# CMAKE generated file: DO NOT EDIT!
+# Generated by "Unix Makefiles" Generator, CMake Version 2.8
+
+mof/math/CMakeFiles/matrix2_test.dir/test/matrix2_test.cpp.o
+ ../mof/base/mofdef.hpp
+ ../mof/base/tstring.hpp
+ ../mof/math/basic_matrix.hpp
+ ../mof/math/matrix2.hpp
+ /home/yasutomo/devel/moflib/src/mof/math/test/matrix2_test.cpp
--- /dev/null
+# CMAKE generated file: DO NOT EDIT!
+# Generated by "Unix Makefiles" Generator, CMake Version 2.8
+
+mof/math/CMakeFiles/matrix2_test.dir/test/matrix2_test.cpp.o: ../mof/base/mofdef.hpp
+mof/math/CMakeFiles/matrix2_test.dir/test/matrix2_test.cpp.o: ../mof/base/tstring.hpp
+mof/math/CMakeFiles/matrix2_test.dir/test/matrix2_test.cpp.o: ../mof/math/basic_matrix.hpp
+mof/math/CMakeFiles/matrix2_test.dir/test/matrix2_test.cpp.o: ../mof/math/matrix2.hpp
+mof/math/CMakeFiles/matrix2_test.dir/test/matrix2_test.cpp.o: ../mof/math/test/matrix2_test.cpp
+
--- /dev/null
+# CMAKE generated file: DO NOT EDIT!
+# Generated by "Unix Makefiles" Generator, CMake Version 2.8
+
+# compile CXX with /usr/bin/c++
+CXX_FLAGS = -Wall -Werror -g -DPSTSDK_VALIDATION_LEVEL_FULL -std=c++0x -I/home/yasutomo/devel/moflib/src -I/home/yasutomo/devel/moflib/src/mof/math/BOOST_INCLUDE_DIR
+
+CXX_DEFINES =
+
--- /dev/null
+/usr/bin/c++ -Wall -Werror -g -DPSTSDK_VALIDATION_LEVEL_FULL -std=c++0x CMakeFiles/matrix2_test.dir/test/matrix2_test.cpp.o -o ../../../mof/math/test/testbin/matrix2_test -rdynamic -L/home/yasutomo/devel/moflib/src/../lib /home/yasutomo/devel/moflib/lib/libmofmath.a -Wl,-rpath,/home/yasutomo/devel/moflib/src/../lib
--- /dev/null
+CMAKE_PROGRESS_1 = 1
+
--- /dev/null
+#IncludeRegexLine: ^[ ]*#[ ]*(include|import)[ ]*[<"]([^">]+)([">])
+
+#IncludeRegexScan: ^.*$
+
+#IncludeRegexComplain: ^$
+
+#IncludeRegexTransform:
+
+../mof/base/mofdef.hpp
+cstddef
+-
+mof/base/tstring.hpp
+-
+
+../mof/base/tstring.hpp
+string
+-
+tchar.h
+-
+
+../mof/math/basic_matrix.hpp
+mof/base/mofdef.hpp
+-
+boost/operators.hpp
+-
+ostream
+-
+
+../mof/math/matrix3.hpp
+mof/math/basic_matrix.hpp
+-
+
+/home/yasutomo/devel/moflib/src/mof/math/test/matrix3_test.cpp
+mof/math/matrix3.hpp
+-
+iostream
+-
+sstream
+-
+
--- /dev/null
+# The set of languages for which implicit dependencies are needed:
+SET(CMAKE_DEPENDS_LANGUAGES
+ "CXX"
+ )
+# The set of files for implicit dependencies of each language:
+SET(CMAKE_DEPENDS_CHECK_CXX
+ "/home/yasutomo/devel/moflib/src/mof/math/test/matrix3_test.cpp" "/home/yasutomo/devel/moflib/src/build_unix/mof/math/CMakeFiles/matrix3_test.dir/test/matrix3_test.cpp.o"
+ )
+SET(CMAKE_CXX_COMPILER_ID "GNU")
+
+# Targets to which this target links.
+SET(CMAKE_TARGET_LINKED_INFO_FILES
+ "/home/yasutomo/devel/moflib/src/build_unix/mof/math/CMakeFiles/mofmath.dir/DependInfo.cmake"
+ )
--- /dev/null
+# CMAKE generated file: DO NOT EDIT!
+# Generated by "Unix Makefiles" Generator, CMake Version 2.8
+
+#=============================================================================
+# Special targets provided by cmake.
+
+# Disable implicit rules so canoncical targets will work.
+.SUFFIXES:
+
+# Remove some rules from gmake that .SUFFIXES does not remove.
+SUFFIXES =
+
+.SUFFIXES: .hpux_make_needs_suffix_list
+
+# Suppress display of executed commands.
+$(VERBOSE).SILENT:
+
+# A target that is always out of date.
+cmake_force:
+.PHONY : cmake_force
+
+#=============================================================================
+# Set environment variables for the build.
+
+# The shell in which to execute make rules.
+SHELL = /bin/sh
+
+# The CMake executable.
+CMAKE_COMMAND = /usr/bin/cmake
+
+# The command to remove a file.
+RM = /usr/bin/cmake -E remove -f
+
+# The top-level source directory on which CMake was run.
+CMAKE_SOURCE_DIR = /home/yasutomo/devel/moflib/src
+
+# The top-level build directory on which CMake was run.
+CMAKE_BINARY_DIR = /home/yasutomo/devel/moflib/src/build_unix
+
+# Include any dependencies generated for this target.
+include mof/math/CMakeFiles/matrix3_test.dir/depend.make
+
+# Include the progress variables for this target.
+include mof/math/CMakeFiles/matrix3_test.dir/progress.make
+
+# Include the compile flags for this target's objects.
+include mof/math/CMakeFiles/matrix3_test.dir/flags.make
+
+mof/math/CMakeFiles/matrix3_test.dir/test/matrix3_test.cpp.o: mof/math/CMakeFiles/matrix3_test.dir/flags.make
+mof/math/CMakeFiles/matrix3_test.dir/test/matrix3_test.cpp.o: ../mof/math/test/matrix3_test.cpp
+ $(CMAKE_COMMAND) -E cmake_progress_report /home/yasutomo/devel/moflib/src/build_unix/CMakeFiles $(CMAKE_PROGRESS_1)
+ @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Building CXX object mof/math/CMakeFiles/matrix3_test.dir/test/matrix3_test.cpp.o"
+ cd /home/yasutomo/devel/moflib/src/build_unix/mof/math && /usr/bin/c++ $(CXX_DEFINES) $(CXX_FLAGS) -o CMakeFiles/matrix3_test.dir/test/matrix3_test.cpp.o -c /home/yasutomo/devel/moflib/src/mof/math/test/matrix3_test.cpp
+
+mof/math/CMakeFiles/matrix3_test.dir/test/matrix3_test.cpp.i: cmake_force
+ @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/matrix3_test.dir/test/matrix3_test.cpp.i"
+ cd /home/yasutomo/devel/moflib/src/build_unix/mof/math && /usr/bin/c++ $(CXX_DEFINES) $(CXX_FLAGS) -E /home/yasutomo/devel/moflib/src/mof/math/test/matrix3_test.cpp > CMakeFiles/matrix3_test.dir/test/matrix3_test.cpp.i
+
+mof/math/CMakeFiles/matrix3_test.dir/test/matrix3_test.cpp.s: cmake_force
+ @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/matrix3_test.dir/test/matrix3_test.cpp.s"
+ cd /home/yasutomo/devel/moflib/src/build_unix/mof/math && /usr/bin/c++ $(CXX_DEFINES) $(CXX_FLAGS) -S /home/yasutomo/devel/moflib/src/mof/math/test/matrix3_test.cpp -o CMakeFiles/matrix3_test.dir/test/matrix3_test.cpp.s
+
+mof/math/CMakeFiles/matrix3_test.dir/test/matrix3_test.cpp.o.requires:
+.PHONY : mof/math/CMakeFiles/matrix3_test.dir/test/matrix3_test.cpp.o.requires
+
+mof/math/CMakeFiles/matrix3_test.dir/test/matrix3_test.cpp.o.provides: mof/math/CMakeFiles/matrix3_test.dir/test/matrix3_test.cpp.o.requires
+ $(MAKE) -f mof/math/CMakeFiles/matrix3_test.dir/build.make mof/math/CMakeFiles/matrix3_test.dir/test/matrix3_test.cpp.o.provides.build
+.PHONY : mof/math/CMakeFiles/matrix3_test.dir/test/matrix3_test.cpp.o.provides
+
+mof/math/CMakeFiles/matrix3_test.dir/test/matrix3_test.cpp.o.provides.build: mof/math/CMakeFiles/matrix3_test.dir/test/matrix3_test.cpp.o
+.PHONY : mof/math/CMakeFiles/matrix3_test.dir/test/matrix3_test.cpp.o.provides.build
+
+# Object files for target matrix3_test
+matrix3_test_OBJECTS = \
+"CMakeFiles/matrix3_test.dir/test/matrix3_test.cpp.o"
+
+# External object files for target matrix3_test
+matrix3_test_EXTERNAL_OBJECTS =
+
+../mof/math/test/testbin/matrix3_test: mof/math/CMakeFiles/matrix3_test.dir/test/matrix3_test.cpp.o
+../mof/math/test/testbin/matrix3_test: /home/yasutomo/devel/moflib/lib/libmofmath.a
+../mof/math/test/testbin/matrix3_test: mof/math/CMakeFiles/matrix3_test.dir/build.make
+../mof/math/test/testbin/matrix3_test: mof/math/CMakeFiles/matrix3_test.dir/link.txt
+ @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --red --bold "Linking CXX executable ../../../mof/math/test/testbin/matrix3_test"
+ cd /home/yasutomo/devel/moflib/src/build_unix/mof/math && $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/matrix3_test.dir/link.txt --verbose=$(VERBOSE)
+
+# Rule to build all files generated by this target.
+mof/math/CMakeFiles/matrix3_test.dir/build: ../mof/math/test/testbin/matrix3_test
+.PHONY : mof/math/CMakeFiles/matrix3_test.dir/build
+
+mof/math/CMakeFiles/matrix3_test.dir/requires: mof/math/CMakeFiles/matrix3_test.dir/test/matrix3_test.cpp.o.requires
+.PHONY : mof/math/CMakeFiles/matrix3_test.dir/requires
+
+mof/math/CMakeFiles/matrix3_test.dir/clean:
+ cd /home/yasutomo/devel/moflib/src/build_unix/mof/math && $(CMAKE_COMMAND) -P CMakeFiles/matrix3_test.dir/cmake_clean.cmake
+.PHONY : mof/math/CMakeFiles/matrix3_test.dir/clean
+
+mof/math/CMakeFiles/matrix3_test.dir/depend:
+ cd /home/yasutomo/devel/moflib/src/build_unix && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /home/yasutomo/devel/moflib/src /home/yasutomo/devel/moflib/src/mof/math /home/yasutomo/devel/moflib/src/build_unix /home/yasutomo/devel/moflib/src/build_unix/mof/math /home/yasutomo/devel/moflib/src/build_unix/mof/math/CMakeFiles/matrix3_test.dir/DependInfo.cmake --color=$(COLOR)
+.PHONY : mof/math/CMakeFiles/matrix3_test.dir/depend
+
--- /dev/null
+FILE(REMOVE_RECURSE
+ "CMakeFiles/matrix3_test.dir/test/matrix3_test.cpp.o"
+ "../../../mof/math/test/testbin/matrix3_test.pdb"
+ "../../../mof/math/test/testbin/matrix3_test"
+)
+
+# Per-language clean rules from dependency scanning.
+FOREACH(lang CXX)
+ INCLUDE(CMakeFiles/matrix3_test.dir/cmake_clean_${lang}.cmake OPTIONAL)
+ENDFOREACH(lang)
--- /dev/null
+# CMAKE generated file: DO NOT EDIT!
+# Generated by "Unix Makefiles" Generator, CMake Version 2.8
+
+mof/math/CMakeFiles/matrix3_test.dir/test/matrix3_test.cpp.o
+ ../mof/base/mofdef.hpp
+ ../mof/base/tstring.hpp
+ ../mof/math/basic_matrix.hpp
+ ../mof/math/matrix3.hpp
+ /home/yasutomo/devel/moflib/src/mof/math/test/matrix3_test.cpp
--- /dev/null
+# CMAKE generated file: DO NOT EDIT!
+# Generated by "Unix Makefiles" Generator, CMake Version 2.8
+
+mof/math/CMakeFiles/matrix3_test.dir/test/matrix3_test.cpp.o: ../mof/base/mofdef.hpp
+mof/math/CMakeFiles/matrix3_test.dir/test/matrix3_test.cpp.o: ../mof/base/tstring.hpp
+mof/math/CMakeFiles/matrix3_test.dir/test/matrix3_test.cpp.o: ../mof/math/basic_matrix.hpp
+mof/math/CMakeFiles/matrix3_test.dir/test/matrix3_test.cpp.o: ../mof/math/matrix3.hpp
+mof/math/CMakeFiles/matrix3_test.dir/test/matrix3_test.cpp.o: ../mof/math/test/matrix3_test.cpp
+
--- /dev/null
+# CMAKE generated file: DO NOT EDIT!
+# Generated by "Unix Makefiles" Generator, CMake Version 2.8
+
+# compile CXX with /usr/bin/c++
+CXX_FLAGS = -Wall -Werror -g -DPSTSDK_VALIDATION_LEVEL_FULL -std=c++0x -I/home/yasutomo/devel/moflib/src -I/home/yasutomo/devel/moflib/src/mof/math/BOOST_INCLUDE_DIR
+
+CXX_DEFINES =
+
--- /dev/null
+/usr/bin/c++ -Wall -Werror -g -DPSTSDK_VALIDATION_LEVEL_FULL -std=c++0x CMakeFiles/matrix3_test.dir/test/matrix3_test.cpp.o -o ../../../mof/math/test/testbin/matrix3_test -rdynamic -L/home/yasutomo/devel/moflib/src/../lib /home/yasutomo/devel/moflib/lib/libmofmath.a -Wl,-rpath,/home/yasutomo/devel/moflib/src/../lib
--- /dev/null
+CMAKE_PROGRESS_1 = 2
+
-CMAKE_PROGRESS_1 = 1
+CMAKE_PROGRESS_1 = 3
-CMAKE_PROGRESS_1 = 3
+CMAKE_PROGRESS_1 = 5
-CMAKE_PROGRESS_1 = 4
+CMAKE_PROGRESS_1 = 6
# testing this directory and lists subdirectories to be tested as well.
ADD_TEST(vector2_test "/home/yasutomo/devel/moflib/src/mof/math/test/testbin/vector2_test")
ADD_TEST(vector3_test "/home/yasutomo/devel/moflib/src/mof/math/test/testbin/vector3_test")
+ADD_TEST(matrix2_test "/home/yasutomo/devel/moflib/src/mof/math/test/testbin/matrix2_test")
+ADD_TEST(matrix3_test "/home/yasutomo/devel/moflib/src/mof/math/test/testbin/matrix3_test")
.PHONY : depend
# Convenience name for target.
+mof/math/CMakeFiles/matrix2_test.dir/rule:
+ cd /home/yasutomo/devel/moflib/src/build_unix && $(MAKE) -f CMakeFiles/Makefile2 mof/math/CMakeFiles/matrix2_test.dir/rule
+.PHONY : mof/math/CMakeFiles/matrix2_test.dir/rule
+
+# Convenience name for target.
+matrix2_test: mof/math/CMakeFiles/matrix2_test.dir/rule
+.PHONY : matrix2_test
+
+# fast build rule for target.
+matrix2_test/fast:
+ cd /home/yasutomo/devel/moflib/src/build_unix && $(MAKE) -f mof/math/CMakeFiles/matrix2_test.dir/build.make mof/math/CMakeFiles/matrix2_test.dir/build
+.PHONY : matrix2_test/fast
+
+# Convenience name for target.
+mof/math/CMakeFiles/matrix3_test.dir/rule:
+ cd /home/yasutomo/devel/moflib/src/build_unix && $(MAKE) -f CMakeFiles/Makefile2 mof/math/CMakeFiles/matrix3_test.dir/rule
+.PHONY : mof/math/CMakeFiles/matrix3_test.dir/rule
+
+# Convenience name for target.
+matrix3_test: mof/math/CMakeFiles/matrix3_test.dir/rule
+.PHONY : matrix3_test
+
+# fast build rule for target.
+matrix3_test/fast:
+ cd /home/yasutomo/devel/moflib/src/build_unix && $(MAKE) -f mof/math/CMakeFiles/matrix3_test.dir/build.make mof/math/CMakeFiles/matrix3_test.dir/build
+.PHONY : matrix3_test/fast
+
+# Convenience name for target.
mof/math/CMakeFiles/mofmath.dir/rule:
cd /home/yasutomo/devel/moflib/src/build_unix && $(MAKE) -f CMakeFiles/Makefile2 mof/math/CMakeFiles/mofmath.dir/rule
.PHONY : mof/math/CMakeFiles/mofmath.dir/rule
cd /home/yasutomo/devel/moflib/src/build_unix && $(MAKE) -f mof/math/CMakeFiles/mofmath.dir/build.make mof/math/CMakeFiles/mofmath.dir/dummy.cpp.s
.PHONY : dummy.cpp.s
+test/matrix2_test.o: test/matrix2_test.cpp.o
+.PHONY : test/matrix2_test.o
+
+# target to build an object file
+test/matrix2_test.cpp.o:
+ cd /home/yasutomo/devel/moflib/src/build_unix && $(MAKE) -f mof/math/CMakeFiles/matrix2_test.dir/build.make mof/math/CMakeFiles/matrix2_test.dir/test/matrix2_test.cpp.o
+.PHONY : test/matrix2_test.cpp.o
+
+test/matrix2_test.i: test/matrix2_test.cpp.i
+.PHONY : test/matrix2_test.i
+
+# target to preprocess a source file
+test/matrix2_test.cpp.i:
+ cd /home/yasutomo/devel/moflib/src/build_unix && $(MAKE) -f mof/math/CMakeFiles/matrix2_test.dir/build.make mof/math/CMakeFiles/matrix2_test.dir/test/matrix2_test.cpp.i
+.PHONY : test/matrix2_test.cpp.i
+
+test/matrix2_test.s: test/matrix2_test.cpp.s
+.PHONY : test/matrix2_test.s
+
+# target to generate assembly for a file
+test/matrix2_test.cpp.s:
+ cd /home/yasutomo/devel/moflib/src/build_unix && $(MAKE) -f mof/math/CMakeFiles/matrix2_test.dir/build.make mof/math/CMakeFiles/matrix2_test.dir/test/matrix2_test.cpp.s
+.PHONY : test/matrix2_test.cpp.s
+
+test/matrix3_test.o: test/matrix3_test.cpp.o
+.PHONY : test/matrix3_test.o
+
+# target to build an object file
+test/matrix3_test.cpp.o:
+ cd /home/yasutomo/devel/moflib/src/build_unix && $(MAKE) -f mof/math/CMakeFiles/matrix3_test.dir/build.make mof/math/CMakeFiles/matrix3_test.dir/test/matrix3_test.cpp.o
+.PHONY : test/matrix3_test.cpp.o
+
+test/matrix3_test.i: test/matrix3_test.cpp.i
+.PHONY : test/matrix3_test.i
+
+# target to preprocess a source file
+test/matrix3_test.cpp.i:
+ cd /home/yasutomo/devel/moflib/src/build_unix && $(MAKE) -f mof/math/CMakeFiles/matrix3_test.dir/build.make mof/math/CMakeFiles/matrix3_test.dir/test/matrix3_test.cpp.i
+.PHONY : test/matrix3_test.cpp.i
+
+test/matrix3_test.s: test/matrix3_test.cpp.s
+.PHONY : test/matrix3_test.s
+
+# target to generate assembly for a file
+test/matrix3_test.cpp.s:
+ cd /home/yasutomo/devel/moflib/src/build_unix && $(MAKE) -f mof/math/CMakeFiles/matrix3_test.dir/build.make mof/math/CMakeFiles/matrix3_test.dir/test/matrix3_test.cpp.s
+.PHONY : test/matrix3_test.cpp.s
+
test/vector2_test.o: test/vector2_test.cpp.o
.PHONY : test/vector2_test.o
@echo "... install/local"
@echo "... install/strip"
@echo "... list_install_components"
+ @echo "... matrix2_test"
+ @echo "... matrix3_test"
@echo "... mofmath"
@echo "... rebuild_cache"
@echo "... test"
@echo "... dummy.o"
@echo "... dummy.i"
@echo "... dummy.s"
+ @echo "... test/matrix2_test.o"
+ @echo "... test/matrix2_test.i"
+ @echo "... test/matrix2_test.s"
+ @echo "... test/matrix3_test.o"
+ @echo "... test/matrix3_test.i"
+ @echo "... test/matrix3_test.s"
@echo "... test/vector2_test.o"
@echo "... test/vector2_test.i"
@echo "... test/vector2_test.s"
IF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
FILE(INSTALL DESTINATION "/home/yasutomo/devel/moflib/src/../include/mof/math" TYPE FILE FILES
+ "/home/yasutomo/devel/moflib/src/mof/math/matrix3.hpp"
+ "/home/yasutomo/devel/moflib/src/mof/math/matrix.hpp"
"/home/yasutomo/devel/moflib/src/mof/math/basic_vector.hpp"
"/home/yasutomo/devel/moflib/src/mof/math/vector3.hpp"
+ "/home/yasutomo/devel/moflib/src/mof/math/basic_matrix.hpp"
+ "/home/yasutomo/devel/moflib/src/mof/math/matrix2.hpp"
"/home/yasutomo/devel/moflib/src/mof/math/vector.hpp"
"/home/yasutomo/devel/moflib/src/mof/math/vector2.hpp"
)
boost/utility.hpp
-
-/home/yasutomo/devel/moflib/src/mof/util/multimedia_timer.cpp
+/home/yasutomo/devel/moflib/src/mof/util/linux/multimedia_timer.cpp
mof/util/multimedia_timer.hpp
-
ctime
)
# The set of files for implicit dependencies of each language:
SET(CMAKE_DEPENDS_CHECK_CXX
- "/home/yasutomo/devel/moflib/src/mof/util/multimedia_timer.cpp" "/home/yasutomo/devel/moflib/src/build_unix/mof/util/CMakeFiles/mofutil.dir/multimedia_timer.cpp.o"
+ "/home/yasutomo/devel/moflib/src/mof/util/linux/multimedia_timer.cpp" "/home/yasutomo/devel/moflib/src/build_unix/mof/util/CMakeFiles/mofutil.dir/linux/multimedia_timer.cpp.o"
)
SET(CMAKE_CXX_COMPILER_ID "GNU")
# Include the compile flags for this target's objects.
include mof/util/CMakeFiles/mofutil.dir/flags.make
-mof/util/CMakeFiles/mofutil.dir/multimedia_timer.cpp.o: mof/util/CMakeFiles/mofutil.dir/flags.make
-mof/util/CMakeFiles/mofutil.dir/multimedia_timer.cpp.o: ../mof/util/multimedia_timer.cpp
+mof/util/CMakeFiles/mofutil.dir/linux/multimedia_timer.cpp.o: mof/util/CMakeFiles/mofutil.dir/flags.make
+mof/util/CMakeFiles/mofutil.dir/linux/multimedia_timer.cpp.o: ../mof/util/linux/multimedia_timer.cpp
$(CMAKE_COMMAND) -E cmake_progress_report /home/yasutomo/devel/moflib/src/build_unix/CMakeFiles $(CMAKE_PROGRESS_1)
- @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Building CXX object mof/util/CMakeFiles/mofutil.dir/multimedia_timer.cpp.o"
- cd /home/yasutomo/devel/moflib/src/build_unix/mof/util && /usr/bin/c++ $(CXX_DEFINES) $(CXX_FLAGS) -o CMakeFiles/mofutil.dir/multimedia_timer.cpp.o -c /home/yasutomo/devel/moflib/src/mof/util/multimedia_timer.cpp
+ @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Building CXX object mof/util/CMakeFiles/mofutil.dir/linux/multimedia_timer.cpp.o"
+ cd /home/yasutomo/devel/moflib/src/build_unix/mof/util && /usr/bin/c++ $(CXX_DEFINES) $(CXX_FLAGS) -o CMakeFiles/mofutil.dir/linux/multimedia_timer.cpp.o -c /home/yasutomo/devel/moflib/src/mof/util/linux/multimedia_timer.cpp
-mof/util/CMakeFiles/mofutil.dir/multimedia_timer.cpp.i: cmake_force
- @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/mofutil.dir/multimedia_timer.cpp.i"
- cd /home/yasutomo/devel/moflib/src/build_unix/mof/util && /usr/bin/c++ $(CXX_DEFINES) $(CXX_FLAGS) -E /home/yasutomo/devel/moflib/src/mof/util/multimedia_timer.cpp > CMakeFiles/mofutil.dir/multimedia_timer.cpp.i
+mof/util/CMakeFiles/mofutil.dir/linux/multimedia_timer.cpp.i: cmake_force
+ @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/mofutil.dir/linux/multimedia_timer.cpp.i"
+ cd /home/yasutomo/devel/moflib/src/build_unix/mof/util && /usr/bin/c++ $(CXX_DEFINES) $(CXX_FLAGS) -E /home/yasutomo/devel/moflib/src/mof/util/linux/multimedia_timer.cpp > CMakeFiles/mofutil.dir/linux/multimedia_timer.cpp.i
-mof/util/CMakeFiles/mofutil.dir/multimedia_timer.cpp.s: cmake_force
- @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/mofutil.dir/multimedia_timer.cpp.s"
- cd /home/yasutomo/devel/moflib/src/build_unix/mof/util && /usr/bin/c++ $(CXX_DEFINES) $(CXX_FLAGS) -S /home/yasutomo/devel/moflib/src/mof/util/multimedia_timer.cpp -o CMakeFiles/mofutil.dir/multimedia_timer.cpp.s
+mof/util/CMakeFiles/mofutil.dir/linux/multimedia_timer.cpp.s: cmake_force
+ @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/mofutil.dir/linux/multimedia_timer.cpp.s"
+ cd /home/yasutomo/devel/moflib/src/build_unix/mof/util && /usr/bin/c++ $(CXX_DEFINES) $(CXX_FLAGS) -S /home/yasutomo/devel/moflib/src/mof/util/linux/multimedia_timer.cpp -o CMakeFiles/mofutil.dir/linux/multimedia_timer.cpp.s
-mof/util/CMakeFiles/mofutil.dir/multimedia_timer.cpp.o.requires:
-.PHONY : mof/util/CMakeFiles/mofutil.dir/multimedia_timer.cpp.o.requires
+mof/util/CMakeFiles/mofutil.dir/linux/multimedia_timer.cpp.o.requires:
+.PHONY : mof/util/CMakeFiles/mofutil.dir/linux/multimedia_timer.cpp.o.requires
-mof/util/CMakeFiles/mofutil.dir/multimedia_timer.cpp.o.provides: mof/util/CMakeFiles/mofutil.dir/multimedia_timer.cpp.o.requires
- $(MAKE) -f mof/util/CMakeFiles/mofutil.dir/build.make mof/util/CMakeFiles/mofutil.dir/multimedia_timer.cpp.o.provides.build
-.PHONY : mof/util/CMakeFiles/mofutil.dir/multimedia_timer.cpp.o.provides
+mof/util/CMakeFiles/mofutil.dir/linux/multimedia_timer.cpp.o.provides: mof/util/CMakeFiles/mofutil.dir/linux/multimedia_timer.cpp.o.requires
+ $(MAKE) -f mof/util/CMakeFiles/mofutil.dir/build.make mof/util/CMakeFiles/mofutil.dir/linux/multimedia_timer.cpp.o.provides.build
+.PHONY : mof/util/CMakeFiles/mofutil.dir/linux/multimedia_timer.cpp.o.provides
-mof/util/CMakeFiles/mofutil.dir/multimedia_timer.cpp.o.provides.build: mof/util/CMakeFiles/mofutil.dir/multimedia_timer.cpp.o
-.PHONY : mof/util/CMakeFiles/mofutil.dir/multimedia_timer.cpp.o.provides.build
+mof/util/CMakeFiles/mofutil.dir/linux/multimedia_timer.cpp.o.provides.build: mof/util/CMakeFiles/mofutil.dir/linux/multimedia_timer.cpp.o
+.PHONY : mof/util/CMakeFiles/mofutil.dir/linux/multimedia_timer.cpp.o.provides.build
# Object files for target mofutil
mofutil_OBJECTS = \
-"CMakeFiles/mofutil.dir/multimedia_timer.cpp.o"
+"CMakeFiles/mofutil.dir/linux/multimedia_timer.cpp.o"
# External object files for target mofutil
mofutil_EXTERNAL_OBJECTS =
-/home/yasutomo/devel/moflib/lib/libmofutil.a: mof/util/CMakeFiles/mofutil.dir/multimedia_timer.cpp.o
+/home/yasutomo/devel/moflib/lib/libmofutil.a: mof/util/CMakeFiles/mofutil.dir/linux/multimedia_timer.cpp.o
/home/yasutomo/devel/moflib/lib/libmofutil.a: mof/util/CMakeFiles/mofutil.dir/build.make
/home/yasutomo/devel/moflib/lib/libmofutil.a: mof/util/CMakeFiles/mofutil.dir/link.txt
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --red --bold "Linking CXX static library /home/yasutomo/devel/moflib/lib/libmofutil.a"
mof/util/CMakeFiles/mofutil.dir/build: /home/yasutomo/devel/moflib/lib/libmofutil.a
.PHONY : mof/util/CMakeFiles/mofutil.dir/build
-mof/util/CMakeFiles/mofutil.dir/requires: mof/util/CMakeFiles/mofutil.dir/multimedia_timer.cpp.o.requires
+mof/util/CMakeFiles/mofutil.dir/requires: mof/util/CMakeFiles/mofutil.dir/linux/multimedia_timer.cpp.o.requires
.PHONY : mof/util/CMakeFiles/mofutil.dir/requires
mof/util/CMakeFiles/mofutil.dir/clean:
FILE(REMOVE_RECURSE
- "CMakeFiles/mofutil.dir/multimedia_timer.cpp.o"
+ "CMakeFiles/mofutil.dir/linux/multimedia_timer.cpp.o"
"/home/yasutomo/devel/moflib/lib/libmofutil.pdb"
"/home/yasutomo/devel/moflib/lib/libmofutil.a"
)
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 2.8
-mof/util/CMakeFiles/mofutil.dir/multimedia_timer.cpp.o
+mof/util/CMakeFiles/mofutil.dir/linux/multimedia_timer.cpp.o
../mof/util/multimedia_timer.hpp
- /home/yasutomo/devel/moflib/src/mof/util/multimedia_timer.cpp
+ /home/yasutomo/devel/moflib/src/mof/util/linux/multimedia_timer.cpp
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 2.8
-mof/util/CMakeFiles/mofutil.dir/multimedia_timer.cpp.o: ../mof/util/multimedia_timer.hpp
-mof/util/CMakeFiles/mofutil.dir/multimedia_timer.cpp.o: ../mof/util/multimedia_timer.cpp
+mof/util/CMakeFiles/mofutil.dir/linux/multimedia_timer.cpp.o: ../mof/util/multimedia_timer.hpp
+mof/util/CMakeFiles/mofutil.dir/linux/multimedia_timer.cpp.o: ../mof/util/linux/multimedia_timer.cpp
-/usr/bin/ar cr /home/yasutomo/devel/moflib/lib/libmofutil.a CMakeFiles/mofutil.dir/multimedia_timer.cpp.o
+/usr/bin/ar cr /home/yasutomo/devel/moflib/lib/libmofutil.a CMakeFiles/mofutil.dir/linux/multimedia_timer.cpp.o
/usr/bin/ranlib /home/yasutomo/devel/moflib/lib/libmofutil.a
-CMAKE_PROGRESS_1 = 2
+CMAKE_PROGRESS_1 = 4
cd /home/yasutomo/devel/moflib/src/build_unix && $(MAKE) -f mof/util/CMakeFiles/mofutil.dir/build.make mof/util/CMakeFiles/mofutil.dir/build
.PHONY : mofutil/fast
-multimedia_timer.o: multimedia_timer.cpp.o
-.PHONY : multimedia_timer.o
+linux/multimedia_timer.o: linux/multimedia_timer.cpp.o
+.PHONY : linux/multimedia_timer.o
# target to build an object file
-multimedia_timer.cpp.o:
- cd /home/yasutomo/devel/moflib/src/build_unix && $(MAKE) -f mof/util/CMakeFiles/mofutil.dir/build.make mof/util/CMakeFiles/mofutil.dir/multimedia_timer.cpp.o
-.PHONY : multimedia_timer.cpp.o
+linux/multimedia_timer.cpp.o:
+ cd /home/yasutomo/devel/moflib/src/build_unix && $(MAKE) -f mof/util/CMakeFiles/mofutil.dir/build.make mof/util/CMakeFiles/mofutil.dir/linux/multimedia_timer.cpp.o
+.PHONY : linux/multimedia_timer.cpp.o
-multimedia_timer.i: multimedia_timer.cpp.i
-.PHONY : multimedia_timer.i
+linux/multimedia_timer.i: linux/multimedia_timer.cpp.i
+.PHONY : linux/multimedia_timer.i
# target to preprocess a source file
-multimedia_timer.cpp.i:
- cd /home/yasutomo/devel/moflib/src/build_unix && $(MAKE) -f mof/util/CMakeFiles/mofutil.dir/build.make mof/util/CMakeFiles/mofutil.dir/multimedia_timer.cpp.i
-.PHONY : multimedia_timer.cpp.i
+linux/multimedia_timer.cpp.i:
+ cd /home/yasutomo/devel/moflib/src/build_unix && $(MAKE) -f mof/util/CMakeFiles/mofutil.dir/build.make mof/util/CMakeFiles/mofutil.dir/linux/multimedia_timer.cpp.i
+.PHONY : linux/multimedia_timer.cpp.i
-multimedia_timer.s: multimedia_timer.cpp.s
-.PHONY : multimedia_timer.s
+linux/multimedia_timer.s: linux/multimedia_timer.cpp.s
+.PHONY : linux/multimedia_timer.s
# target to generate assembly for a file
-multimedia_timer.cpp.s:
- cd /home/yasutomo/devel/moflib/src/build_unix && $(MAKE) -f mof/util/CMakeFiles/mofutil.dir/build.make mof/util/CMakeFiles/mofutil.dir/multimedia_timer.cpp.s
-.PHONY : multimedia_timer.cpp.s
+linux/multimedia_timer.cpp.s:
+ cd /home/yasutomo/devel/moflib/src/build_unix && $(MAKE) -f mof/util/CMakeFiles/mofutil.dir/build.make mof/util/CMakeFiles/mofutil.dir/linux/multimedia_timer.cpp.s
+.PHONY : linux/multimedia_timer.cpp.s
# Help Target
help:
@echo "... mofutil"
@echo "... rebuild_cache"
@echo "... test"
- @echo "... multimedia_timer.o"
- @echo "... multimedia_timer.i"
- @echo "... multimedia_timer.s"
+ @echo "... linux/multimedia_timer.o"
+ @echo "... linux/multimedia_timer.i"
+ @echo "... linux/multimedia_timer.s"
.PHONY : help
find_package(Boost)
include_directories(BOOST_INCLUDE_DIR)
+# test
+set(tests vector2_test vector3_test matrix2_test matrix3_test)
+
# build test
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/test/testbin/)
-add_executable(vector2_test test/vector2_test.cpp)
-add_executable(vector3_test test/vector3_test.cpp)
-target_link_libraries(vector2_test "mofmath")
-target_link_libraries(vector3_test "mofmath")
+foreach(test ${tests})
+ add_executable(${test} test/${test}.cpp)
+ target_link_libraries(${test} "mofmath")
+endforeach(test)
# run test
-add_test(vector2_test ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/vector2_test)
-add_test(vector3_test ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/vector3_test)
+foreach(test ${tests})
+ add_test(${test} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${test})
+endforeach(test)
# header install
set(INCLUDE_DIR ${MOFLIB_ROOT_DIR}/include/)
--- /dev/null
+#pragma once
+#include <mof/base/mofdef.hpp>
+#include <boost/operators.hpp>
+#include <ostream>
+
+namespace mof
+{
+namespace math
+{
+
+ template <size_t Dim> struct row_of_matrix;
+
+ /**
+ * @brief 同次座標変換行列テンプレートクラス
+ * @note このテンプレートから直接特殊化することは想定していない.
+ * あくまでmatrixxを実装するための補助テンプレートである.
+ * このクラスは不変クラスである.
+ * @tparam Dim 行列の次元(要素数はこの数値の2乗)
+ * @tparam Derived 特殊化されたテンプレートの派生クラス(matrixx)の型
+ * @tparam Coordinate 対応するベクトルクラス(vectorx)の型
+ */
+ template <size_t Dim, typename Derived, typename Coordinate>
+ class basic_matrix
+ : boost::addable< Derived
+ , boost::addable2< Derived, float
+ , boost::subtractable< Derived
+ , boost::subtractable2< Derived, float
+ , boost::multipliable< Derived
+ , boost::multipliable2< Derived, float
+ , boost::equality_comparable< Derived
+ > > > > > > >
+ {
+ protected:
+//{{{ last_index
+ /**
+ * @brief elements_の最後の添字を得る
+ */
+ size_t last_index() const
+ {
+ return (Dim + 1) * (Dim + 1);
+ }
+//}}}
+ float elements_[(Dim + 1) * (Dim + 1)];///< 要素の配列
+ public:
+//{{{ array
+/*
+ struct array
+ {
+ float arr_[(Dim + 1) * (Dim + 1) - 1];
+
+ float& operator[](size_t index)
+ {
+ return arr_[index];
+ }
+
+ };
+*/
+//}}}
+ // コンストラクタ,デストラクタはデフォルトのものを使う
+ // 代入演算子,コピーコンストラクタはデフォルトのものを使う
+//{{{ operator +=
+ Derived& operator+=(const Derived& rhs)
+ {
+ const size_t END = last_index() - 1;// 最後の要素は1で保存
+ for (size_t i = 0; i < END; ++i) {
+ elements_[i] += rhs.elements_[i];
+ }
+ return *reinterpret_cast<Derived*>(this);//thisがDerived型であることは保証されている.
+ }
+
+ Derived& operator+=(float rhs)
+ {
+ const size_t END = last_index() - 1;// 最後の要素は1で保存
+ for (size_t i = 0; i < END; ++i) {
+ elements_[i] += rhs;
+ }
+ return *reinterpret_cast<Derived*>(this);//thisがDerived型であることは保証されている.
+ }
+
+ friend Derived operator+(float rhs1, Derived& rhs2)
+ {
+ Derived retval;
+ const size_t END = last_index() - 1;// 最後の要素は1で保存
+ for (size_t i = 0; i < END; ++i) {
+ retval.elements_[i] = rhs1 + rhs2.elements_[i];
+ }
+ return retval;
+ }
+//}}}
+//{{{ operator -=
+ Derived& operator-=(const Derived& rhs)
+ {
+ const size_t END = last_index() - 1;// 最後の要素は1で保存
+ for (size_t i = 0; i < END; ++i) {
+ elements_[i] -= rhs.elements_[i];
+ }
+ return *reinterpret_cast<Derived*>(this);//thisがDerived型であることは保証されている.
+ }
+
+ Derived& operator-=(float rhs)
+ {
+ const size_t END = last_index() - 1;// 最後の要素は1で保存
+ for (size_t i = 0; i < END; ++i) {
+ elements_[i] -= rhs;
+ }
+ return *reinterpret_cast<Derived*>(this);//thisがDerived型であることは保証されている.
+ }
+
+ friend Derived operator-(float rhs1, Derived& rhs2)
+ {
+ Derived retval;
+ const size_t END = last_index() - 1;// 最後の要素は1で保存
+ for (size_t i = 0; i < END; ++i) {
+ retval.elements_[i] = rhs1 - rhs2.elements_[i];
+ }
+ return retval;
+ }
+//}}}
+//{{{ operator *=
+ Derived& operator*=(const Derived& rhs)
+ {
+ Derived retval;
+ for (size_t a = 0; a < last_index(); ++a) {
+ int b = a / Dim * Dim;
+ int c = a % Dim;
+ float sum = 0;
+ for (size_t i = 0; i < Dim; ++i) {
+ sum += elements_[b + i] * rhs.elements_[c + i * Dim];
+ }
+ retval.elements_[a] = sum;
+ }
+ *this = retval;
+ return *reinterpret_cast<Derived*>(this);//thisがDerived型であることは保証されている.
+ }
+
+ Derived& operator*=(float rhs)
+ {
+ const size_t END = last_index() - 1;// 最後の要素は1で保存
+ for (size_t i = 0; i < END; ++i) {
+ elements_[i] *= rhs;
+ }
+ return *reinterpret_cast<Derived*>(this);//thisがDerived型であることは保証されている.
+ }
+
+ Coordinate& operator*(const Coordinate& rhs)
+ {
+ Coordinate retval;
+ for (size_t a = 0; a < Dim; ++a) {
+ int b = a / Dim * Dim;
+ int c = a % Dim;
+ float sum = 0;
+ for (size_t i = 0; i < Dim; ++i) {
+ sum += elements_[b + i] * rhs[c + i];
+ }
+ retval.components_[a] = sum;
+ }
+ return retval;
+ }
+
+ friend Derived operator*(float rhs1, Derived& rhs2)
+ {
+ Derived retval;
+ const size_t END = last_index() - 1;// 最後の要素は1で保存
+ for (size_t i = 0; i < END; ++i) {
+ retval.elements_[i] = rhs1 * rhs2.elements_[i];
+ }
+ return retval;
+ }
+//}}}
+//{{{ operator /=
+ Derived& operator/=(float rhs)
+ {
+ const size_t END = last_index() - 1;// 最後の要素は1で保存
+ for (size_t i = 0; i < END; ++i) {
+ elements_[i] /= rhs;
+ }
+ return *reinterpret_cast<Derived*>(this);//thisがDerived型であることは保証されている.
+ }
+//}}}
+//{{{ operator ==
+ bool operator==(const Derived& rhs) const
+ {
+ const size_t END = last_index() - 1;// 最後の要素は1で保存
+ for (size_t i = 0; i < END; ++i) {
+ if (elements_[i] != rhs.elements_[i]) return false;
+ }
+ return true;
+ }
+//}}}
+//{{{ operator []
+ /**
+ * @note 補助クラスによってM[i][j]のように参照可能
+ * @note この方法による複数の要素への参照は非効率
+ */
+ row_of_matrix<Dim> operator [](size_t i) const
+ {
+ return row_of_matrix<Dim>(elements_, i);
+ }
+//}}}
+//{{{ operator <<
+ /**
+ * @brief デバッグ出力用ストリーム演算子
+ * @param [in] stream 出力ストリーム
+ * @param [in] rhs 出力対象となる行列オブジェクト
+ * @return 引数で与えられた出力ストリーム
+ */
+ friend std::ostream& operator<<
+ (
+ std::ostream& stream,
+ const Derived& rhs
+ )
+ {
+ for (size_t i = 0; i < Dim + 1; ++i) {
+ for (size_t j = 0; j < Dim + 1; ++j) {
+ if (j != 0) stream << ", ";
+ else if (j != Dim) stream << "\n";
+ stream << rhs.elements_[i * (Dim + 1) + j];
+ }
+ }
+ return stream;
+ }
+//}}}
+ };
+//{{{ row_of_matrix
+ /**
+ * @brief M[i][j]のように行列の要素を参照できるようにするための補助クラス
+ */
+ template <size_t Dim>
+ struct row_of_matrix
+ {
+ const float* elements_;
+ size_t row_index_;
+
+ row_of_matrix(const float* elements, size_t row_index)
+ : elements_(elements), row_index_(row_index)
+ {
+ }
+
+ float operator [](size_t index)
+ {
+ return elements_[row_index_ * (Dim + 1) + index];
+ }
+ };
+//}}}
+
+}// namespace math
+}// namespace mof
namespace math
{
/**
- * @brief å\9fºåº\95ベクトルテンプレートクラス
+ * @brief å\90\8c次å\88\97ベクトルテンプレートクラス
* @note このテンプレートから直接特殊化することは想定していない.
* あくまでvectorxを実装するための補助テンプレートである.
* このクラスは不変クラスである.
protected:
float components_[Dim];///< 要素の配列
public:
+//{{{ array
+ struct array
+ {
+ float arr_[Dim];
+
+ float& operator[](size_t index)
+ {
+ return arr_[index];
+ }
+
+ };
+//}}}
// コンストラクタ,デストラクタはデフォルトのものを使う
// 代入演算子,コピーコンストラクタはデフォルトのものを使う
//{{{ operator +=
return *reinterpret_cast<Derived*>(this);//thisがDerived型であることは保証されている.
}
- friend Derived operator/(float rhs1, Derived& rhs2)
- {
- Derived retval;
- for (size_t i = 0; i < Dim; ++i) retval.components_[i] = rhs1 / rhs2.components_[i];
- return retval;
- }
//}}}
//{{{ operator ==
bool operator==(const Derived& rhs) const
{
- for (size_t i = 0; i < Dim; ++i)
- {
+ for (size_t i = 0; i < Dim; ++i) {
if (components_[i] != rhs.components_[i]) return false;
}
return true;
}
//}}}
+//{{{ operator []
+ /**
+ * @note Dim+1番目の要素は常に1
+ * @param[in] index 添字
+ */
+ float operator[](size_t index) const
+ {
+ if (index < Dim) return components_[index];
+ else if (index == Dim) return 1;
+ // TODO exception
+ return 0;
+ }
+//}}}
//{{{ operator <<
/**
* @brief デバッグ出力用ストリーム演算子
- * @param [in] stream 出力ストリーム
- * @param [in] rhs 出力対象となるベクトルオブジェクト
+ * @param[in] stream 出力ストリーム
+ * @param[in] rhs 出力対象となるベクトルオブジェクト
* @return 引数で与えられた出力ストリーム
*/
friend std::ostream& operator<<
--- /dev/null
+/**
+ * @file 各次元の行列をまとめてインクルードするためのヘッダ
+ */
+#pragma once
+#include <mof/math/matrix2.hpp>
+#include <mof/math/matrix3.hpp>
--- /dev/null
+#pragma once
+#include <mof/math/basic_matrix.hpp>
+
+namespace mof
+{
+namespace math
+{
+ class vector2;
+
+ /**
+ * @brief 2次元同次座標変換行列クラス
+ */
+ class matrix2 : public basic_matrix<2, matrix2, vector2>
+ {
+ public:
+//{{{ constructor
+ /**
+ * @brief デフォルトコンストラクタ.最後の要素以外を0で初期化する.
+ */
+ matrix2()
+ {
+ for (size_t i = 0; i < last_index() - 1; ++i) {
+ elements_[i] = 0;
+ }
+ elements_[last_index() - 1] = 1;
+ }
+
+ /**
+ * @brief 指定した値で初期化する.
+ * @param[in] arr 初期化用配列
+ */
+/*
+ matrix2(const matrix2::array& arr)
+ {
+ for (size_t i = 0; i < last_index() - 1; ++i) {
+ elements_[i] = arr[i];
+ }
+ elements_[last_index() - 1] = 1;
+ }
+*/
+
+ /**
+ * @brief 指定した値で初期化する.
+ */
+ matrix2
+ (
+ float m11, float m12, float m13,
+ float m21, float m22, float m23,
+ float m31, float m32
+ )
+ {
+ const float* table[] =
+ {
+ &m11, &m12, &m13,
+ &m21, &m22, &m23,
+ &m31, &m32
+ };
+ for (size_t i = 0; i < last_index() - 1; ++i) {
+ elements_[i] = *table[i];
+ }
+ elements_[last_index() - 1] = 1;
+ }
+
+//}}}
+//{{{ copy constructor
+ matrix2(const matrix2& rhs)
+ {
+ for (size_t i = 0; i < last_index(); ++i) {
+ elements_[i] = rhs.elements_[i];
+ }
+ }
+//}}}
+//{{{ operator =
+ matrix2& operator = (const matrix2& rhs)
+ {
+ for (size_t i = 0; i < last_index(); ++i) {
+ elements_[i] = rhs.elements_[i];
+ }
+ return *this;
+ }
+//}}}
+ };
+
+}// namespace math
+}// namespace mof
--- /dev/null
+#pragma once
+#include <mof/math/basic_matrix.hpp>
+
+namespace mof
+{
+namespace math
+{
+ class vector3;
+
+ /**
+ * @brief 3次元同次座標変換行列クラス
+ */
+ class matrix3 : public basic_matrix<3, matrix3, vector3>
+ {
+ public:
+//{{{ constructor
+ /**
+ * @brief デフォルトコンストラクタ.最後の要素以外を0で初期化する.
+ */
+ matrix3()
+ {
+ for (size_t i = 0; i < last_index() - 1; ++i) {
+ elements_[i] = 0;
+ }
+ elements_[last_index() - 1] = 1;
+ }
+
+ /**
+ * @brief 指定した値で初期化する.
+ * @param[in] arr 初期化用配列
+ */
+/*
+ matrix3(const matrix3::array& arr)
+ {
+ for (size_t i = 0; i < last_index() - 1; ++i) {
+ elements_[i] = arr[i];
+ }
+ elements_[last_index() - 1] = 1;
+ }
+*/
+
+ /**
+ * @brief 指定した値で初期化する.
+ */
+ matrix3
+ (
+ float m11, float m12, float m13, float m14,
+ float m21, float m22, float m23, float m24,
+ float m31, float m32, float m33, float m34,
+ float m41, float m42, float m43
+ )
+ {
+ const float* table[] =
+ {
+ &m11, &m12, &m13, &m14,
+ &m21, &m22, &m23, &m24,
+ &m31, &m32, &m33, &m34,
+ &m41, &m42, &m43
+ };
+ for (size_t i = 0; i < last_index() - 1; ++i) {
+ elements_[i] = *table[i];
+ }
+ elements_[last_index() - 1] = 1;
+ }
+
+//}}}
+//{{{ copy constructor
+ matrix3(const matrix3& rhs)
+ {
+ for (size_t i = 0; i < last_index(); ++i) {
+ elements_[i] = rhs.elements_[i];
+ }
+ }
+//}}}
+//{{{ operator =
+ /**
+ * @note コピーのパフォーマンスのためにこの関数の定義は重要
+ */
+ matrix3& operator = (const matrix3& rhs)
+ {
+ for (size_t i = 0; i < last_index(); ++i) {
+ elements_[i] = rhs.elements_[i];
+ }
+ return *this;
+ }
+//}}}
+ };
+
+}// namespace math
+}// namespace mof
--- /dev/null
+#include <mof/math/matrix2.hpp>
+#include <iostream>
+#include <sstream>
+
+int main()
+{
+ using namespace mof::math;
+ using namespace std;
+ int failed_count = 0;
+
+ {
+ matrix2 M;
+ bool failed = false;
+ for (size_t i = 0; i < 8; ++i) {
+ if (M[i / 3][i % 3] != 0) failed = true;
+ }
+ std::cout << M[2][2] << std::endl;
+ if (failed || M[2][2] != 1) {
+ cerr << "Failed:" << " default constructor makes zero matrix" << endl;
+ failed_count++;
+ }
+ }
+
+ {
+ matrix2 M(1, 2, 3, 4, 5, 6, 7, 8);
+ std::cout << M << std::endl;
+ bool failed = false;
+ for (size_t i = 0; i < 8; ++i) {
+ if (M[i / 3][i % 3] != i + 1) failed = true;
+ }
+ if (failed || M[2][2] != 1) {
+ cerr << "Failed:" << " initialize test" << endl;
+ failed_count++;
+ }
+ }
+
+ // any operations keeps the last component 1
+ {
+ matrix2 M(1, 2, 3, 4, 5, 6, 7, 8);
+ matrix2 N(1, 2, 3, 4, 5, 6, 7, 8);
+ if (M != N) {
+ cerr << "Failed:" << " comparation test" << endl;
+ failed_count++;
+ }
+ }
+
+ {
+ matrix2 M(1, 2, 3, 4, 5, 6, 7, 8);
+ matrix2 N(0, 2, 3, 4, 5, 6, 7, 8);
+ if (M == N) {
+ cerr << "Failed:" << " comparation test" << endl;
+ failed_count++;
+ }
+ }
+
+ {
+ matrix2 N1(1, 2, 3, 4, 5, 6, 7, 8);
+ matrix2 N2(15, 13, 11, 9, 7, 5, 3, 1);
+ matrix2 N = N1 + N2;
+ matrix2 A(16, 15, 14, 13, 12, 11, 10, 9);
+ if (N != A) {
+ cerr << "Failed:" << " addition test" << endl;
+ failed_count++;
+ }
+ }
+
+ {
+ matrix2 N1(1, 2, 3, 4, 5, 6, 7, 8);
+ matrix2 N2(15, 13, 11, 9, 7, 5, 3, 1);
+ matrix2 N = N1 - N2;
+ matrix2 A(-14, -11, -8, -5, -2, 1, 4, 7);
+ if (N != A) {
+ cerr << "Failed:" << " subtraction test" << endl;
+ failed_count++;
+ }
+ }
+
+ /*
+ v = vector2(10, 10);
+ v = 2 * v * 3;
+ if (v.x() != 60 || v.y() != 60 || v.z() != 1) {
+ cerr << "Failed:" << " multiplation with scalar test" << endl;
+ failed_count++;
+ }
+ */
+ // TODO matrix devide
+
+
+ return failed_count;
+}
--- /dev/null
+#include <mof/math/matrix3.hpp>
+#include <iostream>
+#include <sstream>
+
+int main()
+{
+ using namespace mof::math;
+ using namespace std;
+ int failed_count = 0;
+
+ {
+ matrix3 M;
+ bool failed = false;
+ for (size_t i = 0; i < 15; ++i) {
+ if (M[i / 4][i % 4] != 0) failed = true;
+ }
+ if (failed || M[3][3] != 1) {
+ cerr << "Failed:" << " default constructor makes zero matrix" << endl;
+ failed_count++;
+ }
+ }
+
+ {
+ matrix3 M(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ bool failed = false;
+ for (size_t i = 0; i < 15; ++i) {
+ if (M[i / 4][i % 4] != i + 1) failed = true;
+ }
+ cout << M << endl;
+ if (failed || M[3][3] != 1) {
+ cerr << "Failed:" << " initialize test" << endl;
+ failed_count++;
+ }
+ }
+
+ // any operations keeps the last component 1
+ {
+ matrix3 M(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ matrix3 N(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ if (M != N) {
+ cerr << "Failed:" << " comparation test" << endl;
+ failed_count++;
+ }
+ }
+
+ {
+ matrix3 M(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ matrix3 N(0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ if (M == N) {
+ cerr << "Failed:" << " comparation test" << endl;
+ failed_count++;
+ }
+ }
+
+ {
+ matrix3 N1(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ matrix3 N2(29, 27, 25, 23, 21, 19, 17, 15, 13, 11, 9, 7, 5, 3, 1);
+ matrix3 N = N1 + N2;
+ matrix3 A(30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16);
+ if (N != A) {
+ cerr << "Failed:" << " addition test" << endl;
+ failed_count++;
+ }
+ }
+
+ {
+ matrix3 N1(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ matrix3 N2(29, 27, 25, 23, 21, 19, 17, 15, 13, 11, 9, 7, 5, 3, 1);
+ matrix3 N = N1 - N2;
+ matrix3 A
+ (
+ -28, -25, -22, -19,
+ -16, -13, -10, -7,
+ -4, -1, 2, 5,
+ 8, 11, 14
+ );
+ if (N != A) {
+ cerr << "Failed:" << " subtraction test" << endl;
+ failed_count++;
+ }
+ }
+
+ /*
+ v = vector2(10, 10);
+ v = 2 * v * 3;
+ if (v.x() != 60 || v.y() != 60 || v.z() != 1) {
+ cerr << "Failed:" << " multiplation with scalar test" << endl;
+ failed_count++;
+ }
+ */
+ // TODO matrix devide
+
+
+ return failed_count;
+}
failed_count++;
}
+ v = vector2(1, 2);
+ if (v[0] != 1 || v[1] != 2 || v[2] != 1) {
+ cerr << "Failed:" << " initialize by array" << endl;
+ failed_count++;
+ }
+
// any operations keeps the last component 1
v = vector2(1, 2);
vector2 w(3, 4);
cerr << "Failed:" << " multiplation with scalar test" << endl;
failed_count++;
}
+
+ v = vector2(60, 30);
+ v = v / 3;
+ if (v.x() != 20 || v.y() != 10 || v.z() != 1) {
+ cerr << "Failed:" << " devidation with scalar test" << endl;
+ failed_count++;
+ }
+
v = vector2(1, 2);
w = vector2(1, 2);
failed_count++;
}
+ v = vector3(1, 2, 3);
+ if (v[0] != 1 || v[1] != 2 || v[2] != 3 || v[3] != 1) {
+ cerr << "Failed:" << " initialize by array" << endl;
+ failed_count++;
+ }
+
// any operations keeps the last component 1
v = vector3(1, 2, 3);
vector3 w(4, 5, 6);
cerr << "Failed:" << " multiplation with scalar test" << endl;
failed_count++;
}
+
+
+ v = vector3(90, 60, 30);
+ v = v / 3;
+ if (v.x() != 30 || v.y() != 20 || v.z() != 10 || v.w() != 1) {
+ cerr << "Failed:" << " devidation with scalar test" << endl;
+ failed_count++;
+ }
+
v = vector3(1, 2, 3);
w = vector3(1, 2, 3);
namespace math
{
/**
- * @brief 2次元同次ベクトルクラス
+ * @brief 2次元同次列ベクトルクラス
*/
class vector2 : public basic_vector<2, vector2>
{
components_[0] = x;
components_[1] = y;
}
+
+ /**
+ * @brief 指定した値で初期化する.
+ * @param[in] arr 初期化用配列
+ */
+/*
+ vector2(const vector2::array& arr)
+ {
+ components_[0] = arr[0];
+ components_[1] = arr[1];
+ }
+*/
//}}}
//{{{ accessers
float x() const { return components_[0]; }
namespace math
{
/**
- * @brief 3次元同次ベクトルクラス
+ * @brief 3次元同次列ベクトルクラス
*/
class vector3 : public basic_vector<3, vector3>
{
components_[1] = y;
components_[2] = z;
}
+
+ /**
+ * @brief 指定した値で初期化する.
+ * @param[in] arr 初期化用配列
+ */
+/*
+ vector3(const vector3::array& arr)
+ {
+ components_[0] = arr[0];
+ components_[1] = arr[1];
+ components_[2] = arr[2];
+ }
+*/
+
//}}}
//{{{ accesser
float x() const { return components_[0]; }
project(mofutil)
# build util
-add_library(mofutil STATIC multimedia_timer.cpp)
+if (CMAKE_COMPILER_IS_GNUCC)
+ file(GLOB src FILES linux/*.cpp)
+endif()
+add_library(mofutil STATIC ${src})
if (CMAKE_COMPILER_IS_GNUCC)
# no meaning?
#target_link_libraries(mofutil "librt")