Skip to content

Commit bf039c0

Browse files
Dominic Pricekpeeters
authored andcommitted
Fixes to allow building on Linux
1 parent 5a2026a commit bf039c0

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

core/pythoncdb/py_algorithms.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,15 @@ namespace cadabra
9696
def_algo<complete, Ex>(m, "complete", false, false, 0, py::arg("add"));
9797
def_algo<decompose, Ex>(m, "decompose", false, false, 0, py::arg("basis"));
9898
def_algo<drop_weight, Ex>(m, "drop_weight", false, false, 0, py::arg("condition"));
99-
def_algo<eliminate_metric, Ex>(m, "eliminate_metric", true, false, 0, py::arg("preferred") = Ex_ptr());
99+
def_algo<eliminate_metric, Ex>(m, "eliminate_metric", true, false, 0, py::arg("preferred") = Ex{});
100100
def_algo<keep_weight, Ex>(m, "keep_weight", false, false, 0, py::arg("condition"));
101101
def_algo<lower_free_indices, bool>(m, "lower_free_indices", true, false, 0, py::arg("lower") = true);
102102
def_algo<lower_free_indices, bool>(m, "raise_free_indices", true, false, 0, py::arg("lower") = false);
103103
def_algo<integrate_by_parts, Ex>(m, "integrate_by_parts", true, false, 0, py::arg("away_from"));
104104
def_algo<young_project_tensor, bool>(m, "young_project_tensor", true, false, 0, py::arg("modulo_monoterm") = false);
105105
def_algo<join_gamma, bool, bool>(m, "join_gamma", true, false, 0, py::arg("expand") = true, py::arg("use_gendelta") = false);
106-
def_algo<einsteinify, Ex>(m, "einsteinify", true, false, 0, py::arg("metric") = Ex_ptr());
107-
def_algo<evaluate, Ex, bool, bool>(m, "evaluate", false, false, 0, py::arg("components") = Ex_ptr(), py::arg("rhsonly") = false, py::arg("simplify") = true);
106+
def_algo<einsteinify, Ex>(m, "einsteinify", true, false, 0, py::arg("metric") = Ex{});
107+
def_algo<evaluate, Ex, bool, bool>(m, "evaluate", false, false, 0, py::arg("components") = Ex{}, py::arg("rhsonly") = false, py::arg("simplify") = true);
108108
def_algo<keep_terms, std::vector<int>>(m, "keep_terms", true, false, 0, py::arg("terms"));
109109
def_algo<young_project, std::vector<int>, std::vector<int>>(m, "young_project", true, false, 0, py::arg("shape"), py::arg("indices"));
110110
def_algo<simplify>(m, "simplify", false, false, 0);
@@ -125,7 +125,7 @@ namespace cadabra
125125
def_algo_preorder<vary, Ex>(m, "vary", false, false, 0, py::arg("rules"));
126126
def_algo<split_gamma, bool>(m, "split_gamma", true, false, 0, py::arg("on_back"));
127127
def_algo<split_index, Ex>(m, "split_index", true, false, 0, py::arg("rules"));
128-
def_algo<unwrap, Ex>(m, "unwrap", true, false, 0, py::arg("wrapper") = Ex_ptr());
128+
def_algo<unwrap, Ex>(m, "unwrap", true, false, 0, py::arg("wrapper") = Ex{});
129129

130130
}
131-
}
131+
}

core/pythoncdb/py_algorithms.hh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ namespace cadabra
1111
template <class Algo, typename... Args>
1212
Ex_ptr apply_algo(Ex_ptr ex, Args... args, bool deep, bool repeat, unsigned int depth)
1313
{
14-
Algo algo(*get_kernel_from_scope(), *ex, std::forward<Args>(args)...);
14+
Algo algo(*get_kernel_from_scope(), *ex, args...);
1515

1616
Ex::iterator it = ex->begin();
1717
if (ex->is_valid(it)) {
18-
ProgressMonitor* pm = get_progress_monitor();
18+
//ProgressMonitor* pm = get_progress_monitor();
1919
ex->update_state(algo.apply_generic(it, deep, repeat, depth));
2020
call_post_process(*get_kernel_from_scope(), ex);
2121
}
@@ -40,11 +40,11 @@ namespace cadabra
4040
template <class Algo, typename... Args>
4141
Ex_ptr apply_algo_preorder(Ex_ptr ex, Args... args, bool deep, bool repeat, unsigned int depth)
4242
{
43-
Algo algo(*get_kernel_from_scope(), *ex, std::forward<Args>(args)...);
43+
Algo algo(*get_kernel_from_scope(), *ex, args...);
4444

4545
Ex::iterator it = ex->begin();
4646
if (ex->is_valid(it)) {
47-
ProgressMonitor* pm = get_progress_monitor();
47+
//ProgressMonitor* pm = get_progress_monitor();
4848
ex->update_state(algo.apply_pre_order(repeat));
4949
call_post_process(*get_kernel_from_scope(), ex);
5050
}

core/pythoncdb/py_properties.hh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <memory>
77
#include <pybind11/pybind11.h>
88
#include "py_ex.hh"
9+
#include "py_kernel.hh"
910
#include "properties/LaTeXForm.hh"
1011

1112
namespace cadabra
@@ -144,4 +145,4 @@ namespace cadabra
144145

145146
void init_properties(pybind11::module& m);
146147

147-
}
148+
}

0 commit comments

Comments
 (0)