* mln/core/image/complex_image.hh
(mln::complex_image<D, P, V>::face_values): Rename as...
(mln::complex_image<D, P, V>::values): ...this.
Fix access to the array of values.
(mln::complex_image<D, P, V>::complex_image(const p_complex<D, P>&)):
Initialize faces of all dimensions, including D.
(mln::init_): Likewise.
Fix the use of values from model.
---
milena/ChangeLog | 13 +++++++++++++
milena/mln/core/image/complex_image.hh | 12 ++++++------
2 files changed, 19 insertions(+), 6 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 1b2d085..5097f23 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,18 @@
2008-10-04 Roland Levillain <roland(a)lrde.epita.fr>
+ Fix initialization and access to values in mln::complex_image.
+
+ * mln/core/image/complex_image.hh
+ (mln::complex_image<D, P, V>::face_values): Rename as...
+ (mln::complex_image<D, P, V>::values): ...this.
+ Fix access to the array of values.
+ (mln::complex_image<D, P, V>::complex_image(const p_complex<D, P>&)):
+ Initialize faces of all dimensions, including D.
+ (mln::init_): Likewise.
+ Fix the use of values from model.
+
+2008-10-04 Roland Levillain <roland(a)lrde.epita.fr>
+
Remove a warning about not used arguments in mln::fill_dispatch.
* mln/extension/fill.hh
diff --git a/milena/mln/core/image/complex_image.hh
b/milena/mln/core/image/complex_image.hh
index a9cea01..add88e9 100644
--- a/milena/mln/core/image/complex_image.hh
+++ b/milena/mln/core/image/complex_image.hh
@@ -154,7 +154,7 @@ namespace mln
const p_complex<D, P>& domain() const;
/// Return the array of values associated to the faces.
- const metal::vec<D + 1, std::vector<V> >& face_values() const;
+ const metal::vec<D + 1, std::vector<V> >& values() const;
/// \}
};
@@ -178,8 +178,8 @@ namespace mln
const complex_image<D, P, W>& model)
{
metal::vec<D + 1, std::vector<V> > values;
- for (unsigned i = 0; i < D; ++i)
- values[i].resize(model.values[i].size());
+ for (unsigned i = 0; i <= D; ++i)
+ values[i].resize(model.values()[i].size());
target.init_(model.domain(), values);
}
@@ -222,7 +222,7 @@ namespace mln
complex_image<D, P, V>::complex_image(const p_complex<D, P>& pc)
{
metal::vec<D + 1, std::vector<V> > values;
- for (unsigned i = 0; i < D; ++i)
+ for (unsigned i = 0; i <= D; ++i)
values[i].resize(pc.cplx().nfaces(i));
init_(pc, values);
}
@@ -272,9 +272,9 @@ namespace mln
template <unsigned D, typename P, typename V>
inline
const metal::vec< D + 1, std::vector<V> >&
- complex_image<D, P, V>::face_values() const
+ complex_image<D, P, V>::values() const
{
- return this->data_->val_;
+ return this->data_->values_;
}
template <unsigned D, typename P, typename V>
--
1.6.0.1