Skip to content

Commit

Permalink
master: finish conversion from comp_op.hpp -> compare.hpp.
Browse files Browse the repository at this point in the history
  • Loading branch information
bradbell committed Nov 2, 2024
1 parent 09271ad commit 9aa86eb
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 636 deletions.
131 changes: 21 additions & 110 deletions include/cppad/local/sweep/forward0.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,27 @@ void forward0(
// action to take depends on the case
switch( op )
{
case EqppOp:
case EqpvOp:
case EqvvOp:
case LeppOp:
case LepvOp:
case LevpOp:
case LevvOp:
case LtppOp:
case LtpvOp:
case LtvpOp:
case LtvvOp:
case NeppOp:
case NepvOp:
case NevvOp:
var_op::compare(op,
arg, parameter, J, taylor, itr.op_index(), compare_change_count,
compare_change_number, compare_change_op_index
);
break;
// -------------------------------------------------

case AbsOp:
var_op::forward_abs_op_0(i_var, size_t(arg[0]), J, taylor);
break;
Expand Down Expand Up @@ -435,30 +456,6 @@ void forward0(
break;
// -------------------------------------------------

case EqppOp:
var_op::compare(op,
arg, parameter, J, taylor, itr.op_index(), compare_change_count,
compare_change_number, compare_change_op_index
);
break;
// -------------------------------------------------

case EqpvOp:
var_op::compare(op,
arg, parameter, J, taylor, itr.op_index(), compare_change_count,
compare_change_number, compare_change_op_index
);
break;
// -------------------------------------------------

case EqvvOp:
var_op::compare(op,
arg, parameter, J, taylor, itr.op_index(), compare_change_count,
compare_change_number, compare_change_op_index
);
break;
// -------------------------------------------------

case ErfOp:
case ErfcOp:
var_op::forward_erf_op_0(op, i_var, arg, parameter, J, taylor);
Expand Down Expand Up @@ -510,37 +507,6 @@ void forward0(
break;
// -------------------------------------------------

case LeppOp:
var_op::compare(op,
arg, parameter, J, taylor, itr.op_index(), compare_change_count,
compare_change_number, compare_change_op_index
);
break;
// -------------------------------------------------
case LepvOp:
var_op::compare(op,
arg, parameter, J, taylor, itr.op_index(), compare_change_count,
compare_change_number, compare_change_op_index
);
break;
// -------------------------------------------------

case LevpOp:
var_op::compare(op,
arg, parameter, J, taylor, itr.op_index(), compare_change_count,
compare_change_number, compare_change_op_index
);
break;
// -------------------------------------------------

case LevvOp:
var_op::compare(op,
arg, parameter, J, taylor, itr.op_index(), compare_change_count,
compare_change_number, compare_change_op_index
);
break;
// -------------------------------------------------

case LogOp:
var_op::forward_log_op_0(i_var, size_t(arg[0]), J, taylor);
break;
Expand All @@ -551,37 +517,6 @@ void forward0(
break;
// -------------------------------------------------

case LtppOp:
var_op::compare(op,
arg, parameter, J, taylor, itr.op_index(), compare_change_count,
compare_change_number, compare_change_op_index
);
break;
// -------------------------------------------------
case LtpvOp:
var_op::compare(op,
arg, parameter, J, taylor, itr.op_index(), compare_change_count,
compare_change_number, compare_change_op_index
);
break;
// -------------------------------------------------

case LtvpOp:
var_op::compare(op,
arg, parameter, J, taylor, itr.op_index(), compare_change_count,
compare_change_number, compare_change_op_index
);
break;
// -------------------------------------------------

case LtvvOp:
var_op::compare(op,
arg, parameter, J, taylor, itr.op_index(), compare_change_count,
compare_change_number, compare_change_op_index
);
break;
// -------------------------------------------------

case MulpvOp:
CPPAD_ASSERT_UNKNOWN( size_t(arg[0]) < num_par );
var_op::forward_mulpv_op_0(i_var, arg, parameter, J, taylor);
Expand All @@ -593,36 +528,12 @@ void forward0(
break;
// -------------------------------------------------

case NeppOp:
var_op::compare(op,
arg, parameter, J, taylor, itr.op_index(), compare_change_count,
compare_change_number, compare_change_op_index
);
break;
// -------------------------------------------------

case NegOp:
var_op::forward_neg_op_0(i_var, size_t(arg[0]), J, taylor);
break;

// -------------------------------------------------

case NepvOp:
var_op::compare(op,
arg, parameter, J, taylor, itr.op_index(), compare_change_count,
compare_change_number, compare_change_op_index
);
break;
// -------------------------------------------------

case NevvOp:
var_op::compare(op,
arg, parameter, J, taylor, itr.op_index(), compare_change_count,
compare_change_number, compare_change_op_index
);
break;
// -------------------------------------------------

case ParOp:
var_op::forward_par_op_0(
i_var, arg, num_par, parameter, J, taylor
Expand Down
133 changes: 21 additions & 112 deletions include/cppad/local/sweep/forward1.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,27 @@ void forward1(
// action depends on the operator
switch( op )
{
case EqppOp:
case EqpvOp:
case EqvvOp:
case LeppOp:
case LepvOp:
case LevpOp:
case LevvOp:
case LtppOp:
case LtpvOp:
case LtvpOp:
case LtvvOp:
case NeppOp:
case NepvOp:
case NevvOp:
var_op::compare(op,
arg, parameter, J, taylor, itr.op_index(), compare_change_count,
compare_change_number, compare_change_op_index
);
break;
// -------------------------------------------------

case AbsOp:
var_op::forward_abs_op(p, q, i_var, size_t(arg[0]), J, taylor);
break;
Expand Down Expand Up @@ -440,30 +461,6 @@ void forward1(
break;
// -------------------------------------------------

case EqppOp:
var_op::compare(op,
arg, parameter, J, taylor, itr.op_index(), compare_change_count,
compare_change_number, compare_change_op_index
);
break;
// -------------------------------------------------

case EqpvOp:
var_op::compare(op,
arg, parameter, J, taylor, itr.op_index(), compare_change_count,
compare_change_number, compare_change_op_index
);
break;
// -------------------------------------------------

case EqvvOp:
var_op::compare(op,
arg, parameter, J, taylor, itr.op_index(), compare_change_count,
compare_change_number, compare_change_op_index
);
break;
// -------------------------------------------------

case ErfOp:
case ErfcOp:
var_op::forward_erf_op(op, p, q, i_var, arg, parameter, J, taylor);
Expand Down Expand Up @@ -569,38 +566,6 @@ void forward1(
break;
// -------------------------------------------------

case LeppOp:
var_op::compare(op,
arg, parameter, J, taylor, itr.op_index(), compare_change_count,
compare_change_number, compare_change_op_index
);
break;
// -------------------------------------------------

case LepvOp:
var_op::compare(op,
arg, parameter, J, taylor, itr.op_index(), compare_change_count,
compare_change_number, compare_change_op_index
);
break;
// -------------------------------------------------

case LevpOp:
var_op::compare(op,
arg, parameter, J, taylor, itr.op_index(), compare_change_count,
compare_change_number, compare_change_op_index
);
break;
// -------------------------------------------------

case LevvOp:
var_op::compare(op,
arg, parameter, J, taylor, itr.op_index(), compare_change_count,
compare_change_number, compare_change_op_index
);
break;
// -------------------------------------------------

case LogOp:
var_op::forward_log_op(p, q, i_var, size_t(arg[0]), J, taylor);
break;
Expand All @@ -611,38 +576,6 @@ void forward1(
break;
// -------------------------------------------------

case LtppOp:
var_op::compare(op,
arg, parameter, J, taylor, itr.op_index(), compare_change_count,
compare_change_number, compare_change_op_index
);
break;
// -------------------------------------------------

case LtpvOp:
var_op::compare(op,
arg, parameter, J, taylor, itr.op_index(), compare_change_count,
compare_change_number, compare_change_op_index
);
break;
// -------------------------------------------------

case LtvpOp:
var_op::compare(op,
arg, parameter, J, taylor, itr.op_index(), compare_change_count,
compare_change_number, compare_change_op_index
);
break;
// -------------------------------------------------

case LtvvOp:
var_op::compare(op,
arg, parameter, J, taylor, itr.op_index(), compare_change_count,
compare_change_number, compare_change_op_index
);
break;
// -------------------------------------------------

case MulpvOp:
CPPAD_ASSERT_UNKNOWN( size_t(arg[0]) < num_par );
var_op::forward_mulpv_op(p, q, i_var, arg, parameter, J, taylor);
Expand All @@ -659,30 +592,6 @@ void forward1(
break;
// -------------------------------------------------

case NeppOp:
var_op::compare(op,
arg, parameter, J, taylor, itr.op_index(), compare_change_count,
compare_change_number, compare_change_op_index
);
break;
// -------------------------------------------------

case NepvOp:
var_op::compare(op,
arg, parameter, J, taylor, itr.op_index(), compare_change_count,
compare_change_number, compare_change_op_index
);
break;
// -------------------------------------------------

case NevvOp:
var_op::compare(op,
arg, parameter, J, taylor, itr.op_index(), compare_change_count,
compare_change_number, compare_change_op_index
);
break;
// -------------------------------------------------

case ParOp:
i = p;
if( i == 0 )
Expand Down
Loading

0 comments on commit 9aa86eb

Please sign in to comment.