Commit c01c8114 authored by novikov's avatar novikov

fix operator = for table

parent 61acd40e
......@@ -1921,17 +1921,28 @@ namespace INMOST
template<class A>
class function_expression : public shell_expression< function_expression<A> >
{
const A & arg;
INMOST_DATA_REAL_TYPE value, dmult, ddmult;
public:
function_expression(const shell_expression<A> & _arg)
:arg(_arg), value(1), dmult(0) {}
function_expression(const shell_expression<A> & _arg, INMOST_DATA_REAL_TYPE pvalue, INMOST_DATA_REAL_TYPE pdmult, INMOST_DATA_REAL_TYPE pddmult = 0)
:arg(_arg), value(pvalue), dmult(pdmult), ddmult(pddmult) {}
function_expression(const function_expression & other)
: arg(other.arg), value(other.value), dmult(other.dmult), ddmult(other.ddmult) {}
class function_expression : public shell_expression< function_expression<A> > {
const A &arg;
INMOST_DATA_REAL_TYPE value, dmult, ddmult;
public:
function_expression(const shell_expression<A> &_arg)
: arg(_arg), value(1), dmult(0) {}
function_expression(const shell_expression<A> &_arg, INMOST_DATA_REAL_TYPE pvalue, INMOST_DATA_REAL_TYPE pdmult,
INMOST_DATA_REAL_TYPE pddmult = 0)
: arg(_arg), value(pvalue), dmult(pdmult), ddmult(pddmult) {}
function_expression(const function_expression &other)
: arg(other.arg), value(other.value), dmult(other.dmult), ddmult(other.ddmult) {}
function_expression &operator=(function_expression const &b)
{
arg = b.arg;
value = b.value;
dmult = b.dmult;
ddmult = b.ddmult;
return *this;
}
__INLINE INMOST_DATA_REAL_TYPE GetValue() const {return value;}
__INLINE void GetJacobian(INMOST_DATA_REAL_TYPE mult, Sparse::RowMerger & r) const
{
......
......@@ -39,8 +39,8 @@ namespace INMOST
Op operand;
public:
unary_pool(const A & parg) : arg(parg), operand(arg) {}
unary_pool(const unary_pool & other) : arg(other.arg), operand(arg) {}
unary_pool & operator = (unary_pool const & other) {arg = other.arg; operand = Op(arg); return * this;}
unary_pool(const unary_pool & other) : arg(other.arg), operand(other.operand) {}
unary_pool & operator = (unary_pool const & other) {arg = other.arg; operand = other.operand; return * this;}
const shell_expression<A> & get_arg() {return arg;}
Op & get_op() {return operand;}
const Op & get_op() const {return operand;}
......@@ -55,8 +55,8 @@ namespace INMOST
Op operand;
public:
unary_const_pool(const A & pleft, INMOST_DATA_REAL_TYPE pright) : left(pleft), right(pright), operand(left,right) {}
unary_const_pool(const unary_const_pool & other) : left(other.left), right(other.right), operand(left,right) {}
unary_const_pool & operator = (unary_const_pool const & other) {left = other.left; right = other.right; operand = Op(left,right); return * this;}
unary_const_pool(const unary_const_pool & other) : left(other.left), right(other.right), operand(other.operand) {}
unary_const_pool & operator = (unary_const_pool const & other) {left = other.left; right = other.right; operand = other.operand; return * this;}
const shell_expression<A> & get_arg() {return left;}
Op & get_op() {return operand;}
const Op & get_op() const {return operand;}
......@@ -71,8 +71,8 @@ namespace INMOST
Op operand;
public:
binary_pool(const A & pleft, const B & pright) : left(pleft), right(pright), operand(left,right) {}
binary_pool(const binary_pool & other) : left(other.left), right(other.right), operand(left,right) {}
binary_pool & operator =(binary_pool const & other) {left = other.left; right = other.right; operand = Op(left,right); return * this;}
binary_pool(const binary_pool & other) : left(other.left), right(other.right), operand(other.operand) {}
binary_pool & operator =(binary_pool const & other) {left = other.left; right = other.right; operand = other.operand; return * this;}
const shell_expression<A> & get_left() {return left;}
const shell_expression<B> & get_right() {return right;}
Op & get_op() {return operand;}
......@@ -89,8 +89,8 @@ namespace INMOST
Op operand;
public:
ternary_pool(const A & pcond, const B & pleft, const C & pright) : cond(pcond), left(pleft), right(pright), operand(cond,left,right) {}
ternary_pool(const ternary_pool & other) : cond(other.cond), left(other.left), right(other.right), operand(cond,left,right) {}
ternary_pool & operator =(ternary_pool const & other) {cond = other.cond; left = other.left; right = other.right; operand = Op(cond,left,right); return * this;}
ternary_pool(const ternary_pool & other) : cond(other.cond), left(other.left), right(other.right), operand(other.operand) {}
ternary_pool & operator =(ternary_pool const & other) {cond = other.cond; left = other.left; right = other.right; operand = other.operand; return * this;}
const shell_expression<A> & get_cond() {return cond;}
const shell_expression<B> & get_left() {return left;}
const shell_expression<C> & get_right() {return right;}
......@@ -420,7 +420,7 @@ namespace INMOST
A Arg;
const keyval_table & Table;
public:
table_variable(const shell_dynamic_variable<typename A::Var,A> & parg, const keyval_table & ptable) : Arg(parg), Table(ptable) {}
table_variable(const shell_dynamic_variable<typename A::Var,A> & parg, const keyval_table & ptable) : Arg(parg), Table(ptable) {}
table_variable(const table_variable & other) : Arg(other.Arg), Table(other.Table) {}
table_variable & operator = (table_variable const & other) {Arg = other.Arg; Table = other.Table; return * this;}
multivar_expression Variable(const Storage & e) const
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment