31 for (
int i = 1; i <
weights.size() - 1; i++)
47 for (
const int step :
steps_)
49 assert(step > 0 && step <
weights.size());
68 const double tmp =
obj_->value_unweighted_step(i,
x);
76 Eigen::MatrixXd terms;
84 terms.col(i) =
weights[i] *
obj_->compute_adjoint_rhs_step(i,
x, state, diff_cache);
85 if (
obj_->depends_on_step_prev() && i > 0)
86 terms.col(i - 1) =
weights[i] *
obj_->compute_adjoint_rhs_step_prev(i,
x, state, diff_cache);
93 gradv.setZero(
x.size());
101 obj_->compute_partial_gradient_step(i,
x, tmp);
115 return obj_->is_step_valid(x0, x1);
120 return obj_->max_step_size(x0, x1);
125 obj_->line_search_begin(x0, x1);
130 obj_->line_search_end();
135 obj_->post_step(data);
147 obj_->solution_changed_step(i, new_x);
152 return obj_->is_step_collision_free(x0, x1);
161 vals(j++) =
obj_->value_unweighted_step(i,
x);
169 Eigen::MatrixXd terms;
175 vals(j) =
obj_->value_unweighted_step(i,
x);
176 terms.col(j++) =
obj_->compute_adjoint_rhs_step(i,
x, state, diff_cache);
185 out.col(i) = terms.col(j) * (g(j) *
weight());
194 Eigen::MatrixXd terms;
195 terms.setZero(
x.size(),
steps_.size());
201 vals(j) =
obj_->value_unweighted_step(i,
x);
202 obj_->compute_partial_gradient_step(i,
x, tmp);
203 terms.col(j++) = tmp;
211 return 1. /
y.array().inverse().sum();
216 return y.array().pow(-2.0) * pow(
eval(
y), 2);
ElementAssemblyValues vals
Storage for additional data required by differntial code.
main class that contains the polyfem solver and all its state