Skip to content
This repository has been archived by the owner on Oct 24, 2024. It is now read-only.

Commit

Permalink
Done 1.2.1-beta.
Browse files Browse the repository at this point in the history
  • Loading branch information
jp-diegidio committed Aug 27, 2016
1 parent 32c9586 commit 41af743
Show file tree
Hide file tree
Showing 23 changed files with 182 additions and 41 deletions.
4 changes: 2 additions & 2 deletions Code/nan_numerics_prime.pl
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
Example:
==
?- pack_install('nan_numerics_prime-1.2.zip').
?- pack_install(nan_numerics_prime).
true.
?- use_module(library(nan_numerics_prime)).
Expand All @@ -94,7 +94,7 @@
==
@author Julio P. Di Egidio
@version 1.2-beta
@version 1.2.1-beta
@copyright 2016 Julio P. Di Egidio
@license GNU GPLv3
@tbd Implement prime counting/n-th prime functions.
Expand Down
2 changes: 1 addition & 1 deletion Code/nan_numerics_prime_lgc.pl
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
arguments and are not steadfast.
@author Julio P. Di Egidio
@version 1.2-beta
@version 1.2.1-beta
@copyright 2016 Julio P. Di Egidio
@license GNU GPLv3
@tbd Integrate =isqrt= function from GMP?
Expand Down
2 changes: 1 addition & 1 deletion Code/nan_numerics_prime_mem.pl
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
*NOTE*: Predicates in this module are not meant for public use.
@author Julio P. Di Egidio
@version 1.2-beta
@version 1.2.1-beta
@copyright 2016 Julio P. Di Egidio
@license GNU GPLv3
@tbd Implement size limits?
Expand Down
2 changes: 1 addition & 1 deletion Code/nan_numerics_prime_pio.pl
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
*NOTE*: Predicates in this module are not meant for public use.
@author Julio P. Di Egidio
@version 1.2-beta
@version 1.2.1-beta
@copyright 2016 Julio P. Di Egidio
@license GNU GPLv3
*/
Expand Down
2 changes: 1 addition & 1 deletion Code/nan_numerics_prime_prb.pl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
*NOTE*: Predicates in this module are not meant for public use.
@author Julio P. Di Egidio
@version 1.2-beta
@version 1.2.1-beta
@copyright 2016 Julio P. Di Egidio
@license GNU GPLv3
@tbd Implement test error estimates?
Expand Down
2 changes: 1 addition & 1 deletion Code/nan_numerics_prime_whl.pl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
*NOTE*: Predicates in this module are not meant for public use.
@author Julio P. Di Egidio
@version 1.2-beta
@version 1.2.1-beta
@copyright 2016 Julio P. Di Egidio
@license GNU GPLv3
*/
Expand Down
23 changes: 17 additions & 6 deletions Deploy/pack.bat
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,18 @@
: You should have received a copy of the GNU General Public License
: along with Nan.Numerics.Prime. If not, see <http://www.gnu.org/licenses/>.

@echo off
@rem Nan.Numerics.Prime::pack.bat (1.2.1-beta)
@rem Author: Julio P. Di Egidio ([email protected])
@rem Requires PowerShell 4.0 and .NET 4.5

rem Requires PowerShell 4.0 and .NET 4.5
@echo off

set name=nan_numerics_prime
set /P ver=Version ?

set infoDir=..
set codeDir=..\Code
set testDir=..\Tests
set workDir=.\.work
set targetFile=..\Publish\%name%-%ver%.zip

Expand All @@ -45,16 +48,24 @@ echo Copying prolog...

xcopy /Q "%codeDir%\*.*" "%workDir%\prolog\"

echo Copying test...

xcopy /Q "%testDir%\*.*" "%workDir%\test\"

echo Generating target...

if exist "%targetFile%" (
del "%targetFile%"
)

PowerShell ^
-NoLogo -NonInteractive -NoProfile ^
-ExecutionPolicy Bypass ^
-File ".\zipDir.ps1" "%workDir%" "%targetFile%"
if exist "%targetFile%" (
pause
) else (
PowerShell ^
-ExecutionPolicy Bypass ^
-NoLogo -NoProfile ^
-File ".\zipDir.ps1" "%workDir%" "%targetFile%"
)

