| 1022 | class vec_from_vec: public vec { |
| 1023 | protected: |
| 1024 | datalink_part dl; |
| 1025 | public: |
| 1026 | void update(const vec &v1){ |
| 1027 | bdm_assert_debug(length()==dl._downsize(),"vec_from_vec incompatible"); |
| 1028 | bdm_assert_debug(v1.length()>=dl._upsize(),"vec_from_vec incompatible");//does not guarantee anything! |
| 1029 | dl.filldown(v1,*this); |
| 1030 | }; |
| 1031 | void connect(const RV &vecrv, const RV & vec1){dl.set_connection(vecrv,vec1);set_length(vecrv._dsize());}; |
| 1032 | }; |
| 1033 | |
| 1034 | class vec_from_2vec: public vec { |
| 1035 | protected: |
| 1036 | datalink_part dl1; |
| 1037 | datalink_part dl2; |
| 1038 | public: |
| 1039 | void update(const vec &v1, const vec &v2){ |
| 1040 | bdm_assert_debug(length()==dl1._downsize()+dl2._downsize(),"vec_from_vec incompatible"); |
| 1041 | bdm_assert_debug(v1.length()>=dl1._upsize(),"vec_from_vec incompatible"); |
| 1042 | bdm_assert_debug(v2.length()>=dl2._upsize(),"vec_from_vec incompatible"); |
| 1043 | dl1.filldown(v1,*this); |
| 1044 | dl2.filldown(v2,*this); |
| 1045 | }; |
| 1046 | void connect(const RV &rv, const RV & rv1, const RV &rv2){ |
| 1047 | dl1.set_connection(rv,rv1); |
| 1048 | dl2.set_connection(rv,rv2); |
| 1049 | set_length(rv._dsize()); |
| 1050 | }; |
| 1051 | }; |
| 1052 | |