Changeset 9ede7e in git


Ignore:
Timestamp:
Jul 19, 1997, 10:39:15 AM (27 years ago)
Author:
Jens Schmidt <schmidt@…>
Branches:
(u'spielwiese', '82fc009ea2b0098c1a4896c841bb70860976bdfc')
Children:
616836fd7385e9d1cc5c361f6369fd4deb86c166
Parents:
dc092fa97d65f7a76e439d97475239b3359b0d9f
Message:
	* sm_util.cc: doc fix
	(interpol): doc fix


git-svn-id: file:///usr/local/Singular/svn/trunk@542 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • factory/sm_util.cc

    rdc092fa r9ede7e  
    11/* emacs edit mode for this file is -*- C++ -*- */
    2 /* $Id: sm_util.cc,v 1.1 1997-07-14 15:11:56 schmidt Exp $ */
     2/* $Id: sm_util.cc,v 1.2 1997-07-19 08:39:15 schmidt Exp $ */
    33
    44//{{{ docu
     
    77//
    88// Dependencies: Routines used by and only by sm_sparsemod.cc.
     9//
     10// Contributed by Marion Bruder <bruder@math.uni-sb.de>.
    911//
    1012//}}}
     
    5759//{{{ docu
    5860//
    59 // interpol() - ???.
     61// interpol() - Newton interpolation.
     62//
     63// Calculate f in x such that f(point) = values[1],
     64// f(points[i]) = values[i], i=2, ..., d+1.
     65// Make sure that you are calculating in a field.
     66//
     67// alpha: the values at the interpolation points (= values)
     68// punkte: the point at which we interpolate (= (point, points))
    6069//
    6170//}}}
     
    6574  CFArray alpha( 1, d+1 );
    6675  int i;
    67 
    68   // alpha sind die Werte und punkte die Punkte d.h. [punkte[i], alpha[i]]
    6976  for ( i = 1 ; i <= d+1 ; i++ )
    7077    {
     
    8693    }
    8794
     95  // calculate Newton coefficients alpha[i]
    8896  for ( k = 2 ; k <= d+1 ; k++ )
    8997    {
     
    94102    }
    95103
     104  // calculate f from Newton coefficients
    96105  CanonicalForm f = alpha [1], produkt = 1;
    97106  for ( i = 1 ; i <= d ; i++ )
    98107    {
    99108      produkt *= ( x - punkte[i] );
    100       f += ( alpha[ i + 1 ] * produkt ) ;
    101     }
    102 
    103   //else
    104   //  {
    105   // voellig unnuetze Fallunterscheidung !?
    106   //    cout << " in Lagrange " << endl;
    107   //    CanonicalForm result = 0;
    108   // Lagrange ///
    109   //    for ( i = 1; i <= d+1; i++ )
    110   //{
    111   //result += (alpha[i] * ( zaehler( i, d+1 , punkte, x)/ nenner( i, d+1, punkte )));
    112   //}
    113   //    return result;
    114   //  }
     109      f += ( alpha[i+1] * produkt ) ;
     110    }
    115111
    116112  return f;
Note: See TracChangeset for help on using the changeset viewer.