Skip to main content

Expression Templates in Ada

  • Conference paper
  • First Online:
  • 230 Accesses

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 2043))

Abstract

High-order matrix or vector expressions tend to be penalized by the use of huge temporary variables. Expression templates is a C++ technique which can be used to avoid these temporaries, in a way that is transparent to the user. We present an Ada adaptation of this technique which — while not transparent — addresses the same efficiency issue as the original. We make intensive use of the signature idiom to combine packages together, and discuss its importance in generic programming. Finally, we express some concerns about generic programming in Ada.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Luca Cardelli and Peter Wegner. On understanding types, data abstraction, and polymorphism. Computing Surveys, 17(4):471–522, December 1985.

    Article  Google Scholar 

  2. Alexandre Duret-Lutz, Thierry Géraud, and Akim Demaille. Design patterns for generic programming in C++. In Proceedings of the 6th USENIX Conference on Object-Oriented Technologies and Systems (COOTS’01), San Antonio, Texas, USA, July 2001. To appear.

    Google Scholar 

  3. Ulfar Erlingsson and Alexander V. Konstantinou. Implementing the C++ Standard Template Library in Ada 95. Technical Report TR96-3, CS Dept., Rensselaer Polytechnic Institute, Troy, NY, January 1996.

    Google Scholar 

  4. Geoffrey Furnish. Disambiguated glommable expression templates. Computers in Physics, 11(3):263–269, May/June 1997. Republished in [5].

    Google Scholar 

  5. Geoffrey Furnish. Disambiguated glommable expression templates. C++ report, May 2000.

    Google Scholar 

  6. Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides. Design patterns–Elements of reusable object-oriented software. Professional Computing Series. Addison Wesley, 1995.

    Google Scholar 

  7. Scott W. Haney. Beating the abstraction penalty in C++ using expression templates. Computers in Physics, 10(6):552–557, Nov/Dec 1996.

    Google Scholar 

  8. Intermetrics, Inc., Cambridge, Massachusetts. Ada 95 Rationale, January 1995.

    Google Scholar 

  9. Alexander V. Konstantinou, Ulfar Erlingsson, and David R. Musser. Ada standard generic library. source code, 1998.

    Google Scholar 

  10. Brian McNamara and Yannis Smaragdakis. Static interfaces in C++. In First Workshop on C++ Template Programming, Erfurt, Germany, October 10 2000.

    Google Scholar 

  11. David R. Musser, editor. Dagstuhl seminar on Generic Programming, SchloβDagstuhl, Wadern, Germany, April–May 1998.

    Google Scholar 

  12. David R. Musser and Alexandre A. Stepanov. Generic programming projects and open problems. 1998.

    Google Scholar 

  13. Nathan C. Myers. Traits: a new and useful template technique. C++ Report, 7(5):32–35, June 1995.

    Google Scholar 

  14. Jeremy Siek and Andrew Lumsdaine. Concept checking: Binding parametric polymorphism in C++. In First Workshop on C++ Template Programming, Erfurt, Germany, October 10 2000.

    Google Scholar 

  15. Alex Stepanov. Al Stevens Interviews Alex Stepanov. Dr. Dobb’s Journal, March 1995.

    Google Scholar 

  16. Alex Stepanov and Meng Lee. The Standard Template Library. Hewlett Packard Laboratories, 1501 Page Mill Road, Palo Alto, CA 94304, October 1995.

    Google Scholar 

  17. Todd Veldhuizen. Using C++ template metaprograms. C++ Report, 7(4):36–43, May 1995. Reprinted in C++ Gems, ed. Stanley Lippman.

    Google Scholar 

  18. Todd L. Veldhuizen. Expression templates. C++ Report, 7(5):26–31, June 1995.

    Google Scholar 

  19. Todd L. Veldhuizen. Using C++ trait classes for scientific computing, March 1996.

    Google Scholar 

  20. Todd L. Veldhuizen. Arrays in blitz++. In Proceedings of the 2nd International Scientific Computing in Object-Oriented Parallel Environments (ISCOPE’98), Lecture Notes in Computer Science. Springer-Verlag, 1998.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2001 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Duret-Lutz, A. (2001). Expression Templates in Ada. In: Craeynest, D., Strohmeier, A. (eds) Reliable SoftwareTechnologies — Ada-Europe 2001. Ada-Europe 2001. Lecture Notes in Computer Science, vol 2043. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-45136-6_15

Download citation

  • DOI: https://doi.org/10.1007/3-540-45136-6_15

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-42123-8

  • Online ISBN: 978-3-540-45136-5

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics