This file is indexed.

/usr/include/openturns/SampleImplementation.hxx is in libopenturns-dev 1.9-5.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
//                                               -*- C++ -*-
/**
 *  @brief The class SampleImplementation implements blank free samples
 *
 *  Copyright 2005-2017 Airbus-EDF-IMACS-Phimeca
 *
 *  This library is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU Lesser General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  along with this library.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
#ifndef OPENTURNS_SAMPLEIMPLEMENTATION_HXX
#define OPENTURNS_SAMPLEIMPLEMENTATION_HXX

#include <stdint.h> // for uint64_t

#include "openturns/Point.hxx"
#include "openturns/Description.hxx"
#include "openturns/Indices.hxx"
#include "openturns/PersistentCollection.hxx"
#include "openturns/SquareMatrix.hxx"
#include "openturns/CovarianceMatrix.hxx"
#include "openturns/CorrelationMatrix.hxx"
#include "openturns/SquareMatrix.hxx"
#include "openturns/Collection.hxx"
#include "openturns/ResourceMap.hxx"


BEGIN_NAMESPACE_OPENTURNS

#ifndef SWIG
class SampleImplementation;
class NSI_const_point;

/****************************************/


class OT_API NSI_point
{
  SampleImplementation * p_nsi_;
  UnsignedInteger index_;
  UnsignedInteger dimension_;

  friend class NSI_const_point;
  friend OT_API std::ostream & operator << (std::ostream & os, const NSI_point & point);

public:
  typedef       Scalar *       iterator;
  typedef const Scalar * const_iterator;

public:
  NSI_point(SampleImplementation * p_nsi,
            const UnsignedInteger index);

  NSI_point & operator = (const NSI_point & rhs);

  template <typename POINT>
  inline
  NSI_point & operator = (POINT rhs)
  {
    if ( getDimension() == rhs.getDimension() )
      std::copy( rhs.begin(), rhs.end(), begin() );
    return *this;
  }


  // NSI_point & operator = (const NSI_const_point & rhs);
  // NSI_point & operator = (const Point & rhs);

  Scalar & operator [] (const UnsignedInteger i);
  const Scalar & operator [] (const UnsignedInteger i) const;
  Scalar & at (const UnsignedInteger i);
  const Scalar & at (const UnsignedInteger i) const;

  inline Collection<Scalar> getCollection() const
  {
    if (dimension_ == 0) return Collection<Scalar>(0);
    return Collection<Scalar>( begin(), end() );
  }
  inline operator Point () const
  {
    return getCollection();
  }

  inline UnsignedInteger getDimension() const
  {
    return dimension_;
  }

  inline iterator begin()
  {
    return &operator[](0);
  }
  inline iterator end()
  {
    return &operator[](0) + dimension_;
  }
  inline const_iterator begin() const
  {
    return &operator[](0);
  }
  inline const_iterator end() const
  {
    return &operator[](0) + dimension_;
  }

  NSI_point & operator += (const NSI_point & other);
  NSI_point & operator -= (const NSI_point & other);
  NSI_point & operator += (const Point & other);
  NSI_point & operator -= (const Point & other);
  NSI_point & operator *= (const Scalar val);
  NSI_point & operator /= (const Scalar val);
};

OT_API bool operator == (const NSI_point & lhs, const NSI_point & rhs);
OT_API bool operator != (const NSI_point & lhs, const NSI_point & rhs);
OT_API bool operator <  (const NSI_point & lhs, const NSI_point & rhs);
OT_API bool operator >  (const NSI_point & lhs, const NSI_point & rhs);
OT_API bool operator <= (const NSI_point & lhs, const NSI_point & rhs);
OT_API bool operator >= (const NSI_point & lhs, const NSI_point & rhs);

OT_API std::ostream & operator <<(std::ostream & os, const NSI_point & point);
OT_API OStream & operator << (OStream & OS, const NSI_point & point);


class OT_API NSI_const_point
{
  const SampleImplementation * p_nsi_;
  UnsignedInteger index_;
  UnsignedInteger dimension_;

  friend OT_API std::ostream & operator << (std::ostream & os, const NSI_const_point & point);

public:
  typedef       Scalar *       iterator;
  typedef const Scalar * const_iterator;

public:
  NSI_const_point(const SampleImplementation * p_nsi, UnsignedInteger index);
  NSI_const_point(const NSI_point & point);

  const Scalar & operator [] (const UnsignedInteger i) const;
  const Scalar & at (const UnsignedInteger i) const;

  inline Collection<Scalar> getCollection() const
  {
    if (dimension_ == 0) return Collection<Scalar>(0);
    return Collection<Scalar>( begin(), end() );
  }
  inline operator Point () const
  {
    return getCollection();
  }

  inline UnsignedInteger getDimension() const
  {
    return dimension_;
  }

  inline const_iterator begin() const
  {
    return &operator[](0);
  }
  inline const_iterator end() const
  {
    return &operator[](0) + dimension_;
  }
};

OT_API bool operator == (const NSI_const_point & lhs, const NSI_const_point & rhs);
OT_API bool operator != (const NSI_const_point & lhs, const NSI_const_point & rhs);
OT_API bool operator <  (const NSI_const_point & lhs, const NSI_const_point & rhs);
OT_API bool operator >  (const NSI_const_point & lhs, const NSI_const_point & rhs);
OT_API bool operator <= (const NSI_const_point & lhs, const NSI_const_point & rhs);
OT_API bool operator >= (const NSI_const_point & lhs, const NSI_const_point & rhs);

OT_API std::ostream & operator <<(std::ostream & os, const NSI_const_point & point);
OT_API OStream & operator << (OStream & OS, const NSI_const_point & point);


inline
Point operator * (const NSI_point & point,
                  const Scalar val)
{
  Point res(point.getDimension(), 0.);
  for(UnsignedInteger i = 0; i < point.getDimension(); ++i) res[i] = point[i] * val;
  return res;
}

inline
Point operator * (const Scalar val,
                  const NSI_point & point)
{
  return point * val;
}

inline
Point operator * (const NSI_const_point & point,
                  const Scalar val)
{
  Point res(point.getDimension(), 0.);
  for(UnsignedInteger i = 0; i < point.getDimension(); ++i) res[i] = point[i] * val;
  return res;
}

inline
Point operator * (const Scalar val,
                  const NSI_const_point & point)
{
  return point * val;
}




/****************************************/


class OT_API NSI_iterator
{
  SampleImplementation * p_nsi_;
  UnsignedInteger current_;

public:
  typedef size_t difference_type;
  typedef std::random_access_iterator_tag iterator_category;
  typedef NSI_point value_type;
  typedef NSI_point * pointer;
  typedef NSI_point   reference;

  friend class NSI_const_iterator;
  friend bool operator == (const NSI_iterator & lhs, const NSI_iterator & rhs);
  friend bool operator <  (const NSI_iterator & lhs, const NSI_iterator & rhs);
  friend bool operator >  (const NSI_iterator & lhs, const NSI_iterator & rhs);
  friend difference_type operator - (const NSI_iterator & lhs, const NSI_iterator & rhs);

public:
  NSI_iterator() : p_nsi_(0), current_(0) {}
  NSI_iterator(SampleImplementation & nsi, const UnsignedInteger index) : p_nsi_(&nsi), current_(index) {}

  inline NSI_iterator & operator ++ ()
  {
    ++current_;
    return *this;
  }
  inline NSI_iterator & operator -- ()
  {
    --current_;
    return *this;
  }
  inline NSI_iterator   operator ++ (int)
  {
    NSI_iterator old(*this);
    ++current_;
    return old;
  }
  inline NSI_iterator   operator -- (int)
  {
    NSI_iterator old(*this);
    --current_;
    return old;
  }

