[vspline] 50/72: committing changes in map.h before branching

Kay F. Jahnke kfj-guest at moszumanska.debian.org
Sun Jul 2 09:02:42 UTC 2017


This is an automated email from the git hooks/post-receive script.

kfj-guest pushed a commit to branch master
in repository vspline.

commit 4f6ceb3e7dc1f9b160a057ee3167c9de09a16852
Author: Kay F. Jahnke <kfjahnke at gmail.com>
Date:   Sun Apr 23 10:24:11 2017 +0200

    committing changes in map.h before branching
---
 map.h           | 9 +++++----
 unary_functor.h | 7 ++++++-
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/map.h b/map.h
index cb8437c..b403d77 100644
--- a/map.h
+++ b/map.h
@@ -44,7 +44,7 @@
     Incoming coordinates may not be inside the range which can be evaluated
     by the spline. There is no one correct way of dealing with out-of-bounds
     coordinates, so we provide a few common ways of do it, and also offer
-    the users a way to provide their own handling.
+    users a way to provide their own handling.
     
     The basic type handling the operation is 'gate_type', which 'treats'
     a single value or single simdized type. For nD coordinates, we use a
@@ -55,8 +55,9 @@
     the gate_types and applies them to the components in turn.
     
     The final mapper object is a functor which converts an arbitrary incoming
-    coordinate into an in-range coordinate (or, for REJECT mode, throws an
-    out_of_bounds exception).
+    coordinate into an treated coordinate (or, for REJECT mode, throws an
+    out_of_bounds exception). If the treatment succeeded to produce a
+    suitable in-range coordinate, accessing the evaluator with it is safe.
     
     We provide code to pass coordinates through unmodified, to
     reject out-of-bounds values, to clamp them, set them to a fixed value,
@@ -510,7 +511,7 @@ struct mapper
   // finally, the implementation of struct mapper's map() method is
   // simple: we delegate to a _map object for the highest axis.
   // note how this code will handle singular and vectorized coordinates
-  // alike; the gate object can handle either.
+  // alike; the gate objects can handle either.
   
   template < typename nd_rc_type >
   void operator() ( const nd_rc_type & in ,
diff --git a/unary_functor.h b/unary_functor.h
index e8979ed..d324ec5 100644
--- a/unary_functor.h
+++ b/unary_functor.h
@@ -91,7 +91,7 @@ struct unary_functor
   typedef typename vigra::ExpandElementResult < IN > :: type in_ele_type ;
   typedef typename vigra::ExpandElementResult < OUT > :: type out_ele_type ;
   
-  /// for single coordinates we require an eval() taking a const& to a
+  /// for single inputs we require an eval() taking a const& to a
   /// single coordinate and a reference to the place where the result should
   /// be deposited.
 
@@ -143,6 +143,11 @@ struct unary_functor
   /// inside the method. This is provided as utility code by class
   /// vspline::unary_functor and is pulled in with a using declaration
   /// in the macro using_unary_functor_types, see below.
+  /// When implementing this method for a class derived from unary_functor,
+  /// note that in_v and out_v are always TinyVectors, even if they are 1D
+  /// only. In this case you must access c[0] and/or result[0] in your code,
+  /// even though the 'natural' thing would be to use no indices for 1D types.
+  /// The overrides below allow you to *use* eval with singular simdized types.
 
    virtual void eval ( const in_v & c ,             // simdized nD input
                        out_v & result ) const = 0 ; // simdized mD output

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/vspline.git



More information about the debian-science-commits mailing list