BT chunks:
ET chunks:
BT chunks:
ET chunks:
Units | Prob | |
String | {a^{n}b^{n}|n>=1} | P(w1, w2,…, wn) |
Structure | A tree structure | PCFG |
G1 | G2 |
S->a s | s->s a |
s->e | s->e |
Basically, the time spent on testing depends on:
Analyze of different deep learning models:
Other machine learning models:
Machine learning thought:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
struct ShadingAttribs { float3 P; ///< Shading hit position in world space float3 E; ///< Direction to the eye at shading hit float3 N; ///< Shading normal at shading hit float3 T; ///< Shading tangent at shading hit float3 B; ///< Shading bitangent at shading hit float2 UV; ///< Texture mapping coordinates #ifdef _MS_USER_DERIVATIVES float2 DPDX DEFAULTS(float2(0, 0)); float2 DPDY DEFAULTS(float2(0, 0)); ///< User-provided 2x2 full matrix of duv/dxy derivatives of a shading point footprint in texture space #else float lodBias DEFAULTS(0); ///< LOD bias to use when sampling textures #endif #ifdef _MS_USER_HALF_VECTOR_DERIVATIVES float2 DHDX DEFAULTS(float2(0, 0)); float2 DHDY DEFAULTS(float2(0, 0)); ///< User-defined half-vector derivatives #endif PreparedMaterialData preparedMat; ///< Copy of the original material with evaluated parameters (i.e., textures are fetched etc.) float aoFactor; }; |
CMake Warning at CMakeLists.txt:390 (MESSAGE):
Build of assimp_qt_viewer is disabled. Unsatisfied dendencies: Qt5 DevIL
Permutation:
http://blog.csdn.net/hackbuteer1/article/details/6657435
Tomorrow:
CORDIC
Description:
https://leetcode.com/problems/k-diff-pairs-in-an-array/description
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
class Solution { public: int findPairs(vector<int>& nums, int k) { if (nums.size() == 0) return 0; if (k < 0) return 0; int result = 0; if (k == 0) { sort(nums.begin(), nums.end()); int switcher = 0; for (int i = 0; i < nums.size() - 1; i++) { if (nums[i + 1] == nums[i]) { if (switcher == 0) { result++; switcher = 1; } } else { switcher = 0; } } } else { unordered_map< int, int> mapping; sort(nums.begin(), nums.end()); nums.erase(unique(nums.begin(), nums.end()), nums.end()); for (int i = 0; i < nums.size(); ++i) { mapping[nums[i]] = i; } for (int i = 0; i < nums.size(); ++i) { int target = nums[i] + k; if (mapping.find(target) != mapping.end()) result++; } } return result; } }; |
Time & Space:
O(nlog(n)) & O(n)
Description:
https://leetcode.com/problems/contains-duplicate/#/description
Algorithm:
Code1:
class Solution {
public:
bool containsDuplicate(vector<int>& nums) {
if (nums.size() < 2) return false;
sort(nums.begin(), nums.end());
for (int i = 0; i < nums.size() - 1;i++)
{
if (nums[i] == nums[i+1])
return true;
}
return false;
}
};
Code2:
class Solution {
public:
bool containsDuplicate(vector
int min = INT_MAX;
int max = INT_MIN;
for (int i = 0; i < nums.size(); ++i) {
if (nums[i] > max) {
max = nums[i];
}
if (nums[i] < min) {
min = nums[i];
}
}
vector
for (int i = 0; i < nums.size(); ++i) {
if (exists[nums[i] - min]) {
return true;
}
else {
exists[nums[i] - min] = true;
}
}
return false;
}
};
Time & Space:
Code1:
Time: O(nlogn) Space O(1)
Code2:
Time: O(n), Space O(n)