Skip to main content

Lightweight Abstraction for Mathematical Computation in Java

  • Conference paper
Computer Algebra in Scientific Computing (CASC 2012)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 7442))

Included in the following conference series:

  • 864 Accesses

Abstract

Many object-oriented programming languages provide type safety by allowing programmers to introduce distinct object types. In the case of Java, having objects as the sole abstraction mechanism also introduces a considerable or even prohibitive cost, especially when dealing with small objects over primitive types. Consequently, Java library implementations frequently avoid abstraction and are not type safe in practice. Many applications, including computer algebra, use values logically belonging to many different non-interchangable types. Languages such as Java are then either unsafe or inefficient to use in these applications. We present a solution allowing type safety in Java with little performance penalty. We do this by introducing a specialzed kind of object that provides distinct types for type checking, but which can always be removed entirely at compile time. In our implementation, programs are compiled twice, first with objects to verify type safety, and then with the objects removed for efficiency. This gives significant performance gains across a range of tests, including the generic SciGMark tests.

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

Access this chapter

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

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Brown, W.E.: Progress toward Opaque Typedefs for C++0X (2005)

    Google Scholar 

  2. Johnston, B.: Java programming today. Pearson Prentice Hall, Upper Saddle River (2004)

    Google Scholar 

  3. Koffman, E.B.: Objects, abstraction, data structures and design using Java. John Wiley and Sons (2005)

    Google Scholar 

  4. Sun Microsystems, Inc. Annotations (2004), http://java.sun.com/j2se/1.5.0/docs/guide/language/annotations.html

  5. Watt, S.M.: Aldor. In: Grabmeier, J., Kaltofen, E., Weispfenning, V. (eds.) Handbook of Computer Algebra, pp. 265–270. Springer, Heidelberg (2003)

    Google Scholar 

  6. The Apache Ant Project (2010), http://ant.apache.org

  7. Bourdykine, P.: Type Safety without Objects in Java, MSc. Thesis, U. Western Ontario (2009)

    Google Scholar 

  8. Miller, B., Pozo, R.: SciMark 2.0 Java Benchmark. National Institute of Standards and Technology (2004)

    Google Scholar 

  9. Dragan, L., Watt, S.M.: Performance Analysis of Generics for Scientific Computing. In: Proc. SYNASC 2005, pp. 93–100. IEEE Press (2005)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2012 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Bourdykine, P., Watt, S.M. (2012). Lightweight Abstraction for Mathematical Computation in Java. In: Gerdt, V.P., Koepf, W., Mayr, E.W., Vorozhtsov, E.V. (eds) Computer Algebra in Scientific Computing. CASC 2012. Lecture Notes in Computer Science, vol 7442. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-32973-9_5

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-32973-9_5

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-32972-2

  • Online ISBN: 978-3-642-32973-9

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics