Java Doc for Multiplication.java in  » Apache-Harmony-Java-SE » java-package » java » math » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Apache Harmony Java SE » java package » java.math 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.math.Multiplication

Multiplication
class Multiplication (Code)
Static library that provides all multiplication of BigInteger methods.
author:
   Intel Middleware Product Division
author:
   Instituto Tecnologico de Cordoba


Field Summary
final static  BigIntegerbigFivePows
     An array with the first powers of five in BigInteger version.
final static  BigInteger[]bigTenPows
     An array with the first powers of ten in BigInteger version.
final static  intfivePows
     An array with powers of five that fit in the type int .
final static  inttenPows
     An array with powers of ten that fit in the type int .
final static  intwhenUseKaratsuba
     Break point in digits (number of int elements) between Karatsuba and Pencil and Paper multiply.


Method Summary
static  BigIntegerkaratsuba(BigInteger op1, BigInteger op2)
     Performs the multiplication with the Karatsuba's algorithm.
static  BigIntegermultiply(BigInteger x, BigInteger y)
     Performs a multiplication of two BigInteger and hides the algorithm used.
static  BigIntegermultiplyByFivePow(BigInteger val, int exp)
     Multiplies a number by a power of five.
static  intmultiplyByInt(int a, int aSize, int factor)
     Multiplies an array of integers by an integer value.
static  BigIntegermultiplyByPositiveInt(BigInteger val, int factor)
     Multiplies a number by a positive integer.
static  BigIntegermultiplyByTenPow(BigInteger val, long exp)
     Multiplies a number by a power of ten.
static  BigIntegermultiplyPAP(BigInteger a, BigInteger b)
     Multiplies two BigIntegers.
static  BigIntegerpow(BigInteger base, int exponent)
    
static  BigIntegerpowerOf10(long exp)
     It calculates a power of ten, which exponent could be out of 32-bit range. Note that internally this method will be used in the worst case with an exponent equals to: Integer.MAX_VALUE - Integer.MIN_VALUE .
Parameters:
  exp - the exponent of power of ten, it must be positive.
static  int[]square(int[] a, int s)
    

Field Detail
bigFivePows
final static BigInteger bigFivePows(Code)
An array with the first powers of five in BigInteger version. ( 5^0,5^1,...,5^31 )



bigTenPows
final static BigInteger[] bigTenPows(Code)
An array with the first powers of ten in BigInteger version. ( 10^0,10^1,...,10^31 )



fivePows
final static int fivePows(Code)
An array with powers of five that fit in the type int . ( 5^0,5^1,...,5^13 )



tenPows
final static int tenPows(Code)
An array with powers of ten that fit in the type int . ( 10^0,10^1,...,10^9 )



whenUseKaratsuba
final static int whenUseKaratsuba(Code)
Break point in digits (number of int elements) between Karatsuba and Pencil and Paper multiply.





Method Detail
karatsuba
static BigInteger karatsuba(BigInteger op1, BigInteger op2)(Code)
Performs the multiplication with the Karatsuba's algorithm. Karatsuba's algorithm: u = u1 * B + u0
v = v1 * B + v0
u*v = (u1 * v1) * B2 + ((u1 - u0) * (v0 - v1) + u1 * v1 + u0 * v0 ) * B + u0 * v0

Parameters:
  op1 - first factor of the product
Parameters:
  op2 - second factor of the product op1 * op2
See Also:   Multiplication.multiply(BigInteger,BigInteger)



multiply
static BigInteger multiply(BigInteger x, BigInteger y)(Code)
Performs a multiplication of two BigInteger and hides the algorithm used.
See Also:   BigInteger.multiply(BigInteger)



multiplyByFivePow
static BigInteger multiplyByFivePow(BigInteger val, int exp)(Code)
Multiplies a number by a power of five. This method is used in BigDecimal class.
Parameters:
  val - the number to be multiplied
Parameters:
  exp - a positive int exponent val * 5exp



multiplyByInt
static int multiplyByInt(int a, int aSize, int factor)(Code)
Multiplies an array of integers by an integer value.
Parameters:
  a - the array of integers
Parameters:
  aSize - the number of elements of intArray to be multiplied
Parameters:
  factor - the multiplier the top digit of production



multiplyByPositiveInt
static BigInteger multiplyByPositiveInt(BigInteger val, int factor)(Code)
Multiplies a number by a positive integer.
Parameters:
  val - an arbitrary BigInteger
Parameters:
  factor - a positive int number val * factor



multiplyByTenPow
static BigInteger multiplyByTenPow(BigInteger val, long exp)(Code)
Multiplies a number by a power of ten. This method is used in BigDecimal class.
Parameters:
  val - the number to be multiplied
Parameters:
  exp - a positive long exponent val * 10exp



multiplyPAP
static BigInteger multiplyPAP(BigInteger a, BigInteger b)(Code)
Multiplies two BigIntegers. Implements traditional scholar algorithm described by Knuth.
A= a3 a2 a1 a0
B= b2 b1 b1
b0*a3 b0*a2 b0*a1 b0*a0
b1*a3 b1*a2 b1*a1 b1*a0
+ b2*a3 b2*a2 b2*a1 b2*a0
______ ______ ______ ______ ______ ______
A*B=R= r5 r4 r3 r2 r1 r0

Parameters:
  op1 - first factor of the multiplication op1 >= 0
Parameters:
  op2 - second factor of the multiplication op2 >= 0 a BigInteger of value op1 * op2



pow
static BigInteger pow(BigInteger base, int exponent)(Code)



powerOf10
static BigInteger powerOf10(long exp)(Code)
It calculates a power of ten, which exponent could be out of 32-bit range. Note that internally this method will be used in the worst case with an exponent equals to: Integer.MAX_VALUE - Integer.MIN_VALUE .
Parameters:
  exp - the exponent of power of ten, it must be positive. a BigInteger with value 10exp .



square
static int[] square(int[] a, int s)(Code)
Performs a2
Parameters:
  a - The number to square.
Parameters:
  length - The length of the number to square.



Methods inherited from java.lang.Object
protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object object)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final public Class<? extends Object> getClass()(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
final public void notify()(Code)(Java Doc)
final public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final public void wait(long millis, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait(long millis) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.