echo Cleaning up...

Expand Down
18 changes: 9 additions & 9 deletions Deploy/zipDir.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<# Nan.Windows.Scripts
Windows PowerShell Scripts.
Windows Shell Scripts
Copyright 2016 Julio P. Di Egidio
<mailto:[email protected]>
<http://julio.diegidio.name/Projects/Nan.Windows.Scripts/>
Expand All @@ -13,22 +13,22 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#>

# Usage: zipDir.ps1 <sourceDir> <targetZipFile>
# Nan.Windows.Scripts::zipDir.ps1 (1.2.1)
# Author: Julio P. Di Egidio ([email protected])
# Usage: $ zipDir.ps1 <sourceDir> <targetFile>
# Adapted from http://stackoverflow.com/a/27289116
# Requires PowerShell 4.0 and .NET 4.5
# NOTE: Requires PS option ExecutionPolicy=Bypass

$peTypeSource = @'
using System.Text;
namespace Nan.Windows.Scripts
{
public class PathEncoder : UTF8Encoding
{
namespace Nan.Windows.Scripts {
public class PathEncoder : UTF8Encoding {
public PathEncoder() {}
public override byte[] GetBytes(string s)
{
public override byte[] GetBytes(string s) {
s = s.Replace("\\", "/");
return base.GetBytes(s);
}
}
}
}
'@
Expand Down
17 changes: 17 additions & 0 deletions HISTORY
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Nan.Numerics.Prime
A simple prime number library
Copyright 2016 Julio P. Di Egidio
Licensed under GNU GPLv3.
http://julio.diegidio.name/Projects/Nan.Numerics.Prime/
https://github.com/jp-diegidio/Nan.Numerics.Prime-Prolog/

Version 1.2.1-beta:
-------------------
- Integration of tests into SWI pack system.
- Bundled Nan.Windows.Scripts (1.2.1).
- Few non-critical code improvements.
- Created history file.

Version 1.2-beta:
-----------------
- Tagged version 1.2-beta.
Binary file added Publish/nan_numerics_prime-1.2.1.zip
Binary file not shown.
6 changes: 3 additions & 3 deletions README
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Nan.Numerics.Prime 1.2-beta
Nan.Numerics.Prime (1.2.1-beta)
A simple prime number library
Copyright 2016 Julio P. Di Egidio
Licensed under GNU GPLv3.
Expand All @@ -24,12 +24,12 @@ call the _unsafe_ =public= (not exported) predicates in sub-module
library is not suitable for cryptographic applications.

This library was developed and tested with:
SWI-Prolog 7.3.24: http://www.swi-prolog.org/
SWI-Prolog 7.3.24 - http://www.swi-prolog.org/

Example:

==
?- pack_install('nan_numerics_prime-1.2.zip').
?- pack_install(nan_numerics_prime).
true.

?- use_module(library(nan_numerics_prime)).
Expand Down
Binary file added Resources/Nan.Windows.Scripts-1.2.1.zip
Binary file not shown.
12 changes: 11 additions & 1 deletion Tests/debug.pl
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,23 @@
*/
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

:- module(debug_, []).
/** <file> A simple prime number library :: debug
@author Julio P. Di Egidio
@version 1.2.1-beta
@copyright 2016 Julio P. Di Egidio
@license GNU GPLv3
*/

:- use_module(library(doc_http)).

:- doc_server(4000, [edit(false)]).
:- portray_text(true).

:- if(exists_file('../Code/nan_numerics_prime.pl')).
:- consult('../Code/nan_numerics_prime').
:- else.
:- consult('../prolog/nan_numerics_prime').
:- endif.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
15 changes: 10 additions & 5 deletions Tests/prime.test.pl
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,20 @@
*/
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

/** <test> A simple prime number library
@author Julio P. Di Egidio
@version 1.2.1-beta
@copyright 2016 Julio P. Di Egidio
@license GNU GPLv3
*/

% (SWI-Prolog 7.3.24)

:- use_module(library(plunit)).

:- use_module('../Code/nan_numerics_prime').
:- ensure_loaded(test_inc).
:- test_module('nan_numerics_prime.pl').

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Expand Down Expand Up @@ -220,7 +229,6 @@
true((C, H) == (TC0, TH))
]) :-
prime_save_file(File, 100), write(w),
prime_mem_clear,
prime_load_file(File), write(r),
prime_mem_count(C),
prime_mem:max_(H).
Expand All @@ -235,7 +243,6 @@
true((C, H) == (TC0, TH))
]) :-
prime_save_file(File, 1000), write(w),
prime_mem_clear,
prime_load_file(File), write(r),
prime_mem_count(C),
prime_mem:max_(H).
Expand All @@ -250,7 +257,6 @@
true((C, H) == (TC0, TH))
]) :-
prime_save_file(File, 1000), write(w),
prime_mem_clear,
prime_load_file(File, 100), write(r),
prime_mem_count(C),
prime_mem:max_(H).
Expand All @@ -265,7 +271,6 @@
true((C, H) == (TC0, TH))
]) :-
prime_save_file(File, 1000), write(w),
prime_mem_clear,
prime_load_file(File, TH), write(r),
prime_mem_count(C),
prime_mem:max_(H).
Expand Down
11 changes: 10 additions & 1 deletion Tests/prime_lgc.test.pl
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,20 @@
*/
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

