- Timestamp:
- 06/04/08 22:26:41 (4 months ago)
- Files:
-
- trunk/LinAlg/linalg/MatrixT.d (modified) (3 diffs)
- trunk/LinAlg/linalg/VectorT.d (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/LinAlg/linalg/MatrixT.d
r149 r150 70 70 71 71 /// Compile-time const identity matrix. 72 mixin(_gen_identity_matrix!(M,N)()) ; 72 mixin(_gen_identity_matrix!(M,N)("static", "identity")) ; 73 mixin(_gen_identity_matrix!(M,N)("static const", "cidentity")) ; 73 74 74 75 /// Compile-time const matrix with all elements set to 0. 75 mixin(_gen_zero_matrix!(M,N)()) ; 76 mixin(_gen_zero_matrix!(M,N)("static", "zero")) ; 77 mixin(_gen_zero_matrix!(M,N)("static const", "czero")) ; 76 78 77 79 … … 765 767 766 768 767 private string _gen_identity_matrix(int M, int N)( ) {768 string ret = "static const MatrixT identity= {[cast(T)";769 private string _gen_identity_matrix(int M, int N)(string storage_class, string name) { 770 string ret = storage_class ~" MatrixT "~name~" = {[cast(T)"; 769 771 for(int col=0; col<N; ++col) { 770 772 for (int row=0; row<M; ++row) { … … 776 778 } 777 779 778 private string _gen_zero_matrix(int M, int N)( ) {779 string ret = "static const MatrixT zero= {[cast(T)";780 private string _gen_zero_matrix(int M, int N)(string storage_class, string name) { 781 string ret = storage_class ~" MatrixT "~name~" = {[cast(T)"; 780 782 for(int col=0; col<N; ++col) { 781 783 for (int row=0; row<M; ++row) { trunk/LinAlg/linalg/VectorT.d
r149 r150 68 68 } 69 69 70 private string _gen_zero_vector(int N)( ) {71 string ret = "static const VectorT zero= {[cast(T)";70 private string _gen_zero_vector(int N)(string storage_class, string name) { 71 string ret = storage_class ~" VectorT "~name~" = {[cast(T)"; 72 72 for(int col=0; col<N; ++col) { 73 73 ret ~= "0,"; … … 151 151 152 152 //-------------------------------------------------------------- constructors 153 /// Compile-time const vectorwith all elements set to 0.153 /// Compile-time static vectors with all elements set to 0. 154 154 // static VectorT zero = {0,0,0...} 155 mixin(_gen_zero_vector!(N)()) ; 155 // static const VectorT zero = {0,0,0...} 156 mixin(_gen_zero_vector!(N)("static", "zero")); 157 mixin(_gen_zero_vector!(N)("static const", "czero")); 156 158 157 159 /// default constructor creates uninitialized values.
