commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebastien Riou (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (MATH-845) Basic number theory features such as primality testing, factorization and prime number generation
Date Tue, 14 Aug 2012 17:22:38 GMT

    [ https://issues.apache.org/jira/browse/MATH-845?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13434283#comment-13434283
] 

Sebastien Riou commented on MATH-845:
-------------------------------------

Thanks for the review, I will apply the requested formatting next time. So I guess I am not
running checkstyle correctly, because I did not see any of those errors in the report. I run
it from command line "mvn checkstyle:checkstyle", and I have modified my local copy of pom.xml
with the following:
      <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <version>2.9.1</version>
          <configuration>
              <configLocation>checkstyle.xml</configLocation>
          </configuration>
      </plugin>
inserted in <build>. Is there something I am missing ?

About "assert", In the case of private or package private methods, is it also required to
turn them into runtime checks ? Is it acceptable to simply comment them if the performance
impact is significant ?

interface Primes<T extends Number> -> agreed

implementation/performance question: I expect implementation for long to be significantly
slower, as it is the case for gcd. int implementation uses long for some internal values,
so a long implementation will need to use BigInteger at those places, that should slow down
things... Also current int implementation contain an array with all primes smaller or equal
to the cubic square of Integer.MAX_VALUE. Doing the same for Long.MAX_VALUE is going to significantly
increase the size of the array, I am not sure if this is desirable -> in short some performance
tricks applicable to int don't scale well.
I am more inclined to share the same implementation for long and BigInteger.

                
> Basic number theory features such as primality testing, factorization and prime number
generation
> -------------------------------------------------------------------------------------------------
>
>                 Key: MATH-845
>                 URL: https://issues.apache.org/jira/browse/MATH-845
>             Project: Commons Math
>          Issue Type: New Feature
>    Affects Versions: 3.1
>         Environment: ubuntu/java6/intel-i5
>            Reporter: Sebastien Riou
>            Priority: Minor
>              Labels: features
>             Fix For: 3.1
>
>         Attachments: primes-src.zip
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> A set of static methods to perform primality test, factorization and prime number generation.
Currently it is limited to the int data type, extension to long/BigInteger will follow.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message