/** <test> A simple prime number library :: logic
@author Julio P. Di Egidio
@version 1.2.1-beta
@copyright 2016 Julio P. Di Egidio
@license GNU GPLv3
*/

% (SWI-Prolog 7.3.24)

:- use_module(library(plunit)).

:- use_module('../Code/nan_numerics_prime_lgc').
:- ensure_loaded(test_inc).
:- test_module('nan_numerics_prime_lgc.pl').

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Expand Down
11 changes: 10 additions & 1 deletion Tests/prime_mem.test.pl
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,20 @@
*/
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

/** <test> A simple prime number library :: memoization
@author Julio P. Di Egidio
@version 1.2.1-beta
@copyright 2016 Julio P. Di Egidio
@license GNU GPLv3
*/

% (SWI-Prolog 7.3.24)

:- use_module(library(plunit)).

:- use_module('../Code/nan_numerics_prime_mem').
:- ensure_loaded(test_inc).
:- test_module('nan_numerics_prime_mem.pl').

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Expand Down
11 changes: 10 additions & 1 deletion Tests/prime_pio.test.pl
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,20 @@
*/
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

/** <test> A simple prime number library :: pure I/O
@author Julio P. Di Egidio
@version 1.2.1-beta
@copyright 2016 Julio P. Di Egidio
@license GNU GPLv3
*/

% (SWI-Prolog 7.3.24)

:- use_module(library(plunit)).

:- use_module('../Code/nan_numerics_prime_pio').
:- ensure_loaded(test_inc).
:- test_module('nan_numerics_prime_pio.pl').

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Expand Down
11 changes: 10 additions & 1 deletion Tests/prime_prb.test.pl
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,20 @@
*/
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

/** <test> A simple prime number library :: probabilistic
@author Julio P. Di Egidio
@version 1.2.1-beta
@copyright 2016 Julio P. Di Egidio
@license GNU GPLv3
*/

% (SWI-Prolog 7.3.24)

:- use_module(library(plunit)).

:- use_module('../Code/nan_numerics_prime_prb').
:- ensure_loaded(test_inc).
:- test_module('nan_numerics_prime_prb.pl').

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Expand Down
11 changes: 10 additions & 1 deletion Tests/prime_whl.test.pl
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,20 @@
*/
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

/** <test> A simple prime number library :: wheel
@author Julio P. Di Egidio
@version 1.2.1-beta
@copyright 2016 Julio P. Di Egidio
@license GNU GPLv3
*/

% (SWI-Prolog 7.3.24)

:- use_module(library(plunit)).

:- use_module('../Code/nan_numerics_prime_whl').
:- ensure_loaded(test_inc).
:- test_module('nan_numerics_prime_whl.pl').

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Expand Down
4 changes: 2 additions & 2 deletions Tests/session.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

?- pack_install('../prolog/nan_numerics_prime').
?- use_module('../prolog/nan_numerics_prime').
?- pack_install('<path>/nan_numerics_prime-<ver>.zip').

?- pack_install(nan_numerics_prime).

?- use_module(library(nan_numerics_prime)).

?- prime_mem_clear.
Expand Down
Loading

0 comments on commit 41af743

Please sign in to comment.