~ubuntu-branches/ubuntu/raring/blitz++/raring

« back to all changes in this revision

Viewing changes to blitz/update.h

  • Committer: Bazaar Package Importer
  • Author(s): Konstantinos Margaritis
  • Date: 2005-02-28 20:25:01 UTC
  • mfrom: (2.1.2 hoary)
  • Revision ID: james.westby@ubuntu.com-20050228202501-3i4f2sknnprsqfhz
Tags: 1:0.8-4
Added missing build-depends (Closes: #297323)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// -*- C++ -*-
1
2
/***************************************************************************
2
3
 * blitz/update.h      Declaration of the _bz_XXXX updater classes
3
4
 *
4
 
 * $Id: update.h,v 1.1.1.1 2000/06/19 12:26:10 tveldhui Exp $
 
5
 * $Id: update.h,v 1.5 2004/03/09 21:55:31 julianc Exp $
5
6
 *
6
 
 * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org>
 
7
 * Copyright (C) 1997-2001 Todd Veldhuizen <tveldhui@oonumerics.org>
7
8
 *
8
9
 * This program is free software; you can redistribute it and/or
9
10
 * modify it under the terms of the GNU General Public License
21
22
 * For more information, please see the Blitz++ Home Page:
22
23
 *    http://oonumerics.org/blitz/
23
24
 *
24
 
 ***************************************************************************
25
 
 * $Log: update.h,v $
26
 
 * Revision 1.1.1.1  2000/06/19 12:26:10  tveldhui
27
 
 * Imported sources
28
 
 *
29
 
 * Revision 1.5  1998/03/14 00:04:47  tveldhui
30
 
 * 0.2-alpha-05
31
 
 *
32
 
 * Revision 1.4  1997/07/16 14:51:20  tveldhui
33
 
 * Update: Alpha release 0.2 (Arrays)
34
 
 *
35
 
 * Revision 1.3  1997/01/24 14:42:00  tveldhui
36
 
 * Periodic RCS update
37
 
 *
38
 
 * Revision 1.2  1997/01/23 03:28:28  tveldhui
39
 
 * Periodic RCS update
40
 
 *
41
 
 * Revision 1.1  1997/01/13 22:19:58  tveldhui
42
 
 * Periodic RCS update
43
 
 *
44
 
 *
45
 
 */
 
25
 ***************************************************************************/
46
26
 
47
27
#ifndef BZ_UPDATE_H
48
28
#define BZ_UPDATE_H
49
29
 
50
 
#ifndef BZ_BLITZ_H
51
 
 #include <blitz/blitz.h>
52
 
#endif
 
30
#include <blitz/blitz.h>
53
31
 
54
32
BZ_NAMESPACE(blitz)
55
33
 
56
34
class _bz_updater_base { };
57
35
 
58
 
#define BZ_DECL_UPDATER(name,op,symbol)               \
59
 
  template<class X, class Y>                          \
60
 
  class name : public _bz_updater_base {              \
61
 
  public:                                             \
62
 
    static inline void update(X& _bz_restrict x, Y y) \
63
 
    { x op y; }                                       \
64
 
    static void prettyPrint(string& str)              \
65
 
    { str += symbol; }                                \
 
36
#define BZ_DECL_UPDATER(name,op,symbol)                     \
 
37
  template<typename X, typename Y>                          \
 
38
  class name : public _bz_updater_base {                    \
 
39
  public:                                                   \
 
40
    static inline void update(X& restrict x, Y y)           \
 
41
    { x op y; }                                             \
 
42
    static void prettyPrint(BZ_STD_SCOPE(string) &str)      \
 
43
    { str += symbol; }                                      \
66
44
  }
67
45
 
68
 
template<class X, class Y>
 
46
template<typename X, typename Y>
69
47
class _bz_update : public _bz_updater_base {
70
48
  public:
71
 
    static inline void update(X& _bz_restrict x, Y y)
 
49
    static inline void update(X& restrict x, Y y)
72
50
    { x = (X)y; }
73
51
 
74
 
    static void prettyPrint(string& str)
 
52
    static void prettyPrint(BZ_STD_SCOPE(string) &str)
75
53
    { str += "="; }
76
54
};
77
55