promotion image of download ymail app
Promoted

Java class Matrix...Jama ? about packages, etc...?

I want to be able to use the Matrix class. The documentation says that it's part of package Jama. How do I specify the correct package and classes at the top of my file, ie, what are the right import statements.

Is this class part of a later version of java? I'm quite new at java.

What I eventually want to do is calculate:

Z = 2*X+Y;

where Z, X, and Y are objects of class matrix. This looks like it involves overloading the '+' operator,too!

Thanks

2 Answers

Relevance
  • BalRog
    Lv 5
    1 decade ago
    Favorite Answer

    JAMA is not part of Java at all. It is third party software that is written in Java. The package associated with a given class can be specified in "import" statements near the top of the file. It is important to use the exact spelling of the package and class combination (the so-called "fully-qualified class name"), If the Matrix class is in the package "org.jama" then you want to add the following statement near the top of your Java source file (after the "package" statement, if present, but before everything else):

    ------------------------------

    import org.jama.Matrix;

    ------------------------------

    The Java language does not have operator overloading, so I expect that there are methods (member functions) in the JAMA Matrix class to do matrix-scalar multiply and matrix-matrix add.

    • Commenter avatarLogin to reply the answers
  • 1 decade ago

    I have no understanding of Java (or Jama).

    Sorry.

    Good luck

    • Commenter avatarLogin to reply the answers
Still have questions? Get your answers by asking now.