  inline NSI_iterator & operator += (difference_type n)
  {
    current_ += n;
    return *this;
  }
  inline NSI_iterator & operator -= (difference_type n)
  {
    current_ -= n;
    return *this;
  }
  inline NSI_iterator   operator +  (difference_type n) const
  {
    NSI_iterator old(*this);
    old.current_ += n;
    return old;
  }
  inline NSI_iterator   operator -  (difference_type n) const
  {
    NSI_iterator old(*this);
    old.current_ -= n;
    return old;
  }

  inline NSI_point operator *  () const
  {
    return NSI_point(p_nsi_, current_);
  }
};

inline
bool operator == (const NSI_iterator & lhs, const NSI_iterator & rhs)
{
  return (lhs.p_nsi_ == rhs.p_nsi_) && (lhs.current_ == rhs.current_);
}

inline
bool operator != (const NSI_iterator & lhs, const NSI_iterator & rhs)
{
  return ! (lhs == rhs);
}

inline
bool operator < (const NSI_iterator & lhs, const NSI_iterator & rhs)
{
  return (lhs.p_nsi_ == rhs.p_nsi_) && (lhs.current_ < rhs.current_);
}

inline
bool operator > (const NSI_iterator & lhs, const NSI_iterator & rhs)
{
  return (lhs.p_nsi_ == rhs.p_nsi_) && (lhs.current_ > rhs.current_);
}

inline
NSI_iterator::difference_type operator - (const NSI_iterator & lhs, const NSI_iterator & rhs)
{
  return (lhs.current_ - rhs.current_);
}




class OT_API NSI_const_iterator
{
  const SampleImplementation * p_nsi_;
  UnsignedInteger current_;

public:
  typedef size_t difference_type;
  typedef std::random_access_iterator_tag iterator_category;
  typedef NSI_const_point value_type;
  typedef NSI_const_point * pointer;
  typedef NSI_const_point   reference;

  friend bool operator == (const NSI_const_iterator & lhs, const NSI_const_iterator & rhs);
  friend bool operator <  (const NSI_const_iterator & lhs, const NSI_const_iterator & rhs);
  friend bool operator >  (const NSI_const_iterator & lhs, const NSI_const_iterator & rhs);
  friend difference_type operator - (const NSI_const_iterator & lhs, const NSI_const_iterator & rhs);

public:
  NSI_const_iterator() : p_nsi_(0), current_(0) {}
  NSI_const_iterator(const SampleImplementation & nsi, const UnsignedInteger index) : p_nsi_(&nsi), current_(index) {}
  NSI_const_iterator(const NSI_iterator & iter) : p_nsi_(iter.p_nsi_), current_(iter.current_) {}

  inline NSI_const_iterator & operator ++ ()
  {
    ++current_;
    return *this;
  }
  inline NSI_const_iterator & operator -- ()
  {
    --current_;
    return *this;
  }
  inline NSI_const_iterator   operator ++ (int)
  {
    NSI_const_iterator old(*this);
    ++current_;
    return old;
  }
  inline NSI_const_iterator   operator -- (int)
  {
    NSI_const_iterator old(*this);
    --current_;
    return old;
  }

  inline NSI_const_iterator & operator += (difference_type n)
  {
    current_ += n;
    return *this;
  }
  inline NSI_const_iterator & operator -= (difference_type n)
  {
    current_ -= n;
    return *this;
  }
  inline NSI_const_iterator   operator +  (difference_type n) const
  {
    NSI_const_iterator old(*this);
    old.current_ += n;
    return old;
  }
  inline NSI_const_iterator   operator -  (difference_type n) const
  {
    NSI_const_iterator old(*this);
    old.current_ -= n;
    return old;
  }

  inline NSI_const_point operator *  () const
  {
    return NSI_const_point(p_nsi_, current_);
  }
};

