~ubuntu-branches/ubuntu/vivid/quantlib-swig/vivid

« back to all changes in this revision

Viewing changes to CSharp/csharp/BFGS.cs

  • Committer: Bazaar Package Importer
  • Author(s): Dirk Eddelbuettel
  • Date: 2009-12-03 17:01:53 UTC
  • mfrom: (1.1.9 upstream) (2.1.6 sid)
  • Revision ID: james.westby@ubuntu.com-20091203170153-x5yrwybjsl2q11vw
* New upstream release

* debian/control: Updated Standards-Version: to current value

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* ----------------------------------------------------------------------------
 
2
 * This file was automatically generated by SWIG (http://www.swig.org).
 
3
 * Version 1.3.40
 
4
 *
 
5
 * Do not make changes to this file unless you know what you are doing--modify
 
6
 * the SWIG interface file instead.
 
7
 * ----------------------------------------------------------------------------- */
 
8
 
 
9
namespace QuantLib {
 
10
 
 
11
using System;
 
12
using System.Runtime.InteropServices;
 
13
 
 
14
public class BFGS : OptimizationMethod {
 
15
  private HandleRef swigCPtr;
 
16
 
 
17
  internal BFGS(IntPtr cPtr, bool cMemoryOwn) : base(NQuantLibcPINVOKE.BFGSUpcast(cPtr), cMemoryOwn) {
 
18
    swigCPtr = new HandleRef(this, cPtr);
 
19
  }
 
20
 
 
21
  internal static HandleRef getCPtr(BFGS obj) {
 
22
    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
 
23
  }
 
24
 
 
25
  ~BFGS() {
 
26
    Dispose();
 
27
  }
 
28
 
 
29
  public override void Dispose() {
 
30
    lock(this) {
 
31
      if (swigCPtr.Handle != IntPtr.Zero) {
 
32
        if (swigCMemOwn) {
 
33
          swigCMemOwn = false;
 
34
          NQuantLibcPINVOKE.delete_BFGS(swigCPtr);
 
35
        }
 
36
        swigCPtr = new HandleRef(null, IntPtr.Zero);
 
37
      }
 
38
      GC.SuppressFinalize(this);
 
39
      base.Dispose();
 
40
    }
 
41
  }
 
42
 
 
43
  public BFGS() : this(NQuantLibcPINVOKE.new_BFGS(), true) {
 
44
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
 
45
  }
 
46
 
 
47
}
 
48
 
 
49
}