官术网_书友最值得收藏!

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  

 

Other augmenting operations implemented are the following:
v1 == v2, v1 != v2
norm(v1) (euclidean norm).

主站蜘蛛池模板: 县级市| 泾川县| 嘉鱼县| 英德市| 漳平市| 文安县| 英吉沙县| 麻江县| 望奎县| 三台县| 宿州市| 吐鲁番市| 德庆县| 开化县| 渭源县| 临沂市| 乌鲁木齐县| 石泉县| 兴安盟| 浠水县| 阿坝县| 布拖县| 时尚| 平湖市| 循化| 汶川县| 吴桥县| 彩票| 大城县| 陈巴尔虎旗| 湖口县| 恩施市| 兴化市| 河北区| 桃园市| 自治县| 平顶山市| 哈巴河县| 龙胜| 容城县| 博湖县|