inline
bool operator == (const NSI_const_iterator & lhs, const NSI_const_iterator & rhs)
{
  return (lhs.p_nsi_ == rhs.p_nsi_) && (lhs.current_ == rhs.current_);
}

inline
bool operator != (const NSI_const_iterator & lhs, const NSI_const_iterator & rhs)
{
  return ! (lhs == rhs);
}

inline
bool operator < (const NSI_const_iterator & lhs, const NSI_const_iterator & rhs)
{
  return (lhs.p_nsi_ == rhs.p_nsi_) && (lhs.current_ < rhs.current_);
}

inline
bool operator > (const NSI_const_iterator & lhs, const NSI_const_iterator & rhs)
{
  return (lhs.p_nsi_ == rhs.p_nsi_) && (lhs.current_ > rhs.current_);
}

inline
NSI_const_iterator::difference_type operator - (const NSI_const_iterator & lhs, const NSI_const_iterator & rhs)
{
  return (lhs.current_ - rhs.current_);
}

#endif


/****************************************/



/**
 * @class SampleImplementation
 */

class OT_API SampleImplementation
  : public PersistentObject
{
  CLASSNAME;
  friend class NSI_point;
  friend class NSI_const_point;
  friend class NSI_iterator;
  friend class NSI_const_iterator;
  friend class Factory<SampleImplementation>;
  friend class BuildMethodMap;
  friend class ExportMethodMap;
#ifndef SWIG
  friend OT_API Bool operator ==(const SampleImplementation & lhs, const SampleImplementation & rhs);
#endif

public:

  /* Some typedefs for easy reading */
  typedef NSI_iterator               iterator;
  typedef NSI_const_iterator         const_iterator;
  typedef       Scalar *       data_iterator;
  typedef const Scalar * const_data_iterator;

  typedef Collection<UnsignedInteger>   UnsignedIntegerCollection;

  enum ExternalFileFormat { CSV };

public:

  /** Factory of SampleImplementation from CSV file */
  static SampleImplementation BuildFromCSVFile(const FileName & fileName,
      const String & csvSeparator = ResourceMap::Get( "csv-file-separator" ));

  /** Factory of SampleImplementation from Text file */
  static SampleImplementation BuildFromTextFile(const FileName & fileName,
      const String & separator = " ");

  /** Store a sample in a temporary text file, one realization by line. Returns the file name. */
  String storeToTemporaryFile() const;

  /** Export a sample as a matrix, one row by realization, in a format suitable to exchange with R */
  String streamToRFormat() const;

protected:

  /**
   * Default constructor is protected
   */
  SampleImplementation();

public:

  /** Standard constructor */
  SampleImplementation(const UnsignedInteger size,
                       const UnsignedInteger dim);

  /** Constructor from a Point */
  SampleImplementation(const UnsignedInteger size,
                       const Point & point);

#ifndef SWIG
  /** Constructor from a collection of Point */
  SampleImplementation(const Collection<Point> & coll);

  /** Constructor from a collection of Indices */
  SampleImplementation(const Collection<Indices> & coll);

  /** Partial copy constructor */
  SampleImplementation(const SampleImplementation & other,
                       const_iterator first,
                       const_iterator last);

  inline iterator begin()
  {
    return iterator(*this, 0);
  }
  inline iterator end()
  {
    return iterator(*this, size_);
  }
  inline const_iterator begin() const
  {
    return const_iterator(*this, 0);
  }
  inline const_iterator end() const
  {
    return const_iterator(*this, size_);
  }

  inline data_iterator data_begin()
  {
    return &data_[0];
  }
  inline data_iterator data_end()
  {
    return &data_[0] + size_ * dimension_;
  }
  inline const_data_iterator data_begin() const
  {
    return &data_[0];
  }
  inline const_data_iterator data_end() const
  {
    return &data_[0] + size_ * dimension_;
  }

  void erase(const UnsignedInteger first, const UnsignedInteger last);
  void erase(iterator first, iterator last);
  void clear();

  /** Raw internal format accessor */
  Point getData() const;
  void setData(const Collection<Scalar> & data);

  inline NSI_point operator [] (const UnsignedInteger index)
  {
    return NSI_point(this, index);
  }
  inline NSI_const_point operator [] (const UnsignedInteger index) const
  {
    return NSI_const_point(this, index);
  }

  void swap_points(const UnsignedInteger a, const UnsignedInteger b);
  void swap_range_points(const UnsignedInteger fa, const UnsignedInteger ta, const UnsignedInteger fb);
#endif
  // These functions are only intended to be used by SWIG, DO NOT use them for your own purpose !
  // INTENTIONALY NOT DOCUMENTED
  const Scalar * __baseaddress__ () const
  {
    return &data_[0];
  }
  UnsignedInteger __elementsize__ () const
  {
    return sizeof( Scalar );
  }

  /** Virtual constructor */
  virtual SampleImplementation * clone() const;

  /** Description Accessor */
  void setDescription(const Description & description);
  Description getDescription() const;

  /**
   * String converter
   * This method shows human readable information on the
   * internal state of an SampleImplementation. It is used when streaming
   * the SampleImplementation or for user information.
   */
  virtual String __repr__() const;
  virtual String __str__(const String & offset = "") const;

  inline Bool __eq__(const SampleImplementation & rhs) const
  {
    return (*this == rhs);
  }

  /** Whether the list contains the value val */
  Bool contains(const Point & val) const;

  /** Size accessor */
  inline UnsignedInteger getSize() const
  {
    return size_;
  }

  /** Dimension accessor */
  inline UnsignedInteger getDimension() const
  {
    return dimension_;
  }

  /** Appends an element to the collection */
  SampleImplementation & add(const Point & point);

  /** Appends another sample to the collection */
  SampleImplementation & add(const SampleImplementation & sample);

  /** Stack a sample to the current one */
  SampleImplementation & stack(const SampleImplementation & sample);

  /**
   * Gives the mean of the sample, based on the formula
   * mean = sum of the elements in the sample / size of the sample
   */
  virtual Point computeMean() const;

  /**
   * Gives the covariance matrix of the sample, normalization by 1 / (size - 1) if size > 1
   */
  virtual CovarianceMatrix computeCovariance() const;

  /**
   * Gives the standard deviation of the sample, i.e. the square-root of the covariance matrix.
   */
  TriangularMatrix computeStandardDeviation() const;

  /**
   * Gives the standard deviation of each component of the sample
   */
  virtual Point computeStandardDeviationPerComponent() const;

  /**
   * Gives the Pearson correlation matrix of the sample
   */
  virtual CorrelationMatrix computeLinearCorrelation() const;
  virtual CorrelationMatrix computePearsonCorrelation() const;

  /**
   * Gives the Spearman correlation matrix of the sample
   */
  virtual CorrelationMatrix computeSpearmanCorrelation() const;

  /**
   * Gives the Kendall correlation matrix of the sample
   */
  virtual CorrelationMatrix computeKendallTau() const;

  /**
   * Gives the range of the sample (by component)
   */
  Point computeRange() const;

  /**
   * Gives the median of the sample (by component)
   */
  Point computeMedian() const;

  /**
   * Gives the variance of the sample (by component)
   */
  virtual Point computeVariance() const;

  /**
   * Gives the skewness of the sample (by component)
   */
  virtual Point computeSkewness() const;

  /**
   * Gives the kurtosis of the sample (by component)
   */
  virtual Point computeKurtosis() const;

  /**
   * Gives the centered moment of order k of the sample (by component)
   */
  Point computeCenteredMoment(const UnsignedInteger k) const;

  /**
   * Gives the raw moment of order k of the sample (by component)
   */
  Point computeRawMoment(const UnsignedInteger k) const;

  /**
   * Gives the quantile per component of the sample
   */
  virtual Point computeQuantilePerComponent(const Scalar prob) const;

  /**
   * Gives the N-dimension quantile of the sample
   */
  Point computeQuantile(const Scalar prob) const;

  /**
   * Get the empirical CDF of the sample
   */
  Scalar computeEmpiricalCDF(const Point & point,
                             const Bool tail = false) const;

  /** Maximum accessor */
  virtual Point getMax() const;

  /** Minimum accessor */
  virtual Point getMin() const;

  /** Ranked sample */
  SampleImplementation rank() const;

  /** Ranked component */
  SampleImplementation rank(const UnsignedInteger index) const;

  /** Sorted sample */
  SampleImplementation sort() const;

  /** Sorted component */
  SampleImplementation sort(const UnsignedInteger index) const;

  /** Sorted component */
  SampleImplementation sortAccordingToAComponent(const UnsignedInteger index) const;

  /* Sorted and duplicated points removed */
  SampleImplementation sortUnique() const;

  /** Get the i-th marginal sample */
  SampleImplementation getMarginal(const UnsignedInteger index) const;

  /** Get the marginal sample corresponding to indices dimensions */
  SampleImplementation getMarginal(const Indices & indices) const;

  /**
   * Translate realizations in-place
   */
  SampleImplementation & operator += (const Scalar translation);
  SampleImplementation & operator += (const Point & translation);
  SampleImplementation & operator += (const SampleImplementation & translation);
  SampleImplementation & operator -= (const Scalar translation);
  SampleImplementation & operator -= (const Point & translation);
  SampleImplementation & operator -= (const SampleImplementation & translation);

  /** Translate realizations */
  SampleImplementation operator + (const Scalar translation) const;
  SampleImplementation operator + (const Point & translation) const;
  SampleImplementation operator + (const SampleImplementation & translation) const;
  SampleImplementation operator - (const Scalar translation) const;
  SampleImplementation operator - (const Point & translation) const;
  SampleImplementation operator - (const SampleImplementation & translation) const;

  SampleImplementation operator * (const Scalar scaling) const;
  SampleImplementation operator * (const Point & scaling) const;
  SampleImplementation operator * (const SquareMatrix & scaling) const;
  SampleImplementation operator / (const Scalar scaling) const;
  SampleImplementation operator / (const Point & scaling) const;
  SampleImplementation operator / (const SquareMatrix & scaling) const;

  /**
   * Scale realizations componentwise in-place
   */

  SampleImplementation & operator *= (const Scalar scaling);
  SampleImplementation & operator *= (const Point & scaling);
  SampleImplementation & operator *= (const SquareMatrix & scaling);
  SampleImplementation & operator /= (const Scalar scaling);
  SampleImplementation & operator /= (const Point & scaling);
  SampleImplementation & operator /= (const SquareMatrix & scaling);

  /** Save to CSV file */
  void exportToCSVFile(const FileName & filename,
                       const String & csvSeparator = ResourceMap::Get( "csv-file-separator" )) const;

  /** Method save() stores the object through the StorageManager */
  virtual void save(Advocate & adv) const;

  /** Method load() reloads the object from the StorageManager */
  virtual void load(Advocate & adv);


private:
  void translate(const Point & translation);
  void scale(const Point & scaling);
  void scale(const SquareMatrix & scaling);

  /** The size of the sample */
  UnsignedInteger size_;

  /** The dimension of the sample */
  UnsignedInteger dimension_;

  /** The collection of unwrapped points */
  PersistentCollection<Scalar> data_;

  /** The description of all components */
  Pointer<Description> p_description_;

}; /* class SampleImplementation */


/* Comparison function */
OT_API Bool operator ==(const SampleImplementation & lhs, const SampleImplementation & rhs);


END_NAMESPACE_OPENTURNS

#endif /* OPENTURNS_SAMPLEIMPLEMENTATION_HXX */