[vspline] 26/72: removed gradient.cc

Kay F. Jahnke kfj-guest at moszumanska.debian.org
Sun Jul 2 09:02:39 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 23550f64bd2e377afea2d27a5f954c4747c239ef
Author: Kay F. Jahnke <kfjahnke at gmail.com>
Date:   Wed Jan 11 10:19:17 2017 +0100

    removed gradient.cc
---
 example/gradient.cc | 90 -----------------------------------------------------
 1 file changed, 90 deletions(-)

diff --git a/example/gradient.cc b/example/gradient.cc
deleted file mode 100644
index 2a787f3..0000000
--- a/example/gradient.cc
+++ /dev/null
@@ -1,90 +0,0 @@
-/************************************************************************/
-/*                                                                      */
-/*    vspline - a set of generic tools for creation and evaluation      */
-/*              of uniform b-splines                                    */
-/*                                                                      */
-/*            Copyright 2015, 2016 by Kay F. Jahnke                     */
-/*                                                                      */
-/*    Permission is hereby granted, free of charge, to any person       */
-/*    obtaining a copy of this software and associated documentation    */
-/*    files (the "Software"), to deal in the Software without           */
-/*    restriction, including without limitation the rights to use,      */
-/*    copy, modify, merge, publish, distribute, sublicense, and/or      */
-/*    sell copies of the Software, and to permit persons to whom the    */
-/*    Software is furnished to do so, subject to the following          */
-/*    conditions:                                                       */
-/*                                                                      */
-/*    The above copyright notice and this permission notice shall be    */
-/*    included in all copies or substantial portions of the             */
-/*    Software.                                                         */
-/*                                                                      */
-/*    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND    */
-/*    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES   */
-/*    OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND          */
-/*    NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT       */
-/*    HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,      */
-/*    WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING      */
-/*    FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR     */
-/*    OTHER DEALINGS IN THE SOFTWARE.                                   */
-/*                                                                      */
-/************************************************************************/
-
-/// gradient.cc
-///
-/// If we create a b-spline over an array containing, at each grid point,
-/// the sum of the grid point's coordinates, each 1D row, column, etc will
-/// hold a linear gradient with first derivative == 1. If we use NATURAL
-/// BCs, evaluating the spline with real coordinates anywhere inside the
-/// defined range should produce precisely the sum of the coordinates.
-/// This is a good test for both the precision of the evaluation and it's
-/// correct functioning, particularly with higher-D arrays. 
-
-#include <vspline/vspline.h>
-
-using namespace std ;
-
-main ( int argc , char * argv[] )
-{
-  typedef vspline::bspline < double , 5 > spline_type ;
-  typedef typename spline_type::shape_type shape_type ;
-  typedef typename spline_type::view_type view_type ;
-  typedef typename spline_type::bcv_type bcv_type ;
-  
-  shape_type core_shape = { 10 , 4 , 13 , 9 , 6 } ;
-
-  // note how with these small array dimensions, we can't use the EXPLICIT scheme:
-  // the horizon, 12, is wider than the smallest extent, and bracing (with the current
-  // bracing code) will produce erroneous results.
-
-  spline_type bspl ( core_shape , 3 , bcv_type ( vspline::NATURAL ) ) ;
-  view_type core = bspl.core ;
-  
-  for ( int d = 0 ; d < bspl.dimension ; d++ )
-  {
-    for ( int c = 0 ; c < core_shape[d] ; c++ )
-      core.bindAt ( d , c ) += c ;
-  }
-  
-  bspl.prefilter() ;
-
-  typedef vspline::evaluator < bspl.dimension , double , double > evaluator_type ;
-  typedef typename evaluator_type::nd_rc_type coordinate_type ;
-  
-  evaluator_type ev ( bspl ) ;
-  double * ws = new double [ ev.workspace_size() ] ;
-  
-  std::random_device rd;
-  std::mt19937 gen(rd());
-  // std::mt19937 gen(12345);   // fix starting value for reproducibility
-
-  coordinate_type c ;
-  
-  for ( int times = 0 ; times < 10000 ; times++ )
-  {
-    for ( int d = 0 ; d < bspl.dimension ; d++ )
-      c[d] = ( core_shape[d] - 1 ) * std::generate_canonical<double, 20>(gen) ;
-    double delta = ev(c) - sum(c) ;
-    if ( delta > 2.0e-14 )
-      cout << c << " -> delta = " << delta << endl ;
-  }
-}
\ No newline at end of file

-- 
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