~ubuntu-branches/ubuntu/maverick/openturns/maverick

« back to all changes in this revision

Viewing changes to python/test/t_UserDefined_std.py

  • Committer: Bazaar Package Importer
  • Author(s): Fabrice Coutadeur
  • Date: 2010-05-10 17:27:55 UTC
  • mfrom: (1.1.4 upstream) (5.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20100510172755-cb5ynskknqqi5rhp
Tags: 0.13.2-2ubuntu1
* Merge with Debian testing. No changes left.
* ubuntu_fix-python-2.6.patch: fix detection of python 2.6 libs, to not use
  LOCALMODLIBS. This pulls a dependency on SSL and makes the package FTBFS.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
    collection[0] = UserDefinedPair(point,0.30)
16
16
 
17
17
    point[0] = 2.0
18
 
    collection[1] = UserDefinedPair(point,0.20)
 
18
    collection[1] = UserDefinedPair(point,0.10)
19
19
 
20
20
    point[0] = 3.0
21
 
    collection[2] = UserDefinedPair(point,0.50)
 
21
    collection[2] = UserDefinedPair(point,0.60)
22
22
 
23
23
    distribution = UserDefined(collection)
24
 
    print  "Distribution " , distribution 
 
24
    print  "Distribution " , distribution
25
25
 
26
26
    # Is this distribution elliptical ?
27
27
    print "Elliptical = ", distribution.isElliptical()
31
31
 
32
32
    # Test for realization of distribution
33
33
    oneRealization = distribution.getRealization()
34
 
    print "oneRealization=", repr(oneRealization) 
 
34
    print "oneRealization=", repr(oneRealization)
35
35
 
36
36
    # Test for sampling
37
37
    size = 10
38
38
    oneSample = distribution.getNumericalSample( size )
39
 
    print "oneSample=Ok", oneSample 
 
39
    print "oneSample=Ok", repr(oneSample)
40
40
 
41
41
    # Define a point
42
 
    point = NumericalPoint( distribution.getDimension(), 2 )
 
42
    point = NumericalPoint( distribution.getDimension(), 2.0 )
43
43
 
44
44
    # Show PDF and CDF of a point
45
45
    pointPDF = distribution.computePDF( point )
46
46
    pointCDF = distribution.computeCDF( point )
47
47
    print "point= ", repr(point), " pdf=", pointPDF, " cdf=", pointCDF
48
 
           
 
48
 
49
49
    # Get 95% quantile
50
50
    quantile = distribution.computeQuantile( 0.95 )
51
 
    print "Quantile=", repr(quantile) 
 
51
    print "Quantile=", repr(quantile)
52
52
 
53
53
except :
54
 
  import sys
55
 
  print "t_UserDefined_std.py", sys.exc_type, sys.exc_value
 
54
    import sys
 
55
    print "t_UserDefined_std.py", sys.exc_type, sys.exc_value