Vec object type
Vec is a template class mainly for numerical vectors. We can define any type of vector and the number of components:
Vec<double,19> myVector;
We can also use any of the predefined types:
typedef Vec<uchar, 2> Vec2b; typedef Vec<uchar, 3> Vec3b; typedef Vec<uchar, 4> Vec4b; typedef Vec<short, 2> Vec2s; typedef Vec<short, 3> Vec3s; typedef Vec<short, 4> Vec4s; typedef Vec<int, 2> Vec2i; typedef Vec<int, 3> Vec3i; typedef Vec<int, 4> Vec4i; typedef Vec<float, 2> Vec2f; typedef Vec<float, 3> Vec3f; typedef Vec<float, 4> Vec4f; typedef Vec<float, 6> Vec6f; typedef Vec<double, 2> Vec2d; typedef Vec<double, 3> Vec3d; typedef Vec<double, 4> Vec4d; typedef Vec<double, 6> Vec6d;
All the following vector operations are also implemented:
v1 = v2 + v3
v1 = v2 - v3
v1 = v2 * scale
v1 = scale * v2
v1 = -v2
v1 += v2
v1 = v2 + v3
v1 = v2 - v3
v1 = v2 * scale
v1 = scale * v2
v1 = -v2
v1 += v2
Other augmenting operations implemented are the following:
v1 == v2, v1 != v2
norm(v1) (euclidean norm).
推薦閱讀
- Python數(shù)據(jù)挖掘:入門、進(jìn)階與實(shí)用案例分析
- 計(jì)算機(jī)信息技術(shù)基礎(chǔ)實(shí)驗(yàn)與習(xí)題
- 算法與數(shù)據(jù)中臺(tái):基于Google、Facebook與微博實(shí)踐
- 數(shù)據(jù)庫(kù)應(yīng)用基礎(chǔ)教程(Visual FoxPro 9.0)
- 數(shù)字媒體交互設(shè)計(jì)(初級(jí)):Web產(chǎn)品交互設(shè)計(jì)方法與案例
- 辦公應(yīng)用與計(jì)算思維案例教程
- 機(jī)器學(xué)習(xí):實(shí)用案例解析
- Deep Learning with R for Beginners
- 算力經(jīng)濟(jì):從超級(jí)計(jì)算到云計(jì)算
- Unity Game Development Blueprints
- 數(shù)據(jù)庫(kù)原理及應(yīng)用:SQL Server 2016
- Oracle 內(nèi)核技術(shù)揭密
- 工業(yè)大數(shù)據(jù)融合體系結(jié)構(gòu)與關(guān)鍵技術(shù)
- 一本書(shū)講透數(shù)據(jù)治理:戰(zhàn)略、方法、工具與實(shí)踐
- Working with OpenERP