Assembla home | Assembla project page
 

Changeset 152

Show
Ignore:
Timestamp:
05/06/08 06:11:58 (5 months ago)
Author:
snovik
Message:

Fix: fix on Vector constructor with increament
Fix: CrankNicolson? class is made public
Optimisation: BoundedGrid? is using Vector ctor logic

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/QLNet/QLNet/Math/Vector.cs

    r145 r152  
    4343        /*! \brief creates the array and fills it according to \f$ a_{0} = value, a_{i}=a_{i-1}+increment \f$ */ 
    4444        public Vector(int size, double value, double increment) : this(size) { 
    45             for (int i = 0; i < this.Count; i++
    46                 this[i] = value += increment
     45            for (int i = 0; i < this.Count; i++, value += increment
     46                this[i] = value
    4747        } 
    4848 
  • trunk/QLNet/QLNet/Methods/Finitedifferences/cranknicolson.cs

    r131 r152  
    2828        Also, it must implement at least the following interface: 
    2929 
    30         \code 
    31         typedef ... array_type; 
    32  
    33         // copy constructor/assignment 
    34         // (these will be provided by the compiler if none is defined) 
    35         Operator(const Operator&); 
    36         Operator& operator=(const Operator&); 
    37  
    38         // inspectors 
    39         Size size(); 
    40  
    41         // modifiers 
    42         void setTime(Time t); 
    43  
    44         // operator interface 
    45         array_type applyTo(const array_type&); 
    46         array_type solveFor(const array_type&); 
    47         static Operator identity(Size size); 
    48  
    49         // operator algebra 
    50         Operator operator*(Real, const Operator&); 
    51         Operator operator+(const Operator&, const Operator&); 
    52         Operator operator+(const Operator&, const Operator&); 
    53         \endcode 
    54  
    5530        \warning The differential operator must be linear for 
    5631                 this evolver to work. 
     
    5833        \ingroup findiff 
    5934    */ 
    60     class CrankNicolson<Operator> : MixedScheme<Operator>, ISchemeFactory where Operator : IOperator, new()
     35    public class CrankNicolson<Operator> : MixedScheme<Operator>, ISchemeFactory where Operator : IOperator
    6136        // constructors 
    6237        public CrankNicolson() { }  // required for generics 
  • trunk/QLNet/QLNet/grid.cs

    r110 r152  
    3333 
    3434        public static Vector BoundedGrid(double xMin, double xMax, int steps) { 
    35             Vector result = new Vector(steps + 1); 
    36             double x = xMin, dx = (xMax - xMin) / steps; 
    37             for (int i = 0; i < steps + 1; i++, x += dx) 
    38                 result[i] = x; 
    39             return result; 
     35            return new Vector(steps + 1, xMin, (xMax - xMin) / steps); 
    4036        } 
    4137