Changeset 545 for library/bdm/base/bdmbase.h
- Timestamp:
- 08/18/09 09:38:41 (15 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
library/bdm/base/bdmbase.h
r536 r545 557 557 //! Constructor 558 558 datalink() : downsize (0), upsize (0) { } 559 //! Conevnience constructor 559 560 //! Convenience constructor 560 561 datalink (const RV &rv, const RV &rv_up) { 561 562 set_connection (rv, rv_up); … … 563 564 564 565 //! set connection, rv must be fully present in rv_up 565 void set_connection (const RV &rv, const RV &rv_up) { 566 downsize = rv._dsize(); 567 upsize = rv_up._dsize(); 568 v2v_up = rv.dataind (rv_up); 569 570 it_assert_debug (v2v_up.length() == downsize, "rv is not fully in rv_up"); 571 } 566 void set_connection (const RV &rv, const RV &rv_up); 572 567 573 568 //! set connection using indices 574 void set_connection (int ds, int us, const ivec &upind) { 575 downsize = ds; 576 upsize = us; 577 v2v_up = upind; 578 579 it_assert_debug (v2v_up.length() == downsize, "rv is not fully in rv_up"); 580 } 569 void set_connection (int ds, int us, const ivec &upind); 581 570 582 571 //! Get val for myself from val of "Up" … … 610 599 //! Constructor 611 600 datalink_m2e() : condsize (0) { } 601 612 602 //! Set connection between vectors 613 void set_connection (const RV &rv, const RV &rvc, const RV &rv_up) { 614 datalink::set_connection (rv, rv_up); 615 condsize = rvc._dsize(); 616 //establish v2c connection 617 rvc.dataind (rv_up, v2c_lo, v2c_up); 618 } 603 void set_connection (const RV &rv, const RV &rvc, const RV &rv_up); 619 604 620 605 //!Construct condition 621 vec get_cond (const vec &val_up) { 622 vec tmp (condsize); 623 set_subvector (tmp, v2c_lo, val_up (v2c_up)); 624 return tmp; 625 } 606 vec get_cond (const vec &val_up); 607 626 608 //! Copy corresponding values to Up.condition 627 void pushup_cond (vec &val_up, const vec &val, const vec &cond) { 628 it_assert_debug (downsize == val.length(), "Wrong val"); 629 it_assert_debug (upsize == val_up.length(), "Wrong val_up"); 630 set_subvector (val_up, v2v_up, val); 631 set_subvector (val_up, v2c_up, cond); 632 } 609 void pushup_cond (vec &val_up, const vec &val, const vec &cond); 633 610 }; 634 611