test_weightedsample.cpp
来自「一个很全的matlab工具包」· C++ 代码 · 共 36 行
CPP
36 行
#include <sample/weightedsample.h>using namespace BFL;using namespace MatrixWrapper;#define DIMENSION 3int main(){ ColumnVector a(DIMENSION); a[0] = 1.0; a[1] = 0.1; a[2] = 1.0; Sample<ColumnVector> my_first_sample; WeightedSample<ColumnVector> my_first_weighted_sample; my_first_sample.ValueSet(a); my_first_weighted_sample.ValueSet(a); WeightedSample<ColumnVector> my_second_weighted_sample(DIMENSION); my_second_weighted_sample = my_first_sample; my_first_weighted_sample.WeightSet(0.5); cout << my_first_weighted_sample << endl; cout << my_second_weighted_sample << endl; int sample_val = 2; WeightedSample<int> my_discrete_sample; my_discrete_sample.ValueSet(sample_val); my_discrete_sample.WeightSet(0.3); cout << my_discrete_sample << endl; cout << "test_weightedsample... done" << endl; return 0;}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?