Debian Codegraph @

C++/Include/tbl_val.h

raw symbols SCIP
1 /*
2 * Definition of Lorene class Tbl_val
3 *
4 */
5
6 /*
7 * Copyright (c) 2001 Jerome Novak
8 *
9 * This file is part of LORENE.
10 *
11 * LORENE is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * LORENE is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with LORENE; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 *
25 */
26
27
28 #ifndef __TBL_VAL_H_
29 #define __TBL_VAL_H_
30
31 /*
32 * $Id: tbl_val.h,v 1.12 2014/10/13 08:52:37 j_novak Exp $
33 * $Log: tbl_val.h,v $
34 * Revision 1.12 2014/10/13 08:52:37 j_novak
35 * Lorene classes and functions now belong to the namespace Lorene.
36 *
37 * Revision 1.11 2014/10/06 15:09:40 j_novak
38 * Modified #include directives to use c++ syntax.
39 *
40 * Revision 1.10 2012/01/17 10:21:31 j_penner
41 * function added: Heaviside
42 *
43 * Revision 1.9 2010/04/14 11:45:24 j_novak
44 * Changed comments
45 *
46 * Revision 1.8 2007/11/02 15:45:56 j_novak
47 * Added an ugly method "append_array", which substitutes the argument to the
48 * main array t.
49 *
50 * Revision 1.7 2005/06/22 09:09:38 lm_lin
51 *
52 * Grid wedding: convert from the old C++ object "Cmp" to "Scalar".
53 *
54 * Revision 1.6 2004/11/26 17:02:18 j_novak
55 * Added a function giving a smooth transition to the atmosphere.
56 *
57 * Revision 1.5 2004/03/22 13:12:43 j_novak
58 * Modification of comments to use doxygen instead of doc++
59 *
60 * Revision 1.4 2002/11/13 11:22:57 j_novak
61 * Version "provisoire" de l'interpolation (sommation depuis la grille
62 * spectrale) aux interfaces de la grille de Valence.
63 *
64 * Revision 1.3 2002/11/12 10:03:53 j_novak
65 * The method "Tbl_val::get_gval" has been changed to "get_grid".
66 *
67 * Revision 1.2 2002/10/16 14:36:29 j_novak
68 * Reorganization of #include instructions of standard C++, in order to
69 * use experimental version 3 of gcc.
70 *
71 * Revision 1.1 2001/11/22 13:38:09 j_novak
72 * added Include files for Valencia objects: tbl_val.h and grille_val.h
73 *
74 *
75 * $Header: /cvsroot/Lorene/C++/Include/tbl_val.h,v 1.12 2014/10/13 08:52:37 j_novak Exp $
76 *
77 */
78
79 // Fichiers includes
80 #include <cassert>
81 #include <cstdlib>
82
83 #include "grille_val.h"
84 #include "tensor.h"
85
86 namespace Lorene {
87 class Grille_val ;
88
89 /**
90 * Finite-difference array intended to store field values.\ingroup (mdm)
91 *
92 * Class defined on a cartesian (\c Gval_cart ) or spherical
93 * (\c Gval_spher ) grid, in order to represent
94 * Godunov-type arrays in 1,2 or 3D.
95 *
96 */
97 class Tbl_val {
98
99 // Data :
100 // -----
101 private:
102 /// logical state (\c ETATNONDEF , \c ETATQCQ or \c ETATZERO ).
103 int etat ;
104 /**
105 * The \c Dim_tbl giving the dimensions and number of points (without
106 * the hidden cells).
107 */
108 const Dim_tbl* dim ;
109 /// The \c Grille_val (cartesian or spherical) on which the array is defined
110 const Grille_val* gval ;
111
112 public:
113 /// The array of \c double at the nodes
114 double* t ;
115 /// The array at z (or r) interfaces
116 double* tzri ;
117 /// The array at x (or \f$\theta\f$) interfaces
118 double* txti ;
119 /// The array at y (or \f$\phi\f$) interfaces
120 double* typi ;
121
122 // Constructors - Destructor
123 // -------------------------
124
125 public:
126 /// Constructor from a 3D grid
127 explicit Tbl_val(const Grille_val* ) ;
128 /// Constructor from a file (see \c sauve(FILE*) )
129 explicit Tbl_val(const Grille_val*, FILE* ) ;
130 /// Copy constructor
131 Tbl_val(const Tbl_val& ) ;
132
133 /// Destructor
134 ~Tbl_val() ;
135
136 // Assignement
137 // -----------
138 /// Assignment to another \c Tbl_val
139 void operator=(const Tbl_val& ) ;
140 /// Assignment to a \c double
141 void operator=(double ) ;
142 /// Assignment to a \c int
143 void operator=(int ) ;
144
145 // Memory management
146 // -----------------
147 private:
148 /** Logical destructor: dellocates the memory occupied by the array
149 * \c t and sets the logical state to ETATNONDEF.
150 */
151 void del_t() ;
152
153 public:
154
155 /**
156 * Sets the logical state to \c ETATNONDEF (undefined).
157 * Deallocates the memory occupied by the \c double array \c t .
158 */
159 void set_etat_nondef() ;
160
161 /**
162 * Sets the logical state to \c ETATZERO (zero).
163 * Deallocates the memory occupied by the \c double array \c t .
164 */
165 void set_etat_zero() ;
166
167 /**
168 * Sets the logical state to \c ETATQCQ (ordinary state).
169 * If the state (member \c etat ) is already \c ETATQCQ , this
170 * function does nothing. Otherwise, it performs the memory allocation
171 * for the \c double array \c t .
172 */
173 void set_etat_qcq() ;
174
175 /**
176 * Appends an array of doubles as the main array \c t of \c this
177 * (\b DO \b NOT use it, unless you \b REALLY know how it works).
178 */
179 void append_array(double* t_in) ;
180
181 /**
182 * Sets the \c Tbl_val to zero in a hard way.
183 * 1/ Sets the logical state to \c ETATQCQ , i.e. to an ordinary state.
184 * 2/ Allocates the memory of the \c double array \c t , and fills it
185 * with zeros. NB: this function must be used for debugging purposes only.
186 * For other operations, the function \c set_etat_zero() must
187 * be perferred.
188 */
189 void annule_hard() ;
190
191 // Access to individual elements
192 // -----------------------------
193 public:
194 /// Read/write of a particular element (index \c i ) (1D case)
195 double& set(int i) {
196 assert (etat == ETATQCQ) ;
197 assert( dim->ndim == 1 ) ;
198 int fant = gval->get_fantome() ;
199 assert( i >= - fant) ;
200 assert( i < dim->dim[0] + fant) ;
201 return t[i + fant] ;
202 } ;
203
204 /// Read/write of a particular element on the interface (index \c i ) (1D case)
205 double& set_zri(int i) {
206 assert (etat == ETATQCQ) ;
207 assert( dim->ndim == 1 ) ;
208 int fant = gval->get_fantome() ;
209 assert( i >= -fant ) ;
210 assert( i < dim->dim[0] + fant + 1) ;
211 return tzri[i+fant] ;
212 } ;
213
214 /// Read-only of a particular element (index \c i ) (1D case)
215 double operator()(int i) const {
216 assert(etat != ETATNONDEF) ;
217 assert( dim->ndim == 1 ) ;
218 int fant = gval->get_fantome() ;
219 assert( i >= -fant ) ;
220 assert( i < dim->dim[0] + fant ) ;
221 if (etat == ETATZERO) {
222 double zero = 0. ;
223 return zero ;
224 }
225 else return t[i+fant] ;
226 };
227
228 /// Read-only of a particular element on the interface (index \c i ) (1D case)
229 double get_zri(int i) const {
230 assert(etat != ETATNONDEF) ;
231 assert( dim->ndim == 1 ) ;
232 int fant = gval->get_fantome() ;
233 assert( i >= -fant ) ;
234 assert( i < dim->dim[0] + fant +1) ;
235 if (etat == ETATZERO) {
236 double zero = 0. ;
237 return zero ;
238 }
239 else return tzri[i+fant] ;
240 };
241
242 /// Read/write of a particular element (index \c (j,i) ) (2D case)
243 double& set(int j, int i) {
244 assert (etat == ETATQCQ) ;
245 assert( dim->ndim == 2 ) ;
246 int fant = gval->get_fantome() ;
247 assert( (i>=-fant) && (i<dim->dim[0]+fant) ) ;
248 assert( (j>=-fant) && (j<dim->dim[1]+fant) ) ;
249 return t[(dim->dim[0] +2*fant)* (j+fant) + i + fant] ;
250 };
251
252 /**
253 * Read/write of a particular element on the x (or \f$\theta\f$)
254 * interface (index \c (j,i) ) (2D case)
255 */
256 double& set_xti(int j, int i) {
257 assert (etat == ETATQCQ) ;
258 assert( dim->ndim == 2 ) ;
259 int fant = gval->get_fantome() ;
260 assert( (i>=-fant) && (i<dim->dim[0]+fant) ) ;
261 assert( (j>=-fant) && (j<dim->dim[1]+fant+1) ) ;
262 return txti[(dim->dim[0] +2*fant)*(j+fant) + i + fant] ;
263 };
264
265 /**
266 * Read/write of a particular element on the z (or r)
267 * interface (index \c (j,i) ) (2D case)
268 */
269 double& set_zri(int j, int i) {
270 assert (etat == ETATQCQ) ;
271 assert( dim->ndim == 2 ) ;
272 int fant = gval->get_fantome() ;
273 assert( (i>=-fant) && (i<dim->dim[0] + fant+1) ) ;
274 assert( (j>=-fant) && (j<dim->dim[1] + fant) ) ;
275 return tzri[(dim->dim[0] +2*fant+1)*(j+fant) + i + fant] ;
276 };
277
278 /// Read-only of a particular element (index \c (j,i) ) (2D case)
279 double operator()(int j, int i) const {
280 assert(etat != ETATNONDEF) ;
281 assert( dim->ndim == 2 ) ;
282 int fant = gval->get_fantome() ;
283 assert( (i>=-fant) && (i<dim->dim[0] + fant) ) ;
284 assert( (j>=-fant) && (j<dim->dim[1] + fant) ) ;
285 if (etat == ETATZERO) {
286 double zero = 0. ;
287 return zero ;
288 }
289 else return t[(dim->dim[0] + 2*fant) *(j+fant) + i + fant] ;
290 };
291
292 /**
293 * Read-only of a particular element on the x (or \f$\theta\f$) interface
294 * (index \c (j,i) ) (2D case)
295 */
296 double get_xti(int j, int i) const {
297 assert(etat != ETATNONDEF) ;
298 assert( dim->ndim == 2 ) ;
299 int fant = gval->get_fantome() ;
300 assert( (i>=-fant) && (i<dim->dim[0] + fant) ) ;
301 assert( (j>=-fant) && (j<dim->dim[1] + fant + 1) ) ;
302 if (etat == ETATZERO) {
303 double zero = 0. ;
304 return zero ;
305 }
306 else return txti[(dim->dim[0] + 2*fant) *(j+fant) + i + fant] ;
307 };
308
309 /**
310 * Read-only of a particular element on the z (or r) interface
311 * (index \c (j,i) ) (2D case)
312 */
313 double get_zri(int j, int i) const {
314 assert(etat != ETATNONDEF) ;
315 assert( dim->ndim == 2 ) ;
316 int fant = gval->get_fantome() ;
317 assert( (i>=-fant) && (i<dim->dim[0] + fant + 1) ) ;
318 assert( (j>=-fant) && (j<dim->dim[1] + fant) ) ;
319 if (etat == ETATZERO) {
320 double zero = 0. ;
321 return zero ;
322 }
323 else return tzri[(dim->dim[0] + 2*fant + 1) *(j+fant) + i + fant] ;
324 };
325
326 /// Read/write of a particular element (index \c (k,j,i) ) (3D case)
327 double& set(int k, int j, int i) {
328 assert (etat == ETATQCQ) ;
329 assert( dim->ndim == 3 ) ;
330 int fant = gval->get_fantome() ;
331 assert( (i>=-fant) && (i<dim->dim[0] + fant) ) ;
332 assert( (j>=-fant) && (j<dim->dim[1] + fant) ) ;
333 assert( (k>=-fant) && (k<dim->dim[2] + fant) ) ;
334 return t[(dim->dim[1]+2*fant)*(dim->dim[0]+2*fant)*(k+fant) +
335 (dim->dim[0]+2*fant)*(j+fant) + i +fant] ;
336 };
337
338 /**
339 * Read/write of a particular element on the y (or \f$\phi\f$)
340 * interface (index \c (k,j,i) ) (3D case)
341 */
342 double& set_ypi(int k, int j, int i) {
343 assert (etat == ETATQCQ) ;
344 assert( dim->ndim == 3 ) ;
345 int fant = gval->get_fantome() ;
346 assert( (i>=-fant) && (i<dim->dim[0] + fant) ) ;
347 assert( (j>=-fant) && (j<dim->dim[1] + fant) ) ;
348 assert( (k>=-fant) && (k<dim->dim[2] + fant + 1) ) ;
349 return typi[(dim->dim[1]+2*fant)*(dim->dim[0]+2*fant)*(k+fant) +
350 (dim->dim[0]+2*fant)*(j+fant) + i +fant] ;
351 };
352
353 /**
354 * Read/write of a particular element on the x (or \f$\theta\f$)
355 * interface (index \c (k,j,i) ) (3D case)
356 */
357 double& set_xti(int k, int j, int i) {
358 assert (etat == ETATQCQ) ;
359 assert( dim->ndim == 3 ) ;
360 int fant = gval->get_fantome() ;
361 assert( (i>=-fant) && (i<dim->dim[0] + fant) ) ;
362 assert( (j>=-fant) && (j<dim->dim[1] + fant + 1) ) ;
363 assert( (k>=-fant) && (k<dim->dim[2] + fant) ) ;
364 return txti[(dim->dim[1]+2*fant+1)*(dim->dim[0]+2*fant)*(k+fant) +
365 (dim->dim[0]+2*fant)*(j+fant) + i +fant] ;
366 };
367
368 /**
369 * Read/write of a particular element on the z (or r)
370 * interface (index \c (k,j,i) ) (3D case)
371 */
372 double& set_zri(int k, int j, int i) {
373 assert (etat == ETATQCQ) ;
374 assert( dim->ndim == 3 ) ;
375 int fant = gval->get_fantome() ;
376 assert( (i>=-fant) && (i<dim->dim[0] + fant + 1) ) ;
377 assert( (j>=-fant) && (j<dim->dim[1] + fant) ) ;
378 assert( (k>=-fant) && (k<dim->dim[2] + fant) ) ;
379 return tzri[(dim->dim[1]+2*fant)*(dim->dim[0]+2*fant+1)*(k+fant) +
380 (dim->dim[0]+2*fant+1)*(j+fant) + i +fant] ;
381 };
382
383 /// Read-only of a particular element (index \c (k,j,i) ) (3D case)
384 double operator()(int k, int j, int i) const {
385 assert(etat != ETATNONDEF) ;
386 assert( dim->ndim == 3 ) ;
387 int fant = gval->get_fantome() ;
388 assert( (i>=-fant) && (i<dim->dim[0] + fant) ) ;
389 assert( (j>=-fant) && (j<dim->dim[1] + fant) ) ;
390 assert( (k>=-fant) && (k<dim->dim[2] + fant) ) ;
391 if (etat == ETATZERO) {
392 double zero = 0. ;
393 return zero ;
394 }
395 else return t[(dim->dim[1]+2*fant)*(dim->dim[0]+2*fant)*(k+fant)
396 + (dim->dim[0]+2*fant)*(j+fant) + i +fant] ;
397 };
398
399 /**
400 * Read-only of a particular element on the y (or \f$\phi\f$) interface
401 * (index \c (k,j,i) ) (3D case)
402 */
403 double get_ypi(int k, int j, int i) const {
404 assert(etat != ETATNONDEF) ;
405 assert( dim->ndim == 3 ) ;
406 int fant = gval->get_fantome() ;
407 assert( (i>=-fant) && (i<dim->dim[0] + fant) ) ;
408 assert( (j>=-fant) && (j<dim->dim[1] + fant) ) ;
409 assert( (k>=-fant) && (k<dim->dim[2] + fant + 1) ) ;
410 if (etat == ETATZERO) {
411 double zero = 0. ;
412 return zero ;
413 }
414 else return typi[(dim->dim[1]+2*fant)*(dim->dim[0]+2*fant)*(k+fant)
415 + (dim->dim[0]+2*fant)*(j+fant) + i +fant] ;
416 };
417
418 /**
419 * Read-only of a particular element on the x (or \f$\theta\f$) interface
420 * (index \c (k,j,i) ) (3D case)
421 */
422 double get_xti(int k, int j, int i) const {
423 assert(etat != ETATNONDEF) ;
424 assert( dim->ndim == 3 ) ;
425 int fant = gval->get_fantome() ;
426 assert( (i>=-fant) && (i<dim->dim[0] + fant) ) ;
427 assert( (j>=-fant) && (j<dim->dim[1] + fant + 1) ) ;
428 assert( (k>=-fant) && (k<dim->dim[2] + fant) ) ;
429 if (etat == ETATZERO) {
430 double zero = 0. ;
431 return zero ;
432 }
433 else return txti[(dim->dim[1]+2*fant+1)*(dim->dim[0]+2*fant)*(k+fant)
434 + (dim->dim[0]+2*fant)*(j+fant) + i +fant] ;
435 };
436
437 /**
438 * Read-only of a particular element on the z (or r) interface
439 * (index \c (k,j,i) ) (3D case)
440 */
441 double get_zri(int k, int j, int i) const {
442 assert(etat != ETATNONDEF) ;
443 assert( dim->ndim == 3 ) ;
444 int fant = gval->get_fantome() ;
445 assert( (i>=-fant) && (i<dim->dim[0] + fant + 1) ) ;
446 assert( (j>=-fant) && (j<dim->dim[1] + fant) ) ;
447 assert( (k>=-fant) && (k<dim->dim[2] + fant) ) ;
448 if (etat == ETATZERO) {
449 double zero = 0. ;
450 return zero ;
451 }
452 else return tzri[(dim->dim[1]+2*fant)*(dim->dim[0]+2*fant+1)*(k+fant)
453 + (dim->dim[0]+2*fant+1)*(j+fant) + i +fant] ;
454 };
455
456 // Extraction of information
457 // -------------------------
458 /// Gives the logical state
459 int get_etat() const { return etat ; };
460
461 /// Gives the size of the node array (including the hidden cells)
462 int get_taille() const {
463 int resu = 1 ;
464 for (int i=0; i<dim->ndim; i++)
465 resu *= dim->dim[i] + 2*(gval->get_fantome()) ;
466 return resu ; };
467
468 /// Gives the size of the interface arrays (including the hidden cells)
469 int get_taille_i(int i) const {
470 assert (i<dim->ndim) ;
471 int resu = 1 ;
472 for (int j=0; j<dim->ndim; j++)
473 if (j!=i) {
474 resu *= dim->dim[j] + 2*gval->get_fantome() ;
475 }
476 else {
477 resu *= dim->dim[j] + 2*gval->get_fantome() + 1 ;
478 }
479 return resu ; };
480
481 /// Gives the number of dimensions (ie \c dim->ndim )
482 int get_ndim() const { return dim->ndim ; };
483
484 /// Gives the \c i th dimension (ie \c dim->dim[i] , without hidden cells)
485 int get_dim(int i) const {
486 assert( (i>=0) && (i<dim->ndim) ) ;
487 return dim->dim[i] ;
488 };
489
490 /// Returns a pointer on the grid on which the \c Tbl_val is defined
491 const Grille_val* get_grille() const { return gval ; } ;
492
493 // Outputs
494 // -------
495 public:
496 /// Save in a file
497 void sauve(FILE* ) const ;
498
499 /** Prints only the values greater than a given threshold.
500 * @param ostr [input] Output stream used for the printing
501 * @param precision [input] Number of printed digits (default: 4)
502 * @param threshold [input] Value above which an array element is printed
503 * (default: 1.e-7)
504 */
505 void affiche_seuil(ostream& ostr, int precision = 4,
506 double threshold = 1.e-7) const ;
507 /// Display
508 friend ostream& operator<<(ostream& , const Tbl_val& ) ;
509
510 // Member arithmetics
511 // ------------------
512 public:
513
514 /// Addition of a \c Tbl_val to \c this
515 void operator+=(const Tbl_val &) ;
516 /// Addition of a \c double to \c this
517 void operator+=(double) ;
518 /// Subtraction of a \c Tbl_val to \c this
519 void operator-=(const Tbl_val &) ;
520 /// Subtraction of a \c double to \c this
521 void operator-=(double) ;
522 /// Multiplication of \c this by a \c Tbl_val
523 void operator*=(const Tbl_val &) ;
524 /// Multiplication of \c this by a \c double
525 void operator*=(double) ;
526 /// Division of \c this by a \c Tbl_val
527 void operator/=(const Tbl_val &) ;
528 /// Division of \c this by a \c double
529 void operator/=(double) ;
530
531 /**
532 * Interpolation from a \c Tbl_val to a \c Scalar . The
533 * \c Scalar is evaluated only in zones [lmin, lmax[.
534 * @param map [input] The \c Mapping to which the \c Tbl_val is
535 * interpolated. The symetries of both grids must be
536 * the same (see \c Mg3d and \c Grille_val
537 * documentation), and the spectral grid (between lmin
538 * and lmax-1) must be included in the Godunov one.
539 * The number of points in \f$\theta\f$ and \f$\phi\f$ of the
540 * spectral grid may be different/domain. Still, the
541 * domain with the highest number of points in \f$\theta\f$
542 * (resp.\f$\phi\f$) must contain the collocation points
543 * @param lmax [input] index of the outer zone \b +1
544 * @param lmin [input] index of the inner zone
545 * @param type_inter [input] type of interpolation: \\
546 * 0 -> uses the \c INSMTS routine of second derivative minimization\\
547 * 1 -> linear interpolation\\
548 * 2 -> parabolic interpolation\\
549 * 3 -> spline interpolation (not implemented yet)\\
550 * @return Scalar containing the value of the field at spectral collocation
551 * points.
552 */
553 Scalar to_spectral(const Map& map, const int lmax, const int lmin=0,
554 int type_inter = 2) const ;
555
556 /**
557 * Interpolation from a \c Scalar to a \c Tbl_val (spectral
558 * summation). The \c Scalar is considered only in zones [lmin,lmax[.
559 * @param meudon [input] The \c Scalar from which the interpolation is done
560 * @param lmax [input] index of the outer zone \b +1
561 * @param lmin [input] index of the inner zone
562 */
563 void from_spectral(const Scalar& meudon, int lmax, int lmin=0,
564 bool interfr = false, bool interft = false) ;
565
566
567 void smooth_atmosphere(double atmosphere_thr) ;
568 } ;
569
570
571 /**
572 * \defgroup tbl_val_m Tbl_val Mathematics
573 * \ingroup (mdm)
574 * @{
575 */
576
577 /// + Tbl_val
578 Tbl_val operator+(const Tbl_val&) ;
579 /// \c - Tbl_val
580 Tbl_val operator-(const Tbl_val&) ;
581 /// Tbl_val + Tbl_val
582 Tbl_val operator+(const Tbl_val&, const Tbl_val&) ;
583 /// Tbl_val + double
584 Tbl_val operator+(const Tbl_val&, double) ;
585 /// double + Tbl_val
586 Tbl_val operator+(double, const Tbl_val&) ;
587 /// Tbl_val + int
588 Tbl_val operator+(const Tbl_val&, int) ;
589 /// int + Tbl_val
590 Tbl_val operator+(int, const Tbl_val&) ;
591 /// Tbl_val - Tbl_val
592 Tbl_val operator-(const Tbl_val&, const Tbl_val&) ;
593 /// Tbl_val - double
594 Tbl_val operator-(const Tbl_val&, double) ;
595 /// double - Tbl_val
596 Tbl_val operator-(double, const Tbl_val&) ;
597 /// Tbl_val - int
598 Tbl_val operator-(const Tbl_val&, int) ;
599 /// int - Tbl_val
600 Tbl_val operator-(int, const Tbl_val&) ;
601 /// Tbl_val * Tbl_val
602 Tbl_val operator*(const Tbl_val&, const Tbl_val&) ;
603 /// Tbl_val * double
604 Tbl_val operator*(const Tbl_val&, double) ;
605 /// double * Tbl_val
606 Tbl_val operator*(double, const Tbl_val&) ;
607 /// Tbl_val * int
608 Tbl_val operator*(const Tbl_val&, int) ;
609 /// int * Tbl_val
610 Tbl_val operator*(int, const Tbl_val&) ;
611 /// Tbl_val / Tbl_val
612 Tbl_val operator/(const Tbl_val&, const Tbl_val&) ;
613 /// Tbl_val / double
614 Tbl_val operator/(const Tbl_val&, double) ;
615 /// double / Tbl_val
616 Tbl_val operator/(double, const Tbl_val&) ;
617 /// Tbl_val / int
618 Tbl_val operator/(const Tbl_val&, int) ;
619 /// int / Tbl_val
620 Tbl_val operator/(int, const Tbl_val&) ;
621
622 /// Sine
623 Tbl_val sin(const Tbl_val& ) ;
624 /// Cosine
625 Tbl_val cos(const Tbl_val& ) ;
626 /// Tangent
627 Tbl_val tan(const Tbl_val& ) ;
628 /// Arcsine
629 Tbl_val asin(const Tbl_val& ) ;
630 /// Arccosine
631 Tbl_val acos(const Tbl_val& ) ;
632 /// Arctangent
633 Tbl_val atan(const Tbl_val& ) ;
634 /// Exponential
635 Tbl_val exp(const Tbl_val& ) ;
636 /// Heaviside Function
637 Tbl_val Heaviside(const Tbl_val& ) ;
638 /// Neperian logarithm
639 Tbl_val log(const Tbl_val& ) ;
640 /// Basis 10 logarithm
641 Tbl_val log10(const Tbl_val& ) ;
642 /// Square root
643 Tbl_val sqrt(const Tbl_val& ) ;
644 /// cube root
645 Tbl_val racine_cubique (const Tbl_val&) ;
646 /// Power \f${\tt Tbl_val}^{\tt int}\f$
647 Tbl_val pow(const Tbl_val& , int ) ;
648 /// Power \f${\tt Tbl_val}^{\tt double}\f$
649 Tbl_val pow(const Tbl_val& , double ) ;
650 /// Absolute value
651 Tbl_val abs(const Tbl_val& ) ;
652 /// Maximum value of the \c Tbl_val elements
653 double max(const Tbl_val& ) ;
654 /// Minimum value of the \c Tbl_val elements
655 double min(const Tbl_val& ) ;
656
657 /// Sum of the absolute values of all the \c Tbl_val elements
658 double norme(const Tbl_val& ) ;
659
660 /**
661 * Relative difference between two \c Tbl_val (norme version).
662 * Returns \c norme(a-b)/norme(b) unless \c b=0 , in which
663 * case it returns \c norme(a-b) .
664 */
665 double diffrel(const Tbl_val& a, const Tbl_val& b) ;
666
667 /**
668 * Relative difference between two \c Tbl_val (max version).
669 * Returns \c max(abs(a-b))/max(abs(b)) unless \c b=0 , in which
670 * case it returns \c max(abs(a-b)) .
671 */
672 double diffrelmax(const Tbl_val& a, const Tbl_val& b) ;
673
674 /** @} */
675
676 }
677 #endif
678