学习日志1
基础学习
对于容器遍历
` for (int i = 0; i < v.size(); i++) //注意弹出后边界的改变
{
cout << v[i] << endl;
}
for (auto i : v)
{
cout << i << endl;
}
for (vector<int>::iterator it = v.begin(); it != v.end(); it++)
{
cout << *it << endl;
}
for (auto it = v.begin(); it != v.end(); it++)
{
if (*it == 1)
it = v.erase(it);
cout << *it << endl;
}
链表
```cpp
struct Node
{
int val;
Node* next;
};
class linklist
{
public:
linklist()
{
head = new Node();
head->next = NULL;
};
~linklist()
{
Node* p = head;
while (p)//从头结点删除所有结点
{
Node* q = p->next;
delete p;
p = q;
}
head = NULL;
};
void creatlist1(int n)//头插法插入n个元素
{
Node* p, * s;
p = head;
cout << "输入n个元素" << endl;
for (int i = 1; i <= n; i++)
{
s = new Node;
cin >> s->val;
if (p == NULL) return;
else {
s->next = p->next;
p->next = s;
}
}
}
void creatlist2(int n)//尾插法
{
Node* p, * s;
p = head;
cout << "输入n个元素" << endl;
for (int i = 1; i <=n; i++)
{
s = new Node;
cin >> s->val;
p->next = s;
p = s;
if (i == n) p->next = NULL; //令尾结点后置空;否则查询时结束不了。
}
};
void printlist()
{
Node* p = head->next;
while (p != NULL)
{
cout << p->val << endl;
p = p->next;
}
};
Node* getnode(int n) //位置序号查找jiedian
{
int j = 1;
Node* p = head->next;
while (j != n)
{
j++;
p = p->next;
}
return p;
};
int getnum(int n) //位置序号查找
{
int j = 1;
Node* p = head->next;
while (j != n)
{
j++;
p = p->next;
}
return p->val;
};
int getnumlocal(int n)//值查找
{
int j = 1;
Node* p = head->next;
while (p->val != n)
{
j++;
p = p->next;
}
return j;
};
void insertnode(int n_node,int n_val)
{
Node* pre = getnode(n_node - 1);
Node* p = new Node;
p->val = n_val;
p->next = pre->next;
pre->next = p;
};
private:
Node* head;
};
分层算法学习
对于精度的考虑
分层时间
拟合
References:
[1]. 王耀等, 快速成型技术中分层算法的研究综述. 计算机集成制造系统, 2020: 第1-20页.
[2]. 王素, 刘恒与朱心雄, STL模型的分层邻接排序快速切片算法. 计算机辅助设计与图形学学报, 2011. 23(4): 第600-606页.
[3]. Pan, X.D., et al., Adaptive Slicing Algorithm Based on STL Model. Applied Mechanics and Materials, 2013. 288: p. 241-245.
[4]. 卢秉恒, 增材制造技术——现状与未来, in 中国信息化周报2020. 第 2页.
[5]. 曹增欢, 黄常标与郑红, 三角网格模型的特征保持混合折叠简化. 光学精密工程, 2019. 27(4): 第971-983页.
[6]. He, G. and J. Yang, Application of the slicing technique to extract the contour feature line. Cluster Computing, 2019. 22(S6): p. 13937-13943.