Skip to content

Commit

Permalink
i.pr: Replace drand48() with G_drand48(), Add lib version to -lgrass_…
Browse files Browse the repository at this point in the history
…pr for Windows (#842)
  • Loading branch information
HuidaeCho committed Dec 23, 2022
1 parent f9f3b3c commit cab2b91
Show file tree
Hide file tree
Showing 14 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/imagery/i.pr/PRLIB/bootstrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ void Bootsamples(int n, double *prob, int *random_labels)
cumprob = (double *)G_calloc(n, sizeof(double));

for (i = 0; i < n; ++i) {
random[i] = (double)drand48();
random[i] = G_drand48();
random_labels[i] = n - 1;
random_labels_flag[i] = 0;
}
Expand Down
6 changes: 3 additions & 3 deletions src/imagery/i.pr/PRLIB/svm.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ static int examineExample(int i1, SupportVectorMachine * SVM)
{
int k0, k, i2;

for (k0 = (int)(drand48() * SVM->end_support_i), k = k0;
for (k0 = (int)(G_drand48() * SVM->end_support_i), k = k0;
k < SVM->end_support_i + k0; k++) {
i2 = k % SVM->end_support_i;
if (SVM->alph[i2] > 0 && SVM->alph[i2] < SVM->Cw[i2]) {
Expand All @@ -340,7 +340,7 @@ static int examineExample(int i1, SupportVectorMachine * SVM)
{
int k0, k, i2;

for (k0 = (int)(drand48() * SVM->end_support_i), k = k0;
for (k0 = (int)(G_drand48() * SVM->end_support_i), k = k0;
k < SVM->end_support_i + k0; k++) {
i2 = k % SVM->end_support_i;
if (takeStep(i1, i2, SVM))
Expand Down Expand Up @@ -880,7 +880,7 @@ void estimate_cv_error(SupportVectorMachine * SVM)

if (n_span > SVM->d)
for (i = 0; i < n_span; i++)
M[i][i] += drand48() * M[i][i] / 100.;
M[i][i] += G_drand48() * M[i][i] / 100.;

indx1 = 0;
for (i = 0; i < SVM->N; i++)
Expand Down
2 changes: 1 addition & 1 deletion src/imagery/i.pr/i.pr_blob/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ MODULE_TOPDIR = ../../..

PRINCLUDE = ../include/
EXTRA_CFLAGS = -I$(PRINCLUDE)
PRLIB = -lgrass_pr
PRLIB = -lgrass_pr.$(GRASS_LIB_VERSION_NUMBER)

PGM = i.pr.blob

Expand Down
2 changes: 1 addition & 1 deletion src/imagery/i.pr/i.pr_classify/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ MODULE_TOPDIR = ../../..

PRINCLUDE = ../include/
EXTRA_CFLAGS = -I$(PRINCLUDE)
PRLIB = -lgrass_pr
PRLIB = -lgrass_pr.$(GRASS_LIB_VERSION_NUMBER)

PGM = i.pr.classify

Expand Down
2 changes: 1 addition & 1 deletion src/imagery/i.pr/i.pr_features/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ MODULE_TOPDIR = ../../..

PRINCLUDE = ../include/
EXTRA_CFLAGS = -I$(PRINCLUDE)
PRLIB = -lgrass_pr
PRLIB = -lgrass_pr.$(GRASS_LIB_VERSION_NUMBER)

PGM = i.pr.features

Expand Down
2 changes: 1 addition & 1 deletion src/imagery/i.pr/i.pr_features_additional/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ MODULE_TOPDIR = ../../..

PRINCLUDE = ../include/
EXTRA_CFLAGS = -I$(PRINCLUDE)
PRLIB = -lgrass_pr
PRLIB = -lgrass_pr.$(GRASS_LIB_VERSION_NUMBER)

PGM = i.pr.features_additional

Expand Down
2 changes: 1 addition & 1 deletion src/imagery/i.pr/i.pr_features_extract/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ MODULE_TOPDIR = ../../..

PRINCLUDE = ../include/
EXTRA_CFLAGS = -I$(PRINCLUDE)
PRLIB = -lgrass_pr
PRLIB = -lgrass_pr.$(GRASS_LIB_VERSION_NUMBER)

PGM = i.pr.features_extract

Expand Down
2 changes: 1 addition & 1 deletion src/imagery/i.pr/i.pr_features_selection/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ MODULE_TOPDIR = ../../..

PRINCLUDE = ../include/
EXTRA_CFLAGS = -I$(PRINCLUDE)
PRLIB = -lgrass_pr
PRLIB = -lgrass_pr.$(GRASS_LIB_VERSION_NUMBER)

PGM = i.pr.features_selection

Expand Down
2 changes: 1 addition & 1 deletion src/imagery/i.pr/i.pr_model/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ MODULE_TOPDIR = ../../..

PRINCLUDE = ../include/
EXTRA_CFLAGS = -I$(PRINCLUDE)
PRLIB = -lgrass_pr
PRLIB = -lgrass_pr.$(GRASS_LIB_VERSION_NUMBER)

PGM = i.pr.model

Expand Down
2 changes: 1 addition & 1 deletion src/imagery/i.pr/i.pr_sites_aggregate/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ MODULE_TOPDIR = ../../..

PRINCLUDE = ../include/
EXTRA_CFLAGS = $(VECT_CFLAGS) -I$(PRINCLUDE)
PRLIB = -lgrass_pr
PRLIB = -lgrass_pr.$(GRASS_LIB_VERSION_NUMBER)

PGM = i.pr.sites_aggregate

Expand Down
2 changes: 1 addition & 1 deletion src/imagery/i.pr/i.pr_statistics/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ MODULE_TOPDIR = ../../..

PRINCLUDE = ../include/
EXTRA_CFLAGS = -I$(PRINCLUDE)
PRLIB = -lgrass_pr
PRLIB = -lgrass_pr.$(GRASS_LIB_VERSION_NUMBER)

PGM = i.pr.statistics

Expand Down
2 changes: 1 addition & 1 deletion src/imagery/i.pr/i.pr_subsets/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ MODULE_TOPDIR = ../../..

PRINCLUDE = ../include/
EXTRA_CFLAGS = -I$(PRINCLUDE)
PRLIB = -lgrass_pr
PRLIB = -lgrass_pr.$(GRASS_LIB_VERSION_NUMBER)

PGM = i.pr.subsets

Expand Down
2 changes: 1 addition & 1 deletion src/imagery/i.pr/i.pr_training/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ MODULE_TOPDIR = ../../..

PRINCLUDE = ../include/
EXTRA_CFLAGS = -I$(PRINCLUDE)
PRLIB = -lgrass_pr
PRLIB = -lgrass_pr.$(GRASS_LIB_VERSION_NUMBER)

PGM = i.pr.training

Expand Down
2 changes: 1 addition & 1 deletion src/imagery/i.pr/i.pr_uxb/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ MODULE_TOPDIR = ../../..

PRINCLUDE = ../include/
EXTRA_CFLAGS = -I$(PRINCLUDE)
PRLIB = -lgrass_pr
PRLIB = -lgrass_pr.$(GRASS_LIB_VERSION_NUMBER)

PGM = i.pr.uxb

Expand Down

0 comments on commit cab2b91

Please sign in to comment.