Differences From Artifact [81322e1ce041bb24]:
- File
_lib/typical/dp.cpp
- 2011-02-23 09:21:16 - part of checkin [4fd800b3a8] on branch trunk - Copied from private svn repository. (user: kinaba) [annotate]
- File
lib/typical/dp.cpp
- 2011-02-23 11:18:09 - part of checkin [23dfcca431] on branch trunk - renamed _lib to lib (user: kinaba) [annotate]
To Artifact [ae16b2462960bb78]:
- File
lib/typical/dp.cpp
- 2011-10-04 17:30:15 - part of checkin [a01c3ec3ed] on branch trunk - 520 library update (user: kinaba) [annotate]
50 : N1(2), N2(N2), N3(N3), data(N1*N2*N3, t) { assert(data.size()* 50 : N1(2), N2(N2), N3(N3), data(N1*N2*N3, t) { assert(data.size()*
51 T& operator()(int i1, int i2, int i3) 51 T& operator()(int i1, int i2, int i3)
52 { i1&=1; return data[ ((i1*N2)+i2)*N3+i3 ]; } 52 { i1&=1; return data[ ((i1*N2)+i2)*N3+i3 ]; }
53 void swap(DP3x& rhs) 53 void swap(DP3x& rhs)
54 { data.swap(rhs.data); } 54 { data.swap(rhs.data); }
55 }; 55 };
56 56
57 // Not Tested | 57 // Tested: SRM 520 Lv2
58 template<typename T> 58 template<typename T>
59 struct DP4 59 struct DP4
60 { 60 {
61 int N1, N2, N3, N4; 61 int N1, N2, N3, N4;
62 vector<T> data; 62 vector<T> data;
63 DP4(int N1, int N2, int N3, int N4, const T& t = T()) 63 DP4(int N1, int N2, int N3, int N4, const T& t = T())
64 : N1(N1), N2(N2), N3(N3), N4(N4), data(N1*N2*N3*N4, t) { assert( 64 : N1(N1), N2(N2), N3(N3), N4(N4), data(N1*N2*N3*N4, t) { assert(