vector.....

1.事实表和维表

维表是用户分析决策的角度,事实表是分析主体的量化体现。

维表是描述问题的某一单一角度,事实表的多个维度的综合。

2.DDTA

我们已知:事实表一般比维表大,在事实表的外键上做Join操作,由于这个已知的事实,提出DDTA的Join算法

对事实表 按照 维表的主键 进行分组


涉及数据结构:

bitvec位置指示向量,维表过滤向量;

col输入向量,事实表外键;

res输出向量,中间结果;


1.将维表上做filter操作后,得到vector数组

2.逐个取出事实表的每个元组的外键(若是面向列的直接取出相应地列即可),外键的值就是维表的主键,即维表的索引,按得到的索引 查找bitvec 得知是否留下相应地值,即 可否得到连接结果

The `vector.assign` function is used to assign new values to a vector. It replaces the existing elements of the vector with the new set of elements provided as arguments. Syntax: ``` vector.assign(count, value); vector.assign(startIterator, endIterator); vector.assign(initializerList); ``` Parameters: - `count`: the number of elements to be inserted into the vector. - `value`: the value to be assigned to each element being inserted into the vector. - `startIterator`: an iterator pointing to the beginning of a range of elements to be inserted into the vector. - `endIterator`: an iterator pointing to the end of a range of elements to be inserted into the vector. - `initializerList`: an initializer list containing the elements to be inserted into the vector. Return value: None. Example: ``` #include <iostream> #include <vector> using namespace std; int main() { vector<int> vec; // Assigning 5 elements with value 10 vec.assign(5, 10); // Displaying the elements of the vector for (int i = 0; i < vec.size(); i++) { cout << vec[i] << " "; } cout << endl; // Assigning elements from a range int arr[] = { 1, 2, 3, 4, 5 }; vec.assign(arr, arr + 5); // Displaying the elements of the vector for (int i = 0; i < vec.size(); i++) { cout << vec[i] << " "; } cout << endl; // Assigning elements using an initializer list vec.assign({ 6, 7, 8, 9, 10 }); // Displaying the elements of the vector for (int i = 0; i < vec.size(); i++) { cout << vec[i] << " "; } cout << endl; return 0; } ``` Output: ``` 10 10 10 10 10 1 2 3 4 5 6 7 8 9 10 ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值